Skip to content

Commit 5079bbf

Browse files
0xc0170Bartek Szatkowski
authored andcommitted
mbed boot: fixes iar stack and heap initialization
Order was wrong as it initialiazed global variables for mbed stack and heap, then invoked __iar_data_init3 that would set this to 0. This explains why stack/heap test was failing.
1 parent 52ae1ef commit 5079bbf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rtos/mbed_boot.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@
105105
* -> __iar_init_core
106106
* -> __iar_init_core
107107
* -> __iar_init_vfp
108-
* -> mbed_set_stack_heap (MBED: rtos/mbed_boot.c)
109108
* -> __low_level_init
110109
* -> __iar_data_init3
111110
* -> mbed_sdk_init (TARGET)
111+
* -> mbed_set_stack_heap (MBED: rtos/mbed_boot.c)
112112
* -> osKernelInitialize (RTX)
113113
* -> mbed_start_main (MBED: rtos/mbed_boot.c)
114114
* -> mbed_cpy_nvic (MBED: rtos/mbed_boot.c)
@@ -529,15 +529,16 @@ void __iar_program_start( void )
529529
__iar_init_core();
530530
__iar_init_vfp();
531531

532-
mbed_set_stack_heap();
533-
534532
uint8_t low_level_init_needed_local;
535533

536534
low_level_init_needed_local = __low_level_init();
537535
if (low_level_init_needed_local) {
538536
__iar_data_init3();
539537
mbed_sdk_init();
540538
}
539+
540+
mbed_set_stack_heap();
541+
541542
/* Store in a global variable after RAM has been initialized */
542543
low_level_init_needed = low_level_init_needed_local;
543544

0 commit comments

Comments
 (0)