Skip to content

Commit 1041904

Browse files
committed
Turn on stack init so stack usage is correct
Initialize stack memory since this is required for stack metrics to work.
1 parent 6fd9154 commit 1041904

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@
135135
// <i> Initialize thread stack with watermark pattern for analyzing stack usage (current/maximum) in System and Thread Viewer.
136136
// <i> Enabling this option increases significantly the execution time of osThreadCreate.
137137
#ifndef OS_STKINIT
138-
#define OS_STKINIT 0
138+
#if (defined(MBED_STACK_STATS_ENABLED) && MBED_STACK_STATS_ENABLED)
139+
#define OS_STKINIT 1
140+
#else
141+
#define OS_STKINIT 0
142+
#endif
139143
#endif
140144

141145
// <o>Processor mode for thread execution

0 commit comments

Comments
 (0)