From 7eae93cfad096305a25787d20091f69332e1a68f Mon Sep 17 00:00:00 2001 From: tyeth Date: Wed, 9 Sep 2026 23:44:56 +0100 Subject: [PATCH] zephyr-cp: fix the make DEBUG=1 build (quote the EXTRA_CONF_FILE list) With DEBUG=1 the Makefile appends debug.conf to the board conf as a ";"-separated list and passed it to west unquoted: -Dzephyr-cp_EXTRA_CONF_FILE=.../board.conf;.../debug.conf The unquoted ";" ends the shell command, so west ran with only board.conf and the shell then tried to execute ".../debug.conf" as a program. Quote the whole -D argument so the ";"-separated list reaches CMake intact. A DEBUG=1 build now completes; verified it links and produces a bootable image (build reaches "Completed 'zephyr-cp'", debug.conf is merged, CONFIG_DEBUG and CONFIG_LOG_MODE_IMMEDIATE are set). Note debug.conf sets CONFIG_LOG_MODE_IMMEDIATE=y, which serialises logging in-thread over UART0 and distorts timing, so a DEBUG build must not be used to measure latency. Co-Authored-By: Claude Opus 5 --- ports/zephyr-cp/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/zephyr-cp/Makefile b/ports/zephyr-cp/Makefile index e21a96e9eb8..aa99eb4d1eb 100644 --- a/ports/zephyr-cp/Makefile +++ b/ports/zephyr-cp/Makefile @@ -40,8 +40,11 @@ else CP_BOARD_CONF := $(DEBUG_CONF_FILE) endif endif +# Quoted: with DEBUG=1 this is a ;-separated list, and an unquoted ; ends the +# shell command, so west built without debug.conf and the shell then tried to +# run debug.conf as a program. ifneq ($(CP_BOARD_CONF),) -WEST_CMAKE_ARGS += -Dzephyr-cp_EXTRA_CONF_FILE=$(CP_BOARD_CONF) +WEST_CMAKE_ARGS += "-Dzephyr-cp_EXTRA_CONF_FILE=$(CP_BOARD_CONF)" endif .PHONY: $(BUILD)/zephyr-cp/zephyr/zephyr.elf flash recover debug debug-jlink debugserver attach run run-sim clean menuconfig all clean-all sim clean-sim test fetch-port-submodules