]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/TOOLCHAIN_ARM_STD/startup_stm32l053xx.s
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32L0 / TARGET_DISCO_L053C8 / TOOLCHAIN_ARM_STD / startup_stm32l053xx.s
1 ;******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
2 ;* File Name : startup_stm32l053xx.s
3 ;* Author : MCD Application Team
4 ;* Version : V1.1.0
5 ;* Date : 18-June-2014
6 ;* Description : STM32l053xx Devices vector table for MDK-ARM toolchain.
7 ;* This module performs:
8 ;* - Set the initial SP
9 ;* - Set the initial PC == Reset_Handler
10 ;* - Set the vector table entries with the exceptions ISR address
11 ;* - Branches to __main in the C library (which eventually
12 ;* calls main()).
13 ;* After Reset the Cortex-M0+ processor is in Thread mode,
14 ;* priority is Privileged, and the Stack is set to Main.
15 ;* <<< Use Configuration Wizard in Context Menu >>>
16 ;*******************************************************************************
17 ;*
18 ;* Redistribution and use in source and binary forms, with or without modification,
19 ;* are permitted provided that the following conditions are met:
20 ;* 1. Redistributions of source code must retain the above copyright notice,
21 ;* this list of conditions and the following disclaimer.
22 ;* 2. Redistributions in binary form must reproduce the above copyright notice,
23 ;* this list of conditions and the following disclaimer in the documentation
24 ;* and/or other materials provided with the distribution.
25 ;* 3. Neither the name of STMicroelectronics nor the names of its contributors
26 ;* may be used to endorse or promote products derived from this software
27 ;* without specific prior written permission.
28 ;*
29 ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
30 ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
33 ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
35 ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36 ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37 ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 ;*
40 ;*******************************************************************************
41 ;
42 ; Amount of memory (in bytes) allocated for Stack
43 ; Tailor this value to your application needs
44 ; <h> Stack Configuration
45 ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
46 ; </h>
47
48 Stack_Size EQU 0x00000400
49
50 AREA STACK, NOINIT, READWRITE, ALIGN=3
51 Stack_Mem SPACE Stack_Size
52 __initial_sp
53
54
55 ; <h> Heap Configuration
56 ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
57 ; </h>
58
59 Heap_Size EQU 0x00000200
60
61 AREA HEAP, NOINIT, READWRITE, ALIGN=3
62 __heap_base
63 Heap_Mem SPACE Heap_Size
64 __heap_limit
65
66 PRESERVE8
67 THUMB
68
69
70 ; Vector Table Mapped to Address 0 at Reset
71 AREA RESET, DATA, READONLY
72 EXPORT __Vectors
73 EXPORT __Vectors_End
74 EXPORT __Vectors_Size
75
76 __Vectors DCD __initial_sp ; Top of Stack
77 DCD Reset_Handler ; Reset Handler
78 DCD NMI_Handler ; NMI Handler
79 DCD HardFault_Handler ; Hard Fault Handler
80 DCD 0 ; Reserved
81 DCD 0 ; Reserved
82 DCD 0 ; Reserved
83 DCD 0 ; Reserved
84 DCD 0 ; Reserved
85 DCD 0 ; Reserved
86 DCD 0 ; Reserved
87 DCD SVC_Handler ; SVCall Handler
88 DCD DebugMon_Handler ; Debug Monitor Handler
89 DCD 0 ; Reserved
90 DCD PendSV_Handler ; PendSV Handler
91 DCD SysTick_Handler ; SysTick Handler
92
93 ; External Interrupts
94 DCD WWDG_IRQHandler ; Window Watchdog
95 DCD PVD_IRQHandler ; PVD through EXTI Line detect
96 DCD RTC_IRQHandler ; RTC through EXTI Line
97 DCD FLASH_IRQHandler ; FLASH
98 DCD RCC_CRS_IRQHandler ; RCC and CRS
99 DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
100 DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
101 DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
102 DCD TSC_IRQHandler ; TSC
103 DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
104 DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
105 DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7
106 DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2
107 DCD LPTIM1_IRQHandler ; LPTIM1
108 DCD 0 ; Reserved
109 DCD TIM2_IRQHandler ; TIM2
110 DCD 0 ; Reserved
111 DCD TIM6_DAC_IRQHandler ; TIM6 and DAC
112 DCD 0 ; Reserved
113 DCD 0 ; Reserved
114 DCD TIM21_IRQHandler ; TIM21
115 DCD 0 ; Reserved
116 DCD TIM22_IRQHandler ; TIM22
117 DCD I2C1_IRQHandler ; I2C1
118 DCD I2C2_IRQHandler ; I2C2
119 DCD SPI1_IRQHandler ; SPI1
120 DCD SPI2_IRQHandler ; SPI2
121 DCD USART1_IRQHandler ; USART1
122 DCD USART2_IRQHandler ; USART2
123 DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1
124 DCD LCD_IRQHandler ; LCD
125 DCD USB_IRQHandler ; USB
126
127 __Vectors_End
128
129 __Vectors_Size EQU __Vectors_End - __Vectors
130
131 AREA |.text|, CODE, READONLY
132
133 ; Reset handler routine
134 Reset_Handler PROC
135 EXPORT Reset_Handler [WEAK]
136 IMPORT __main
137 IMPORT SystemInit
138 LDR R0, =SystemInit
139 BLX R0
140 LDR R0, =__main
141 BX R0
142 ENDP
143
144 ; Dummy Exception Handlers (infinite loops which can be modified)
145
146 NMI_Handler PROC
147 EXPORT NMI_Handler [WEAK]
148 B .
149 ENDP
150 HardFault_Handler\
151 PROC
152 EXPORT HardFault_Handler [WEAK]
153 B .
154 ENDP
155 SVC_Handler PROC
156 EXPORT SVC_Handler [WEAK]
157 B .
158 ENDP
159 DebugMon_Handler\
160 PROC
161 EXPORT DebugMon_Handler [WEAK]
162 B .
163 ENDP
164 PendSV_Handler PROC
165 EXPORT PendSV_Handler [WEAK]
166 B .
167 ENDP
168 SysTick_Handler PROC
169 EXPORT SysTick_Handler [WEAK]
170 B .
171 ENDP
172
173 Default_Handler PROC
174
175 EXPORT WWDG_IRQHandler [WEAK]
176 EXPORT PVD_IRQHandler [WEAK]
177 EXPORT RTC_IRQHandler [WEAK]
178 EXPORT FLASH_IRQHandler [WEAK]
179 EXPORT RCC_CRS_IRQHandler [WEAK]
180 EXPORT EXTI0_1_IRQHandler [WEAK]
181 EXPORT EXTI2_3_IRQHandler [WEAK]
182 EXPORT EXTI4_15_IRQHandler [WEAK]
183 EXPORT TSC_IRQHandler [WEAK]
184 EXPORT DMA1_Channel1_IRQHandler [WEAK]
185 EXPORT DMA1_Channel2_3_IRQHandler [WEAK]
186 EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK]
187 EXPORT ADC1_COMP_IRQHandler [WEAK]
188 EXPORT LPTIM1_IRQHandler [WEAK]
189 EXPORT TIM2_IRQHandler [WEAK]
190 EXPORT TIM6_DAC_IRQHandler [WEAK]
191 EXPORT TIM21_IRQHandler [WEAK]
192 EXPORT TIM22_IRQHandler [WEAK]
193 EXPORT I2C1_IRQHandler [WEAK]
194 EXPORT I2C2_IRQHandler [WEAK]
195 EXPORT SPI1_IRQHandler [WEAK]
196 EXPORT SPI2_IRQHandler [WEAK]
197 EXPORT USART1_IRQHandler [WEAK]
198 EXPORT USART2_IRQHandler [WEAK]
199 EXPORT RNG_LPUART1_IRQHandler [WEAK]
200 EXPORT LCD_IRQHandler [WEAK]
201 EXPORT USB_IRQHandler [WEAK]
202
203
204 WWDG_IRQHandler
205 PVD_IRQHandler
206 RTC_IRQHandler
207 FLASH_IRQHandler
208 RCC_CRS_IRQHandler
209 EXTI0_1_IRQHandler
210 EXTI2_3_IRQHandler
211 EXTI4_15_IRQHandler
212 TSC_IRQHandler
213 DMA1_Channel1_IRQHandler
214 DMA1_Channel2_3_IRQHandler
215 DMA1_Channel4_5_6_7_IRQHandler
216 ADC1_COMP_IRQHandler
217 LPTIM1_IRQHandler
218 TIM2_IRQHandler
219 TIM6_DAC_IRQHandler
220 TIM21_IRQHandler
221 TIM22_IRQHandler
222 I2C1_IRQHandler
223 I2C2_IRQHandler
224 SPI1_IRQHandler
225 SPI2_IRQHandler
226 USART1_IRQHandler
227 USART2_IRQHandler
228 RNG_LPUART1_IRQHandler
229 LCD_IRQHandler
230 USB_IRQHandler
231
232 B .
233
234 ENDP
235
236 ALIGN
237
238 ;*******************************************************************************
239 ; User Stack and Heap initialization
240 ;*******************************************************************************
241 IF :DEF:__MICROLIB
242
243 EXPORT __initial_sp
244 EXPORT __heap_base
245 EXPORT __heap_limit
246
247 ELSE
248
249 IMPORT __use_two_region_memory
250 EXPORT __user_initial_stackheap
251
252 __user_initial_stackheap
253
254 LDR R0, = Heap_Mem
255 LDR R1, =(Stack_Mem + Stack_Size)
256 LDR R2, = (Heap_Mem + Heap_Size)
257 LDR R3, = Stack_Mem
258 BX LR
259
260 ALIGN
261
262 ENDIF
263
264 END
265
266 ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
Imprint / Impressum