Skip to content

Commit 1d77cfa

Browse files
author
Andrea Gilardoni
committed
trying to fix startup file
1 parent 303b3c2 commit 1d77cfa

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

targets/TARGET_STM/TARGET_STM32L0/TARGET_MCU_STM32L071xx/device/TOOLCHAIN_GCC_ARM/startup_stm32l071xx.S

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
22
******************************************************************************
3-
* @file startup_stm32l073xx.s
3+
* @file startup_stm32l071xx.s
44
* @author MCD Application Team
5-
* @brief STM32L073xx Devices vector table for Atollic TrueSTUDIO toolchain.
5+
* @brief STM32L071xx Devices vector table for GCC toolchain.
66
* This module performs:
77
* - Set the initial SP
88
* - Set the initial PC == Reset_Handler,
@@ -12,7 +12,7 @@
1212
* After Reset the Cortex-M0+ processor is in Thread mode,
1313
* priority is Privileged, and the Stack is set to Main.
1414
******************************************************************************
15-
*
15+
*
1616
* Redistribution and use in source and binary forms, with or without modification,
1717
* are permitted provided that the following conditions are met:
1818
* 1. Redistributions of source code must retain the above copyright notice,
@@ -53,6 +53,10 @@ defined in linker script */
5353
.word _sdata
5454
/* end address for the .data section. defined in linker script */
5555
.word _edata
56+
/* start address for the .bss section. defined in linker script */
57+
.word _sbss
58+
/* end address for the .bss section. defined in linker script */
59+
.word _ebss
5660

5761
.section .text.Reset_Handler
5862
.weak Reset_Handler
@@ -77,6 +81,19 @@ LoopCopyDataInit:
7781
adds r2, r0, r1
7882
cmp r2, r3
7983
bcc CopyDataInit
84+
ldr r2, =_sbss
85+
b LoopFillZerobss
86+
/* Zero fill the bss segment. */
87+
FillZerobss:
88+
movs r3, #0
89+
str r3, [r2]
90+
adds r2, r2, #4
91+
92+
93+
LoopFillZerobss:
94+
ldr r3, = _ebss
95+
cmp r2, r3
96+
bcc FillZerobss
8097

8198
/* Call the clock system intitialization function.*/
8299
bl SystemInit
@@ -138,11 +155,11 @@ g_pfnVectors:
138155
.word PVD_IRQHandler /* PVD through EXTI Line detection */
139156
.word RTC_IRQHandler /* RTC through the EXTI line */
140157
.word FLASH_IRQHandler /* FLASH */
141-
.word RCC_CRS_IRQHandler /* RCC and CRS */
158+
.word RCC_IRQHandler /* RCC */
142159
.word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */
143160
.word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */
144161
.word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */
145-
.word TSC_IRQHandler /* TSC */
162+
.word 0 /* Reserved */
146163
.word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */
147164
.word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */
148165
.word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/
@@ -151,7 +168,7 @@ g_pfnVectors:
151168
.word USART4_5_IRQHandler /* USART4 and USART 5 */
152169
.word TIM2_IRQHandler /* TIM2 */
153170
.word TIM3_IRQHandler /* TIM3 */
154-
.word TIM6_DAC_IRQHandler /* TIM6 and DAC */
171+
.word TIM6_IRQHandler /* TIM6 and DAC */
155172
.word TIM7_IRQHandler /* TIM7 */
156173
.word 0 /* Reserved */
157174
.word TIM21_IRQHandler /* TIM21 */
@@ -163,9 +180,9 @@ g_pfnVectors:
163180
.word SPI2_IRQHandler /* SPI2 */
164181
.word USART1_IRQHandler /* USART1 */
165182
.word USART2_IRQHandler /* USART2 */
166-
.word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */
167-
.word LCD_IRQHandler /* LCD */
168-
.word USB_IRQHandler /* USB */
183+
.word LPUART1_IRQHandler /* LPUART1 */
184+
.word 0 /* Reserved */
185+
.word 0 /* Reserved */
169186

170187
/*******************************************************************************
171188
*
@@ -202,8 +219,8 @@ g_pfnVectors:
202219
.weak FLASH_IRQHandler
203220
.thumb_set FLASH_IRQHandler,Default_Handler
204221

205-
.weak RCC_CRS_IRQHandler
206-
.thumb_set RCC_CRS_IRQHandler,Default_Handler
222+
.weak RCC_IRQHandler
223+
.thumb_set RCC_IRQHandler,Default_Handler
207224

208225
.weak EXTI0_1_IRQHandler
209226
.thumb_set EXTI0_1_IRQHandler,Default_Handler
@@ -214,9 +231,6 @@ g_pfnVectors:
214231
.weak EXTI4_15_IRQHandler
215232
.thumb_set EXTI4_15_IRQHandler,Default_Handler
216233

217-
.weak TSC_IRQHandler
218-
.thumb_set TSC_IRQHandler,Default_Handler
219-
220234
.weak DMA1_Channel1_IRQHandler
221235
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
222236

@@ -241,8 +255,8 @@ g_pfnVectors:
241255
.weak TIM3_IRQHandler
242256
.thumb_set TIM3_IRQHandler,Default_Handler
243257

244-
.weak TIM6_DAC_IRQHandler
245-
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
258+
.weak TIM6_IRQHandler
259+
.thumb_set TIM6_IRQHandler,Default_Handler
246260

247261
.weak TIM7_IRQHandler
248262
.thumb_set TIM7_IRQHandler,Default_Handler
@@ -274,14 +288,8 @@ g_pfnVectors:
274288
.weak USART2_IRQHandler
275289
.thumb_set USART2_IRQHandler,Default_Handler
276290

277-
.weak RNG_LPUART1_IRQHandler
278-
.thumb_set RNG_LPUART1_IRQHandler,Default_Handler
279-
280-
.weak LCD_IRQHandler
281-
.thumb_set LCD_IRQHandler,Default_Handler
282-
283-
.weak USB_IRQHandler
284-
.thumb_set USB_IRQHandler,Default_Handler
291+
.weak LPUART1_IRQHandler
292+
.thumb_set LPUART1_IRQHandler,Default_Handler
285293

286294

287295

0 commit comments

Comments
 (0)