Skip to content

Commit 9f20c46

Browse files
committed
STM32F0xx : GCC_ARM use 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 af090e3 commit 9f20c46

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/TOOLCHAIN_GCC_ARM/startup_stm32f051x8.S

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,14 @@ LoopFillZerobss:
9999

100100
/* Call the clock system intitialization function.*/
101101
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
104-
/* Call the application's entry point.*/
105-
bl main
106-
bl exit
102+
103+
/**
104+
* Calling the crt0 'cold-start' entry point. There __libc_init_array is called
105+
* and when existing hardware_init_hook() and software_init_hook() before
106+
* starting main(). software_init_hook() is available and has to be called due
107+
* to initializsation when using rtos.
108+
*/
109+
bl _start
107110
LoopForever:
108111
b LoopForever
109112

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/TOOLCHAIN_GCC_ARM/startup_stm32f030x8.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ LoopFillZerobss:
9999

100100
/* Call the clock system intitialization function.*/
101101
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
102+
104103
/* Call the application's entry point.*/
105104
// bl main
106105
bl _start

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/TOOLCHAIN_GCC_ARM/startup_stm32f031x6.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ LoopFillZerobss:
9999

100100
/* Call the clock system intitialization function.*/
101101
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
102+
104103
/* Call the application's entry point.*/
105104
// bl main
106105
bl _start

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/TOOLCHAIN_GCC_ARM/startup_stm32f042x6.s

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ LoopFillZerobss:
131131

132132
/* Call the clock system intitialization function.*/
133133
bl SystemInit
134-
/* Call static constructors */
135-
bl __libc_init_array
134+
136135
/* Call the application's entry point.*/
137136
// bl main
138137
bl _start

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/TOOLCHAIN_GCC_ARM/startup_stm32f070xb.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ LoopFillZerobss:
9999

100100
/* Call the clock system intitialization function.*/
101101
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
102+
104103
/* Call the application's entry point.*/
105104
// bl main
106105
bl _start

0 commit comments

Comments
 (0)