Skip to content

Commit f617643

Browse files
committed
error: use __INITIAL_SP from cmsis instead of RTX one
We used to require INITIAL_SP as rtx target headers define it. This should not be required, as cmsis already defines symbol __INITIAL_SP for all toolchains. Fixes #14432
1 parent 376fda5 commit f617643

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

platform/source/mbed_error.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "platform/internal/mbed_error_hist.h"
3030
#include "drivers/MbedCRC.h"
3131
#include "mbed_rtx.h"
32+
#include "cmsis_compiler.h"
3233
#ifdef MBED_CONF_RTOS_PRESENT
3334
#include "rtx_os.h"
3435
#endif
@@ -518,7 +519,7 @@ static void print_stack_dump(uint32_t stack_start, uint32_t stack_size, uint32_t
518519
// PSP mode. Then SP_reg is more correct.
519520
psp_sp = mfc->SP_reg;
520521
}
521-
uint32_t msp_size = MAX(0, (int)INITIAL_SP - (int)msp_sp);
522+
uint32_t msp_size = MAX(0, (int)__INITIAL_SP - (int)msp_sp);
522523
print_stack_dump_core(msp_sp, msp_size, msp_sp, "MSP");
523524

524525
stack_sp = psp_sp;

0 commit comments

Comments
 (0)