Skip to content

Commit 0df6fb2

Browse files
committed
extra: Add debug config overlay.
Add debug config overlay to easily build debug images. Usage: ./extra/build.sh <board> --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 <[email protected]>
1 parent 93ad66d commit 0df6fb2

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

extra/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ else
5151
args="$*"
5252
fi
5353

54+
# Check for debug flag and append
55+
if [ x$2 == x"--debug" ]; then
56+
args="$args -- -DEXTRA_CONF_FILE=../extra/debug.conf"
57+
fi
58+
5459
echo
5560
echo "Build target: $target $args"
5661

extra/debug.conf

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Debug configuration for Arduino Core Zephyr
3+
4+
# Enable debug mode
5+
CONFIG_DEBUG=y
6+
7+
# Enable debug logging
8+
CONFIG_LOG_MODE_IMMEDIATE=y
9+
CONFIG_LOG_DEFAULT_LEVEL=4
10+
11+
# Workaround for TLS credentials issue fixed upstream
12+
CONFIG_TLS_CREDENTIALS_LOG_LEVEL_INF=y
13+
14+
# Enable assertions
15+
CONFIG_ASSERT=y
16+
CONFIG_ASSERT_VERBOSE=y
17+
18+
# Enable stack overflow detection
19+
CONFIG_STACK_SENTINEL=y
20+
21+
# Enable thread monitoring
22+
CONFIG_THREAD_MONITOR=y
23+
CONFIG_THREAD_NAME=y
24+
25+
# Disable compiler optimizations
26+
CONFIG_DEBUG_OPTIMIZATIONS=y
27+
28+
# Enable additional LLEXT debugging
29+
CONFIG_LLEXT_LOG_LEVEL_DBG=y

0 commit comments

Comments
 (0)