Skip to content

Commit 4a4d09f

Browse files
authored
Merge pull request #3074 from jamike/TARGET_STM_INIT_GCC_ALIGNEMENT
Target STM - init gcc alignement
2 parents 51fc2ce + 4a69072 commit 4a4d09f

File tree

56 files changed

+36
-790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+36
-790
lines changed

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

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
6258

6359
.section .text.Reset_Handler
6460
.weak Reset_Handler
@@ -83,27 +79,17 @@ LoopCopyDataInit:
8379
adds r2, r0, r1
8480
cmp r2, r3
8581
bcc CopyDataInit
86-
ldr r2, =_sbss
87-
b LoopFillZerobss
88-
/* Zero fill the bss segment. */
89-
FillZerobss:
90-
movs r3, #0
91-
str r3, [r2]
92-
adds r2, r2, #4
93-
94-
95-
LoopFillZerobss:
96-
ldr r3, = _ebss
97-
cmp r2, r3
98-
bcc FillZerobss
9982

10083
/* Call the clock system intitialization function.*/
10184
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
104-
/* Call the application's entry point.*/
105-
bl main
106-
bl exit
85+
86+
/**
87+
* Calling the crt0 'cold-start' entry point. There __libc_init_array is called
88+
* and when existing hardware_init_hook() and software_init_hook() before
89+
* starting main(). software_init_hook() is available and has to be called due
90+
* to initializsation when using rtos.
91+
*/
92+
bl _start
10793
LoopForever:
10894
b LoopForever
10995

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
6258

6359
.section .text.Reset_Handler
6460
.weak Reset_Handler
@@ -83,24 +79,10 @@ LoopCopyDataInit:
8379
adds r2, r0, r1
8480
cmp r2, r3
8581
bcc CopyDataInit
86-
ldr r2, =_sbss
87-
b LoopFillZerobss
88-
/* Zero fill the bss segment. */
89-
FillZerobss:
90-
movs r3, #0
91-
str r3, [r2]
92-
adds r2, r2, #4
93-
94-
95-
LoopFillZerobss:
96-
ldr r3, = _ebss
97-
cmp r2, r3
98-
bcc FillZerobss
9982

10083
/* Call the clock system intitialization function.*/
10184
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
85+
10486
/* Call the application's entry point.*/
10587
// bl main
10688
bl _start

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
6258

6359
.section .text.Reset_Handler
6460
.weak Reset_Handler
@@ -83,24 +79,10 @@ LoopCopyDataInit:
8379
adds r2, r0, r1
8480
cmp r2, r3
8581
bcc CopyDataInit
86-
ldr r2, =_sbss
87-
b LoopFillZerobss
88-
/* Zero fill the bss segment. */
89-
FillZerobss:
90-
movs r3, #0
91-
str r3, [r2]
92-
adds r2, r2, #4
93-
94-
95-
LoopFillZerobss:
96-
ldr r3, = _ebss
97-
cmp r2, r3
98-
bcc FillZerobss
9982

10083
/* Call the clock system intitialization function.*/
10184
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
85+
10486
/* Call the application's entry point.*/
10587
// bl main
10688
bl _start

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
6258

6359
/**
6460
* @brief This is the code that gets called when the processor first
@@ -115,24 +111,10 @@ LoopCopyDataInit:
115111
adds r2, r0, r1
116112
cmp r2, r3
117113
bcc CopyDataInit
118-
ldr r2, =_sbss
119-
b LoopFillZerobss
120-
/* Zero fill the bss segment. */
121-
FillZerobss:
122-
movs r3, #0
123-
str r3, [r2]
124-
adds r2, r2, #4
125-
126-
127-
LoopFillZerobss:
128-
ldr r3, = _ebss
129-
cmp r2, r3
130-
bcc FillZerobss
131114

132115
/* Call the clock system intitialization function.*/
133116
bl SystemInit
134-
/* Call static constructors */
135-
bl __libc_init_array
117+
136118
/* Call the application's entry point.*/
137119
// bl main
138120
bl _start

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

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,7 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
58+
6259

6360
.section .text.Reset_Handler
6461
.weak Reset_Handler
@@ -83,24 +80,10 @@ LoopCopyDataInit:
8380
adds r2, r0, r1
8481
cmp r2, r3
8582
bcc CopyDataInit
86-
ldr r2, =_sbss
87-
b LoopFillZerobss
88-
/* Zero fill the bss segment. */
89-
FillZerobss:
90-
movs r3, #0
91-
str r3, [r2]
92-
adds r2, r2, #4
93-
94-
95-
LoopFillZerobss:
96-
ldr r3, = _ebss
97-
cmp r2, r3
98-
bcc FillZerobss
9983

10084
/* Call the clock system intitialization function.*/
10185
bl SystemInit
102-
/* Call static constructors */
103-
bl __libc_init_array
86+
10487
/* Call the application's entry point.*/
10588
// bl main
10689
bl _start

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/TOOLCHAIN_GCC_ARM/startup_stm32f072xb.S

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
6258

6359
.section .text.Reset_Handler
6460
.weak Reset_Handler
@@ -83,19 +79,6 @@ LoopCopyDataInit:
8379
adds r2, r0, r1
8480
cmp r2, r3
8581
bcc CopyDataInit
86-
ldr r2, =_sbss
87-
b LoopFillZerobss
88-
/* Zero fill the bss segment. */
89-
FillZerobss:
90-
movs r3, #0
91-
str r3, [r2]
92-
adds r2, r2, #4
93-
94-
95-
LoopFillZerobss:
96-
ldr r3, = _ebss
97-
cmp r2, r3
98-
bcc FillZerobss
9982

10083
/* Call the clock system intitialization function.*/
10184
bl SystemInit

targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/TOOLCHAIN_GCC_ARM/startup_stm32f091xc.S

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ defined in linker script */
5555
.word _sdata
5656
/* end address for the .data section. defined in linker script */
5757
.word _edata
58-
/* start address for the .bss section. defined in linker script */
59-
.word _sbss
60-
/* end address for the .bss section. defined in linker script */
61-
.word _ebss
6258

6359
.section .text.Reset_Handler
6460
.weak Reset_Handler
@@ -83,19 +79,6 @@ LoopCopyDataInit:
8379
adds r2, r0, r1
8480
cmp r2, r3
8581
bcc CopyDataInit
86-
ldr r2, =_sbss
87-
b LoopFillZerobss
88-
/* Zero fill the bss segment. */
89-
FillZerobss:
90-
movs r3, #0
91-
str r3, [r2]
92-
adds r2, r2, #4
93-
94-
95-
LoopFillZerobss:
96-
ldr r3, = _ebss
97-
cmp r2, r3
98-
bcc FillZerobss
9982

10083
/* Call the clock system intitialization function.*/
10184
bl SystemInit

targets/TARGET_STM/TARGET_STM32F0/mbed_overrides.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
void mbed_sdk_init() {
3232
// Update the SystemCoreClock variable.
3333
SystemCoreClockUpdate();
34-
#if !defined(TOOLCHAIN_GCC_ARM)
3534
// Need to restart HAL driver after the RAM is initialized
3635
HAL_Init();
37-
#endif
3836
}

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/TOOLCHAIN_GCC_ARM/startup_stm32f103xb.S

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ defined in linker script */
5858
.word _sdata
5959
/* end address for the .data section. defined in linker script */
6060
.word _edata
61-
/* start address for the .bss section. defined in linker script */
62-
.word _sbss
63-
/* end address for the .bss section. defined in linker script */
64-
.word _ebss
6561

6662
.equ BootRAM, 0xF108F85F
6763
/**
@@ -96,17 +92,6 @@ LoopCopyDataInit:
9692
adds r2, r0, r1
9793
cmp r2, r3
9894
bcc CopyDataInit
99-
ldr r2, =_sbss
100-
b LoopFillZerobss
101-
/* Zero fill the bss segment. */
102-
FillZerobss:
103-
movs r3, #0
104-
str r3, [r2], #4
105-
106-
LoopFillZerobss:
107-
ldr r3, = _ebss
108-
cmp r2, r3
109-
bcc FillZerobss
11095

11196
/* Call the clock system intitialization function.*/
11297
bl SystemInit

targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/TOOLCHAIN_GCC_ARM/startup_stm32f100xb.S

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ defined in linker script */
5858
.word _sdata
5959
/* end address for the .data section. defined in linker script */
6060
.word _edata
61-
/* start address for the .bss section. defined in linker script */
62-
.word _sbss
63-
/* end address for the .bss section. defined in linker script */
64-
.word _ebss
61+
6562

6663
.equ BootRAM, 0xF108F85F
6764
/**
@@ -94,17 +91,6 @@ LoopCopyDataInit:
9491
adds r2, r0, r1
9592
cmp r2, r3
9693
bcc CopyDataInit
97-
ldr r2, =_sbss
98-
b LoopFillZerobss
99-
/* Zero fill the bss segment. */
100-
FillZerobss:
101-
movs r3, #0
102-
str r3, [r2], #4
103-
104-
LoopFillZerobss:
105-
ldr r3, = _ebss
106-
cmp r2, r3
107-
bcc FillZerobss
10894

10995
/* Call the clock system intitialization function.*/
11096
bl SystemInit

targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/TOOLCHAIN_GCC_ARM/startup_stm32f103xb.S

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ defined in linker script */
5858
.word _sdata
5959
/* end address for the .data section. defined in linker script */
6060
.word _edata
61-
/* start address for the .bss section. defined in linker script */
62-
.word _sbss
63-
/* end address for the .bss section. defined in linker script */
64-
.word _ebss
6561

6662
.equ BootRAM, 0xF108F85F
6763
/**
@@ -96,17 +92,6 @@ LoopCopyDataInit:
9692
adds r2, r0, r1
9793
cmp r2, r3
9894
bcc CopyDataInit
99-
ldr r2, =_sbss
100-
b LoopFillZerobss
101-
/* Zero fill the bss segment. */
102-
FillZerobss:
103-
movs r3, #0
104-
str r3, [r2], #4
105-
106-
LoopFillZerobss:
107-
ldr r3, = _ebss
108-
cmp r2, r3
109-
bcc FillZerobss
11095

11196
/* Call the clock system intitialization function.*/
11297
bl SystemInit

targets/TARGET_STM/TARGET_STM32F1/mbed_overrides.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ void mbed_sdk_init()
3232
{
3333
// Update the SystemCoreClock variable.
3434
SystemCoreClockUpdate();
35-
#if !defined(TOOLCHAIN_GCC_ARM)
3635
// Need to restart HAL driver after the RAM is initialized
3736
HAL_Init();
38-
#endif
3937
}

targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/TOOLCHAIN_GCC_ARM/startup_stm32f207xx.s

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ defined in linker script */
5757
.word _sdata
5858
/* end address for the .data section. defined in linker script */
5959
.word _edata
60-
/* start address for the .bss section. defined in linker script */
61-
.word _sbss
62-
/* end address for the .bss section. defined in linker script */
63-
.word _ebss
6460
/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
6561

6662
/**
@@ -94,17 +90,6 @@ LoopCopyDataInit:
9490
adds r2, r0, r1
9591
cmp r2, r3
9692
bcc CopyDataInit
97-
ldr r2, =_sbss
98-
b LoopFillZerobss
99-
/* Zero fill the bss segment. */
100-
FillZerobss:
101-
movs r3, #0
102-
str r3, [r2], #4
103-
104-
LoopFillZerobss:
105-
ldr r3, = _ebss
106-
cmp r2, r3
107-
bcc FillZerobss
10893

10994
/* Call the clock system initialization function.*/
11095
bl SystemInit
@@ -520,4 +505,4 @@ g_pfnVectors:
520505
.weak HASH_RNG_IRQHandler
521506
.thumb_set HASH_RNG_IRQHandler,Default_Handler
522507

523-
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
508+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)