From 46d57bd9e373871f917067a12ed0c12c39f3bac0 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 17 Nov 2025 19:49:52 +0100 Subject: [PATCH] extra: Add debug config overlay. Add debug config overlay to easily build debug images. Usage: ./extra/build.sh --debug The build includes extra/debug.conf which enables: - Debug mode with assertions and verbose output - Debug-level logging (level 4) - Stack overflow detection - Thread monitoring - Debug optimizations (-Og) Signed-off-by: iabdalkader --- extra/build.sh | 5 +++++ extra/debug.conf | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 extra/debug.conf diff --git a/extra/build.sh b/extra/build.sh index 6ff88b925..2b2bac7d5 100755 --- a/extra/build.sh +++ b/extra/build.sh @@ -51,6 +51,11 @@ else args="$*" fi +# Check for debug flag and append +if [ x$2 == x"--debug" ]; then + args="$args -- -DEXTRA_CONF_FILE=../extra/debug.conf" +fi + echo echo "Build target: $target $args" diff --git a/extra/debug.conf b/extra/debug.conf new file mode 100644 index 000000000..fc90d502c --- /dev/null +++ b/extra/debug.conf @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: Apache-2.0 +# Debug configuration for Arduino Core Zephyr + +# Enable debug mode +CONFIG_DEBUG=y + +# Enable assertions +CONFIG_ASSERT=y +CONFIG_ASSERT_VERBOSE=y + +# Enable stack overflow detection +CONFIG_STACK_SENTINEL=y +CONFIG_STACK_CANARIES=y + +# Enable thread monitoring +CONFIG_THREAD_MONITOR=y +CONFIG_THREAD_NAME=y + +# Disable compiler optimizations +CONFIG_DEBUG_OPTIMIZATIONS=y