diff --git a/extra/build.sh b/extra/build.sh index 6ff88b92..2b2bac7d 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 00000000..183d10bf --- /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