]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/TOOLCHAIN_GCC_ARM/startup_STM32F30x.s
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
[qmk_firmware.git] / tmk_core / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32F3XX / TOOLCHAIN_GCC_ARM / startup_STM32F30x.s
1 /**
2   ******************************************************************************
3   * @file      startup_stm32f30x.s
4   * @author    MCD Application Team
5   * @version   V1.0.0
6   * @date      04-Spetember-2012
7   * @brief     STM32F4xx Devices vector table for RIDE7 toolchain. 
8   *            This module performs:
9   *                - Set the initial SP
10   *                - Set the initial PC == Reset_Handler,
11   *                - Set the vector table entries with the exceptions ISR address
12   *                - Configure the clock system and the external SRAM mounted on 
13   *                  STM3230C-EVAL board to be used as data memory (optional, 
14   *                  to be enabled by user)
15   *                - Branches to main in the C library (which eventually
16   *                  calls main()).
17   *            After Reset the Cortex-M4 processor is in Thread mode,
18   *            priority is Privileged, and the Stack is set to Main.
19   ******************************************************************************
20   * @attention
21   *
22   * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
23   *
24   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
25   * You may not use this file except in compliance with the License.
26   * You may obtain a copy of the License at:
27   *
28   *        http://www.st.com/software_license_agreement_liberty_v2
29   *
30   * Unless required by applicable law or agreed to in writing, software 
31   * distributed under the License is distributed on an "AS IS" BASIS, 
32   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33   * See the License for the specific language governing permissions and
34   * limitations under the License.
35   *
36   ******************************************************************************
37   */
38     
39   .syntax unified
40   .cpu cortex-m4
41   .fpu softvfp
42   .thumb
43
44 .global  g_pfnVectors
45 .global  Default_Handler
46
47 /* start address for the initialization values of the .data section. 
48 defined in linker script */
49 .word  _sidata
50 /* start address for the .data section. defined in linker script */  
51 .word  _sdata
52 /* end address for the .data section. defined in linker script */
53 .word  _edata
54 /* start address for the .bss section. defined in linker script */
55 .word  _sbss
56 /* end address for the .bss section. defined in linker script */
57 .word  _ebss
58 /* stack used for SystemInit_ExtMemCtl; always internal RAM used */
59
60 /**
61  * @brief  This is the code that gets called when the processor first
62  *          starts execution following a reset event. Only the absolutely
63  *          necessary set is performed, after which the application
64  *          supplied main() routine is called. 
65  * @param  None
66  * @retval : None
67 */
68
69     .section  .text.Reset_Handler
70   .weak  Reset_Handler
71   .type  Reset_Handler, %function
72 Reset_Handler:  
73
74 /* Copy the data segment initializers from flash to SRAM */  
75   movs  r1, #0
76   b  LoopCopyDataInit
77
78 CopyDataInit:
79   ldr  r3, =_sidata
80   ldr  r3, [r3, r1]
81   str  r3, [r0, r1]
82   adds  r1, r1, #4
83     
84 LoopCopyDataInit:
85   ldr  r0, =_sdata
86   ldr  r3, =_edata
87   adds  r2, r0, r1
88   cmp  r2, r3
89   bcc  CopyDataInit
90   ldr  r2, =_sbss
91   b  LoopFillZerobss
92 /* Zero fill the bss segment. */  
93 FillZerobss:
94   movs  r3, #0
95   str  r3, [r2], #4
96     
97 LoopFillZerobss:
98   ldr  r3, = _ebss
99   cmp  r2, r3
100   bcc  FillZerobss
101
102 /* Call the clock system intitialization function.*/
103   bl  SystemInit   
104 /* Call the application's entry point.*/
105   bl  _start
106   bx  lr    
107 .size  Reset_Handler, .-Reset_Handler
108
109 /**
110  * @brief  This is the code that gets called when the processor receives an 
111  *         unexpected interrupt.  This simply enters an infinite loop, preserving
112  *         the system state for examination by a debugger.
113  * @param  None     
114  * @retval None       
115 */
116     .section  .text.Default_Handler,"ax",%progbits
117 Default_Handler:
118 Infinite_Loop:
119   b  Infinite_Loop
120   .size  Default_Handler, .-Default_Handler
121 /******************************************************************************
122 *
123 * The minimal vector table for a Cortex M3. Note that the proper constructs
124 * must be placed on this to ensure that it ends up at physical address
125 * 0x0000.0000.
126
127 *******************************************************************************/
128    .section  .isr_vector,"a",%progbits
129   .type  g_pfnVectors, %object
130   .size  g_pfnVectors, .-g_pfnVectors
131     
132     
133 g_pfnVectors:
134         .word   _estack
135         .word   Reset_Handler
136         .word   NMI_Handler
137         .word   HardFault_Handler
138         .word   MemManage_Handler
139         .word   BusFault_Handler
140         .word   UsageFault_Handler
141         .word   0
142         .word   0
143         .word   0
144         .word   0
145         .word   SVC_Handler
146         .word   DebugMon_Handler
147         .word   0
148         .word   PendSV_Handler
149         .word   SysTick_Handler
150         .word   WWDG_IRQHandler
151         .word   PVD_IRQHandler
152         .word   TAMPER_STAMP_IRQHandler
153         .word   RTC_WKUP_IRQHandler
154         .word   FLASH_IRQHandler
155         .word   RCC_IRQHandler
156         .word   EXTI0_IRQHandler
157         .word   EXTI1_IRQHandler
158         .word   EXTI2_TS_IRQHandler
159         .word   EXTI3_IRQHandler
160         .word   EXTI4_IRQHandler
161         .word   DMA1_Channel1_IRQHandler
162         .word   DMA1_Channel2_IRQHandler
163         .word   DMA1_Channel3_IRQHandler
164         .word   DMA1_Channel4_IRQHandler
165         .word   DMA1_Channel5_IRQHandler
166         .word   DMA1_Channel6_IRQHandler
167         .word   DMA1_Channel7_IRQHandler
168         .word   ADC1_2_IRQHandler
169         .word   USB_HP_CAN1_TX_IRQHandler
170         .word   USB_LP_CAN1_RX0_IRQHandler
171         .word   CAN1_RX1_IRQHandler
172         .word   CAN1_SCE_IRQHandler
173         .word   EXTI9_5_IRQHandler
174         .word   TIM1_BRK_TIM15_IRQHandler
175         .word   TIM1_UP_TIM16_IRQHandler
176         .word   TIM1_TRG_COM_TIM17_IRQHandler
177         .word   TIM1_CC_IRQHandler
178         .word   TIM2_IRQHandler
179         .word   TIM3_IRQHandler
180         .word   TIM4_IRQHandler
181         .word   I2C1_EV_IRQHandler
182         .word   I2C1_ER_IRQHandler
183         .word   I2C2_EV_IRQHandler
184         .word   I2C2_ER_IRQHandler
185         .word   SPI1_IRQHandler
186         .word   SPI2_IRQHandler
187         .word   USART1_IRQHandler
188         .word   USART2_IRQHandler
189         .word   USART3_IRQHandler
190         .word   EXTI15_10_IRQHandler
191         .word   RTC_Alarm_IRQHandler
192         .word   USBWakeUp_IRQHandler
193         .word   TIM8_BRK_IRQHandler
194         .word   TIM8_UP_IRQHandler
195         .word   TIM8_TRG_COM_IRQHandler
196         .word   TIM8_CC_IRQHandler
197         .word   ADC3_IRQHandler
198         .word   0
199         .word   0
200         .word   0
201         .word   SPI3_IRQHandler
202         .word   UART4_IRQHandler
203         .word   UART5_IRQHandler
204         .word   TIM6_DAC_IRQHandler
205         .word   TIM7_IRQHandler
206         .word   DMA2_Channel1_IRQHandler
207         .word   DMA2_Channel2_IRQHandler
208         .word   DMA2_Channel3_IRQHandler
209         .word   DMA2_Channel4_IRQHandler
210         .word   DMA2_Channel5_IRQHandler
211         .word   ADC4_IRQHandler
212         .word   0
213         .word   0
214         .word   COMP1_2_3_IRQHandler
215         .word   COMP4_5_6_IRQHandler
216         .word   COMP7_IRQHandler
217         .word   0
218         .word   0
219         .word   0
220         .word   0
221         .word   0
222         .word   0
223         .word   0
224         .word   USB_HP_IRQHandler
225         .word   USB_LP_IRQHandler
226         .word   USBWakeUp_RMP_IRQHandler
227         .word   0
228         .word   0
229         .word   0
230         .word   0
231         .word   FPU_IRQHandler
232
233 /*******************************************************************************
234 *
235 * Provide weak aliases for each Exception handler to the Default_Handler.
236 * As they are weak aliases, any function with the same name will override
237 * this definition.
238 *
239 *******************************************************************************/
240
241   .weak NMI_Handler
242         .thumb_set NMI_Handler,Default_Handler
243
244   .weak HardFault_Handler
245         .thumb_set HardFault_Handler,Default_Handler
246
247   .weak MemManage_Handler
248         .thumb_set MemManage_Handler,Default_Handler
249
250   .weak BusFault_Handler
251         .thumb_set BusFault_Handler,Default_Handler
252
253         .weak   UsageFault_Handler
254         .thumb_set UsageFault_Handler,Default_Handler
255
256         .weak   SVC_Handler
257         .thumb_set SVC_Handler,Default_Handler
258
259         .weak   DebugMon_Handler
260         .thumb_set DebugMon_Handler,Default_Handler
261
262         .weak   PendSV_Handler
263         .thumb_set PendSV_Handler,Default_Handler
264
265         .weak   SysTick_Handler
266         .thumb_set SysTick_Handler,Default_Handler
267
268         .weak   WWDG_IRQHandler
269         .thumb_set WWDG_IRQHandler,Default_Handler
270
271         .weak   PVD_IRQHandler
272         .thumb_set PVD_IRQHandler,Default_Handler
273
274         .weak   TAMPER_STAMP_IRQHandler
275         .thumb_set TAMPER_STAMP_IRQHandler,Default_Handler
276
277         .weak   RTC_WKUP_IRQHandler
278         .thumb_set RTC_WKUP_IRQHandler,Default_Handler
279
280         .weak   FLASH_IRQHandler
281         .thumb_set FLASH_IRQHandler,Default_Handler
282
283         .weak   RCC_IRQHandler
284         .thumb_set RCC_IRQHandler,Default_Handler
285
286         .weak   EXTI0_IRQHandler
287         .thumb_set EXTI0_IRQHandler,Default_Handler
288
289         .weak   EXTI1_IRQHandler
290         .thumb_set EXTI1_IRQHandler,Default_Handler
291
292         .weak   EXTI2_TS_IRQHandler
293         .thumb_set EXTI2_TS_IRQHandler,Default_Handler
294
295         .weak   EXTI3_IRQHandler
296         .thumb_set EXTI3_IRQHandler,Default_Handler
297
298         .weak   EXTI4_IRQHandler
299         .thumb_set EXTI4_IRQHandler,Default_Handler
300
301         .weak   DMA1_Channel1_IRQHandler
302         .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
303
304         .weak   DMA1_Channel2_IRQHandler
305         .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
306
307         .weak   DMA1_Channel3_IRQHandler
308         .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
309
310         .weak   DMA1_Channel4_IRQHandler
311         .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
312
313         .weak   DMA1_Channel5_IRQHandler
314         .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
315
316         .weak   DMA1_Channel6_IRQHandler
317         .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
318
319         .weak   DMA1_Channel7_IRQHandler
320         .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
321
322         .weak   ADC1_2_IRQHandler
323         .thumb_set ADC1_2_IRQHandler,Default_Handler
324
325         .weak   USB_HP_CAN1_TX_IRQHandler
326         .thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler
327
328         .weak   USB_LP_CAN1_RX0_IRQHandler
329         .thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler
330
331         .weak   CAN1_RX1_IRQHandler
332         .thumb_set CAN1_RX1_IRQHandler,Default_Handler
333
334         .weak   CAN1_SCE_IRQHandler
335         .thumb_set CAN1_SCE_IRQHandler,Default_Handler
336
337         .weak   EXTI9_5_IRQHandler
338         .thumb_set EXTI9_5_IRQHandler,Default_Handler
339
340         .weak   TIM1_BRK_TIM15_IRQHandler
341         .thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler
342
343         .weak   TIM1_UP_TIM16_IRQHandler
344         .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
345
346         .weak   TIM1_TRG_COM_TIM17_IRQHandler
347         .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler
348
349         .weak   TIM1_CC_IRQHandler
350         .thumb_set TIM1_CC_IRQHandler,Default_Handler
351
352         .weak   TIM2_IRQHandler
353         .thumb_set TIM2_IRQHandler,Default_Handler
354
355         .weak   TIM3_IRQHandler
356         .thumb_set TIM3_IRQHandler,Default_Handler
357
358         .weak   TIM4_IRQHandler
359         .thumb_set TIM4_IRQHandler,Default_Handler
360
361         .weak   I2C1_EV_IRQHandler
362         .thumb_set I2C1_EV_IRQHandler,Default_Handler
363
364         .weak   I2C1_ER_IRQHandler
365         .thumb_set I2C1_ER_IRQHandler,Default_Handler
366
367         .weak   I2C2_EV_IRQHandler
368         .thumb_set I2C2_EV_IRQHandler,Default_Handler
369
370         .weak   I2C2_ER_IRQHandler
371         .thumb_set I2C2_ER_IRQHandler,Default_Handler
372
373         .weak   SPI1_IRQHandler
374         .thumb_set SPI1_IRQHandler,Default_Handler
375
376         .weak   SPI2_IRQHandler
377         .thumb_set SPI2_IRQHandler,Default_Handler
378
379         .weak   USART1_IRQHandler
380         .thumb_set USART1_IRQHandler,Default_Handler
381
382         .weak   USART2_IRQHandler
383         .thumb_set USART2_IRQHandler,Default_Handler
384
385         .weak   USART3_IRQHandler
386         .thumb_set USART3_IRQHandler,Default_Handler
387
388         .weak   EXTI15_10_IRQHandler
389         .thumb_set EXTI15_10_IRQHandler,Default_Handler
390
391         .weak   RTC_Alarm_IRQHandler
392         .thumb_set RTC_Alarm_IRQHandler,Default_Handler
393
394         .weak   USBWakeUp_IRQHandler
395         .thumb_set USBWakeUp_IRQHandler,Default_Handler
396
397         .weak   TIM8_BRK_IRQHandler
398         .thumb_set TIM8_BRK_IRQHandler,Default_Handler
399
400         .weak   TIM8_UP_IRQHandler
401         .thumb_set TIM8_UP_IRQHandler,Default_Handler
402
403         .weak   TIM8_TRG_COM_IRQHandler
404         .thumb_set TIM8_TRG_COM_IRQHandler,Default_Handler
405
406         .weak   TIM8_CC_IRQHandler
407         .thumb_set TIM8_CC_IRQHandler,Default_Handler
408
409         .weak   ADC3_IRQHandler
410         .thumb_set ADC3_IRQHandler,Default_Handler
411
412         .weak   SPI3_IRQHandler
413         .thumb_set SPI3_IRQHandler,Default_Handler
414
415         .weak   UART4_IRQHandler
416         .thumb_set UART4_IRQHandler,Default_Handler
417
418         .weak   UART5_IRQHandler
419         .thumb_set UART5_IRQHandler,Default_Handler
420
421         .weak   TIM6_DAC_IRQHandler
422         .thumb_set TIM6_DAC_IRQHandler,Default_Handler
423
424         .weak   TIM7_IRQHandler
425         .thumb_set TIM7_IRQHandler,Default_Handler
426
427         .weak   DMA2_Channel1_IRQHandler
428         .thumb_set DMA2_Channel1_IRQHandler,Default_Handler
429
430         .weak   DMA2_Channel2_IRQHandler
431         .thumb_set DMA2_Channel2_IRQHandler,Default_Handler
432
433         .weak   DMA2_Channel3_IRQHandler
434         .thumb_set DMA2_Channel3_IRQHandler,Default_Handler
435
436         .weak   DMA2_Channel4_IRQHandler
437         .thumb_set DMA2_Channel4_IRQHandler,Default_Handler
438
439         .weak   DMA2_Channel5_IRQHandler
440         .thumb_set DMA2_Channel5_IRQHandler,Default_Handler
441
442         .weak   ADC4_IRQHandler
443         .thumb_set ADC4_IRQHandler,Default_Handler      
444         
445         .weak   COMP1_2_3_IRQHandler
446         .thumb_set COMP1_2_3_IRQHandler,Default_Handler
447         
448         .weak   COMP4_5_6_IRQHandler
449         .thumb_set COMP4_5_6_IRQHandler,Default_Handler
450         
451         .weak   COMP7_IRQHandler
452         .thumb_set COMP7_IRQHandler,Default_Handler     
453         
454         .weak   USB_HP_IRQHandler
455         .thumb_set USB_HP_IRQHandler,Default_Handler
456         
457         .weak   USB_LP_IRQHandler
458         .thumb_set USB_LP_IRQHandler,Default_Handler
459         
460         .weak   USBWakeUp_RMP_IRQHandler
461         .thumb_set USBWakeUp_RMP_IRQHandler,Default_Handler
462         
463         .weak   FPU_IRQHandler
464         .thumb_set FPU_IRQHandler,Default_Handler
465 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/