From 0df6fb2a0e868d4d2d7c0b8da2f770e78ec74de8 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 | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 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..183d10bfa --- /dev/null +++ b/extra/debug.conf @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: Apache-2.0 +# Debug configuration for Arduino Core Zephyr + +# Enable debug mode +CONFIG_DEBUG=y + +# Enable debug logging +CONFIG_LOG_MODE_IMMEDIATE=y +CONFIG_LOG_DEFAULT_LEVEL=4 + +# Workaround for TLS credentials issue fixed upstream +CONFIG_TLS_CREDENTIALS_LOG_LEVEL_INF=y + +# Enable assertions +CONFIG_ASSERT=y +CONFIG_ASSERT_VERBOSE=y + +# Enable stack overflow detection +CONFIG_STACK_SENTINEL=y + +# Enable thread monitoring +CONFIG_THREAD_MONITOR=y +CONFIG_THREAD_NAME=y + +# Disable compiler optimizations +CONFIG_DEBUG_OPTIMIZATIONS=y + +# Enable additional LLEXT debugging +CONFIG_LLEXT_LOG_LEVEL_DBG=y