Skip to content

Commit 46d57bd

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 46d57bd

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 assertions
8+
CONFIG_ASSERT=y
9+
CONFIG_ASSERT_VERBOSE=y
10+
11+
# Enable stack overflow detection
12+
CONFIG_STACK_SENTINEL=y
13+
CONFIG_STACK_CANARIES=y
14+
15+
# Enable thread monitoring
16+
CONFIG_THREAD_MONITOR=y
17+
CONFIG_THREAD_NAME=y
18+
19+
# Disable compiler optimizations
20+
CONFIG_DEBUG_OPTIMIZATIONS=y

0 commit comments

Comments
 (0)