1
- / * mbed Microcontroller Library
2
- * SPDX - License - Identifier: BSD - 3 - Clause
3
- ******************************************************************************
4
- *
5
- * Copyright (c) 2020 STMicroelectronics.
6
- * All rights reserved.
7
- *
8
- * This software component is licensed by ST under BSD 3 - Clause license ,
9
- * the "License" ; You may not use this file except in compliance with the
10
- * License. You may obtain a copy of the License at :
11
- * opensource.org/licenses/BSD - 3 - Clause
12
- *
13
- ******************************************************************************
14
- * @file startup_stm32l071xx.s
15
- * @author MCD Application Team
16
- * @brief STM32L071xx Devices vector table for GCC toolchain.
17
- * This module performs:
18
- * - Set the initial SP
19
- * - Set the initial PC == Reset_Handler ,
20
- * - Set the vector table entries with the exceptions ISR address
21
- * - Branches to main in the C library (which eventually
22
- * calls main()).
23
- * After Reset the Cortex - M0 + processor is in Thread mode ,
24
- * priority is Privileged , and the Stack is set to Main.
25
- ******************************************************************************
26
- * /
1
+ / **
2
+ ******************************************************************************
3
+ * @file startup_stm32l073xx.s
4
+ * @author MCD Application Team
5
+ * @brief STM32L073xx Devices vector table for Atollic TrueSTUDIO toolchain.
6
+ * This module performs:
7
+ * - Set the initial SP
8
+ * - Set the initial PC == Reset_Handler ,
9
+ * - Set the vector table entries with the exceptions ISR address
10
+ * - Branches to main in the C library (which eventually
11
+ * calls main()).
12
+ * After Reset the Cortex - M0 + processor is in Thread mode ,
13
+ * priority is Privileged , and the Stack is set to Main.
14
+ ******************************************************************************
15
+ *
16
+ * Redistribution and use in source and binary forms , with or without modification ,
17
+ * are permitted provided th at the following conditions are met:
18
+ * 1 . Redistributions of source code must retain the above copyright notice ,
19
+ * this list of conditions and the following disclaimer.
20
+ * 2 . Redistributions in binary form must reproduce the above copyright notice ,
21
+ * this list of conditions and the following disclaimer in the documentation
22
+ * and / or other materials provided with the distribution.
23
+ * 3 . Neither the name of STMicroelectronics nor the names of its contributors
24
+ * may be used to endorse or promote products derived from this software
25
+ * without specific prior written permission.
26
+ *
27
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE
29
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31
+ * FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
32
+ * DAMAGES (INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR
33
+ * SERVICES ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34
+ * CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY ,
35
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36
+ * OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
+ *
38
+ ******************************************************************************
39
+ * /
27
40
28
41
.syntax unified
29
42
. cpu cortex - m0plus
@@ -40,17 +53,13 @@ defined in linker script */
40
53
. word _sdata
41
54
/ * end address for the .data section. defined in linker script * /
42
55
. word _edata
43
- / * start address for the .bss section. defined in linker script * /
44
- . word _sbss
45
- / * end address for the .bss section. defined in linker script * /
46
- . word _ebss
47
56
48
57
. section .text.Reset_Handler
49
58
.weak Reset_Handler
50
59
.type Reset_Handler , %function
51
- Reset_Handler:
52
- ldr r0 , =_estack
53
- mov sp , r0 / * set stack pointer * /
60
+ Reset_Handler:
61
+ ldr r0 , =_estack
62
+ mov sp , r0 / * set stack pointer * /
54
63
55
64
/ * Copy the data segment initializers from flash to SRAM * /
56
65
movs r1 , # 0
@@ -68,29 +77,17 @@ LoopCopyDataInit:
68
77
adds r2 , r0 , r1
69
78
cmp r2 , r3
70
79
bcc CopyDataInit
71
- ldr r2 , =_sbss
72
- b LoopFillZerobss
73
- / * Zero fill the bss segment. * /
74
- FillZerobss:
75
- movs r3 , # 0
76
- str r3 , [ r2 ]
77
- adds r2 , r2 , # 4
78
-
79
-
80
- LoopFillZerobss:
81
- ldr r3 , = _ebss
82
- cmp r2 , r3
83
- bcc FillZerobss
84
80
85
81
/ * Call the clock system intitialization function. * /
86
82
bl SystemInit
87
83
/ * Call static constructors * /
88
- bl __libc_init_array
84
+ // bl __libc_init_array
89
85
/ * Call the application's entry point. * /
90
- bl main
86
+ // bl main
87
+ bl _start
91
88
92
89
LoopForever:
93
- b LoopForever
90
+ b LoopForever
94
91
95
92
96
93
.size Reset_Handler , . - Reset_Handler
@@ -141,11 +138,11 @@ g_pfnVectors:
141
138
. word PVD_IRQHandler / * PVD through EXTI Line detection * /
142
139
. word RTC_IRQHandler / * RTC through the EXTI line * /
143
140
. word FLASH_IRQHandler / * FLASH * /
144
- . word RCC_IRQHandler / * RCC * /
141
+ . word RCC_CRS_IRQHandler / * RCC and CRS * /
145
142
. word EXTI0_1_IRQHandler / * EXTI Line 0 and 1 * /
146
143
. word EXTI2_3_IRQHandler / * EXTI Line 2 and 3 * /
147
144
. word EXTI4_15_IRQHandler / * EXTI Line 4 to 15 * /
148
- . word 0 / * Reserved * /
145
+ . word TSC_IRQHandler / * TSC * /
149
146
. word DMA1_Channel1_IRQHandler / * DMA1 Channel 1 * /
150
147
. word DMA1_Channel2_3_IRQHandler / * DMA1 Channel 2 and Channel 3 * /
151
148
. word DMA1_Channel4_5_6_7_IRQHandler / * DMA1 Channel 4 , Channel 5 , Channel 6 and Channel 7 * /
@@ -154,7 +151,7 @@ g_pfnVectors:
154
151
. word USART4_5_IRQHandler / * USART4 and USART 5 * /
155
152
. word TIM2_IRQHandler / * TIM2 * /
156
153
. word TIM3_IRQHandler / * TIM3 * /
157
- . word TIM6_IRQHandler / * TIM6 and DAC * /
154
+ . word TIM6_DAC_IRQHandler / * TIM6 and DAC * /
158
155
. word TIM7_IRQHandler / * TIM7 * /
159
156
. word 0 / * Reserved * /
160
157
. word TIM21_IRQHandler / * TIM21 * /
@@ -166,9 +163,9 @@ g_pfnVectors:
166
163
. word SPI2_IRQHandler / * SPI2 * /
167
164
. word USART1_IRQHandler / * USART1 * /
168
165
. word USART2_IRQHandler / * USART2 * /
169
- . word LPUART1_IRQHandler / * LPUART1 * /
170
- . word 0 / * Reserved * /
171
- . word 0 / * Reserved * /
166
+ . word RNG_LPUART1_IRQHandler / * RNG and LPUART1 * /
167
+ . word LCD_IRQHandler / * LCD * /
168
+ . word USB_IRQHandler / * USB * /
172
169
173
170
/ *******************************************************************************
174
171
*
@@ -205,8 +202,8 @@ g_pfnVectors:
205
202
.weak FLASH_IRQHandler
206
203
.thumb_set FLASH_IRQHandler , Default_Handler
207
204
208
- .weak RCC_IRQHandler
209
- .thumb_set RCC_IRQHandler , Default_Handler
205
+ .weak RCC_CRS_IRQHandler
206
+ .thumb_set RCC_CRS_IRQHandler , Default_Handler
210
207
211
208
.weak EXTI0_1_IRQHandler
212
209
.thumb_set EXTI0_1_IRQHandler , Default_Handler
@@ -217,6 +214,9 @@ g_pfnVectors:
217
214
.weak EXTI4_15_IRQHandler
218
215
.thumb_set EXTI4_15_IRQHandler , Default_Handler
219
216
217
+ .weak TSC_IRQHandler
218
+ .thumb_set TSC_IRQHandler , Default_Handler
219
+
220
220
.weak DMA1_Channel1_IRQHandler
221
221
.thumb_set DMA1_Channel1_IRQHandler , Default_Handler
222
222
@@ -241,8 +241,8 @@ g_pfnVectors:
241
241
.weak TIM3_IRQHandler
242
242
.thumb_set TIM3_IRQHandler , Default_Handler
243
243
244
- .weak TIM6_IRQHandler
245
- .thumb_set TIM6_IRQHandler , Default_Handler
244
+ .weak TIM6_DAC_IRQHandler
245
+ .thumb_set TIM6_DAC_IRQHandler , Default_Handler
246
246
247
247
.weak TIM7_IRQHandler
248
248
.thumb_set TIM7_IRQHandler , Default_Handler
@@ -274,8 +274,14 @@ g_pfnVectors:
274
274
.weak USART2_IRQHandler
275
275
.thumb_set USART2_IRQHandler , Default_Handler
276
276
277
- .weak LPUART1_IRQHandler
278
- .thumb_set LPUART1_IRQHandler , Default_Handler
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
279
285
280
286
281
287
0 commit comments