Skip to content

Commit f3b1c0a

Browse files
committed
STM32L1xx : GCC_ARM a call to _start which performs
zero bss, C++ init and the call to main. Remove direct call to __libc_init_array and main not needed as _start is beeing called.
1 parent a711ff3 commit f3b1c0a

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/TOOLCHAIN_GCC_ARM/startup_stm32l152xc.S

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,16 @@ LoopFillZerobss:
109109

110110
/* Call the clock system intitialization function.*/
111111
bl SystemInit
112-
/* Call static constructors */
113-
bl __libc_init_array
114-
/* Call the application's entry point.*/
115-
bl main
112+
113+
/**
114+
* Calling the crt0 'cold-start' entry point. There __libc_init_array is called
115+
* and when existing hardware_init_hook() and software_init_hook() before
116+
* starting main(). software_init_hook() is available and has to be called due
117+
* to initializsation when using rtos.
118+
*/
119+
bl _start
116120
bx lr
121+
117122
.size Reset_Handler, .-Reset_Handler
118123

119124
/**

targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/TOOLCHAIN_GCC_ARM/startup_stm32l151xc.S

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,15 @@ LoopFillZerobss:
109109

110110
/* Call the clock system intitialization function.*/
111111
bl SystemInit
112-
/* Call static constructors */
113-
bl __libc_init_array
114-
/* Call the application's entry point.*/
115-
bl main
116-
bx lr
112+
113+
/**
114+
* Calling the crt0 'cold-start' entry point. There __libc_init_array is called
115+
* and when existing hardware_init_hook() and software_init_hook() before
116+
* starting main(). software_init_hook() is available and has to be called due
117+
* to initializsation when using rtos.
118+
*/
119+
bl _start
120+
bx lr
117121
.size Reset_Handler, .-Reset_Handler
118122

119123
/**

0 commit comments

Comments
 (0)