1 ;/******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
2 ;* File Name : startup_stm32f302x8.s
3 ;* Author : MCD Application Team
6 ;* Description : STM32F302x6/STM32F302x8 devices vector table for EWARM toolchain.
7 ;* This module performs:
8 ;* - Set the initial SP
9 ;* - Set the initial PC == _iar_program_start,
10 ;* - Set the vector table entries with the exceptions ISR
12 ;* - Branches to main in the C library (which eventually
14 ;* After Reset the Cortex-M4 processor is in Thread mode,
15 ;* priority is Privileged, and the Stack is set to Main.
16 ;********************************************************************************
18 ;* <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
20 ;* Redistribution and use in source and binary forms, with or without modification,
21 ;* are permitted provided that the following conditions are met:
22 ;* 1. Redistributions of source code must retain the above copyright notice,
23 ;* this list of conditions and the following disclaimer.
24 ;* 2. Redistributions in binary form must reproduce the above copyright notice,
25 ;* this list of conditions and the following disclaimer in the documentation
26 ;* and/or other materials provided with the distribution.
27 ;* 3. Neither the name of STMicroelectronics nor the names of its contributors
28 ;* may be used to endorse or promote products derived from this software
29 ;* without specific prior written permission.
31 ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32 ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33 ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
34 ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
35 ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
37 ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38 ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
39 ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 ;*******************************************************************************
45 ; The modules in this file are included in the libraries, and may be replaced
46 ; by any user-defined modules that define the PUBLIC symbol _program_start or
47 ; a user defined start symbol.
48 ; To override the cstartup defined in the library, simply add your modified
49 ; version to the workbench project.
51 ; The vector table is normally located at address 0.
52 ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
53 ; The name "__vector_table" has special meaning for C-SPY:
54 ; it is where the SP start value is found, and the NVIC vector
55 ; table register (VTOR) is initialized to this address if != 0.
62 ;; Forward declaration of sections.
63 SECTION CSTACK:DATA:NOROOT(3)
65 SECTION .intvec:CODE:NOROOT(2)
67 EXTERN __iar_program_start
74 DCD Reset_Handler ; Reset Handler
76 DCD NMI_Handler ; NMI Handler
77 DCD HardFault_Handler ; Hard Fault Handler
78 DCD MemManage_Handler ; MPU Fault Handler
79 DCD BusFault_Handler ; Bus Fault Handler
80 DCD UsageFault_Handler ; Usage Fault Handler
85 DCD SVC_Handler ; SVCall Handler
86 DCD DebugMon_Handler ; Debug Monitor Handler
88 DCD PendSV_Handler ; PendSV Handler
89 DCD SysTick_Handler ; SysTick Handler
92 DCD WWDG_IRQHandler ; Window WatchDog
93 DCD PVD_IRQHandler ; PVD through EXTI Line detection
94 DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
95 DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
96 DCD FLASH_IRQHandler ; FLASH
97 DCD RCC_IRQHandler ; RCC
98 DCD EXTI0_IRQHandler ; EXTI Line0
99 DCD EXTI1_IRQHandler ; EXTI Line1
100 DCD EXTI2_TSC_IRQHandler ; EXTI Line2 and Touch Sense controller
101 DCD EXTI3_IRQHandler ; EXTI Line3
102 DCD EXTI4_IRQHandler ; EXTI Line4
103 DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
104 DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
105 DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
106 DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
107 DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
108 DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
109 DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
110 DCD ADC1_IRQHandler ; ADC1
111 DCD USB_HP_CAN_TX_IRQHandler ; USB Device High Priority or CAN TX
112 DCD USB_LP_CAN_RX0_IRQHandler ; USB Device Low Priority or CAN RX0
113 DCD CAN_RX1_IRQHandler ; CAN RX1
114 DCD CAN_SCE_IRQHandler ; CAN SCE
115 DCD EXTI9_5_IRQHandler ; External Line[9:5]s
116 DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15
117 DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16
118 DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Commutation and TIM17
119 DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
120 DCD TIM2_IRQHandler ; TIM2
123 DCD I2C1_EV_IRQHandler ; I2C1 Event
124 DCD I2C1_ER_IRQHandler ; I2C1 Error
125 DCD I2C2_EV_IRQHandler ; I2C2 Event
126 DCD I2C2_ER_IRQHandler ; I2C2 Error
128 DCD SPI2_IRQHandler ; SPI2
129 DCD USART1_IRQHandler ; USART1
130 DCD USART2_IRQHandler ; USART2
131 DCD USART3_IRQHandler ; USART3
132 DCD EXTI15_10_IRQHandler ; External Line[15:10]s
133 DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
134 DCD USBWakeUp_IRQHandler ; USB Wakeup through EXTI line
143 DCD SPI3_IRQHandler ; SPI3
146 DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1 underrun errors
156 DCD COMP2_IRQHandler ; COMP2
157 DCD COMP4_6_IRQHandler ; COMP4 and COMP6
164 DCD I2C3_EV_IRQHandler ; I2C3 Event
165 DCD I2C3_ER_IRQHandler ; I2C3 Error
166 DCD USB_HP_IRQHandler ; USB High Priority remap
167 DCD USB_LP_IRQHandler ; USB Low Priority remap
168 DCD USBWakeUp_RMP_IRQHandler ; USB Wakeup remap through EXTI
173 DCD FPU_IRQHandler ; FPU
175 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
177 ;; Default interrupt handlers.
180 PUBWEAK Reset_Handler
181 SECTION .text:CODE:NOROOT:REORDER(2)
186 LDR R0, =__iar_program_start
190 SECTION .text:CODE:NOROOT:REORDER(1)
194 PUBWEAK HardFault_Handler
195 SECTION .text:CODE:NOROOT:REORDER(1)
199 PUBWEAK MemManage_Handler
200 SECTION .text:CODE:NOROOT:REORDER(1)
204 PUBWEAK BusFault_Handler
205 SECTION .text:CODE:NOROOT:REORDER(1)
209 PUBWEAK UsageFault_Handler
210 SECTION .text:CODE:NOROOT:REORDER(1)
215 SECTION .text:CODE:NOROOT:REORDER(1)
219 PUBWEAK DebugMon_Handler
220 SECTION .text:CODE:NOROOT:REORDER(1)
224 PUBWEAK PendSV_Handler
225 SECTION .text:CODE:NOROOT:REORDER(1)
229 PUBWEAK SysTick_Handler
230 SECTION .text:CODE:NOROOT:REORDER(1)
234 PUBWEAK WWDG_IRQHandler
235 SECTION .text:CODE:NOROOT:REORDER(1)
239 PUBWEAK PVD_IRQHandler
240 SECTION .text:CODE:NOROOT:REORDER(1)
244 PUBWEAK TAMP_STAMP_IRQHandler
245 SECTION .text:CODE:NOROOT:REORDER(1)
246 TAMP_STAMP_IRQHandler
247 B TAMP_STAMP_IRQHandler
249 PUBWEAK RTC_WKUP_IRQHandler
250 SECTION .text:CODE:NOROOT:REORDER(1)
252 B RTC_WKUP_IRQHandler
254 PUBWEAK FLASH_IRQHandler
255 SECTION .text:CODE:NOROOT:REORDER(1)
259 PUBWEAK RCC_IRQHandler
260 SECTION .text:CODE:NOROOT:REORDER(1)
264 PUBWEAK EXTI0_IRQHandler
265 SECTION .text:CODE:NOROOT:REORDER(1)
269 PUBWEAK EXTI1_IRQHandler
270 SECTION .text:CODE:NOROOT:REORDER(1)
274 PUBWEAK EXTI2_TSC_IRQHandler
275 SECTION .text:CODE:NOROOT:REORDER(1)
277 B EXTI2_TSC_IRQHandler
279 PUBWEAK EXTI3_IRQHandler
280 SECTION .text:CODE:NOROOT:REORDER(1)
284 PUBWEAK EXTI4_IRQHandler
285 SECTION .text:CODE:NOROOT:REORDER(1)
289 PUBWEAK DMA1_Channel1_IRQHandler
290 SECTION .text:CODE:NOROOT:REORDER(1)
291 DMA1_Channel1_IRQHandler
292 B DMA1_Channel1_IRQHandler
294 PUBWEAK DMA1_Channel2_IRQHandler
295 SECTION .text:CODE:NOROOT:REORDER(1)
296 DMA1_Channel2_IRQHandler
297 B DMA1_Channel2_IRQHandler
299 PUBWEAK DMA1_Channel3_IRQHandler
300 SECTION .text:CODE:NOROOT:REORDER(1)
301 DMA1_Channel3_IRQHandler
302 B DMA1_Channel3_IRQHandler
304 PUBWEAK DMA1_Channel4_IRQHandler
305 SECTION .text:CODE:NOROOT:REORDER(1)
306 DMA1_Channel4_IRQHandler
307 B DMA1_Channel4_IRQHandler
309 PUBWEAK DMA1_Channel5_IRQHandler
310 SECTION .text:CODE:NOROOT:REORDER(1)
311 DMA1_Channel5_IRQHandler
312 B DMA1_Channel5_IRQHandler
314 PUBWEAK DMA1_Channel6_IRQHandler
315 SECTION .text:CODE:NOROOT:REORDER(1)
316 DMA1_Channel6_IRQHandler
317 B DMA1_Channel6_IRQHandler
319 PUBWEAK DMA1_Channel7_IRQHandler
320 SECTION .text:CODE:NOROOT:REORDER(1)
321 DMA1_Channel7_IRQHandler
322 B DMA1_Channel7_IRQHandler
324 PUBWEAK ADC1_IRQHandler
325 SECTION .text:CODE:NOROOT:REORDER(1)
329 PUBWEAK USB_HP_CAN_TX_IRQHandler
330 SECTION .text:CODE:NOROOT:REORDER(1)
331 USB_HP_CAN_TX_IRQHandler
332 B USB_HP_CAN_TX_IRQHandler
334 PUBWEAK USB_LP_CAN_RX0_IRQHandler
335 SECTION .text:CODE:NOROOT:REORDER(1)
336 USB_LP_CAN_RX0_IRQHandler
337 B USB_LP_CAN_RX0_IRQHandler
339 PUBWEAK CAN_RX1_IRQHandler
340 SECTION .text:CODE:NOROOT:REORDER(1)
344 PUBWEAK CAN_SCE_IRQHandler
345 SECTION .text:CODE:NOROOT:REORDER(1)
349 PUBWEAK EXTI9_5_IRQHandler
350 SECTION .text:CODE:NOROOT:REORDER(1)
354 PUBWEAK TIM1_BRK_TIM15_IRQHandler
355 SECTION .text:CODE:NOROOT:REORDER(1)
356 TIM1_BRK_TIM15_IRQHandler
357 B TIM1_BRK_TIM15_IRQHandler
359 PUBWEAK TIM1_UP_TIM16_IRQHandler
360 SECTION .text:CODE:NOROOT:REORDER(1)
361 TIM1_UP_TIM16_IRQHandler
362 B TIM1_UP_TIM16_IRQHandler
364 PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
365 SECTION .text:CODE:NOROOT:REORDER(1)
366 TIM1_TRG_COM_TIM17_IRQHandler
367 B TIM1_TRG_COM_TIM17_IRQHandler
369 PUBWEAK TIM1_CC_IRQHandler
370 SECTION .text:CODE:NOROOT:REORDER(1)
374 PUBWEAK TIM2_IRQHandler
375 SECTION .text:CODE:NOROOT:REORDER(1)
379 PUBWEAK I2C1_EV_IRQHandler
380 SECTION .text:CODE:NOROOT:REORDER(1)
384 PUBWEAK I2C1_ER_IRQHandler
385 SECTION .text:CODE:NOROOT:REORDER(1)
389 PUBWEAK I2C2_EV_IRQHandler
390 SECTION .text:CODE:NOROOT:REORDER(1)
394 PUBWEAK I2C2_ER_IRQHandler
395 SECTION .text:CODE:NOROOT:REORDER(1)
399 PUBWEAK SPI2_IRQHandler
400 SECTION .text:CODE:NOROOT:REORDER(1)
404 PUBWEAK USART1_IRQHandler
405 SECTION .text:CODE:NOROOT:REORDER(1)
409 PUBWEAK USART2_IRQHandler
410 SECTION .text:CODE:NOROOT:REORDER(1)
414 PUBWEAK USART3_IRQHandler
415 SECTION .text:CODE:NOROOT:REORDER(1)
419 PUBWEAK EXTI15_10_IRQHandler
420 SECTION .text:CODE:NOROOT:REORDER(1)
422 B EXTI15_10_IRQHandler
424 PUBWEAK RTC_Alarm_IRQHandler
425 SECTION .text:CODE:NOROOT:REORDER(1)
427 B RTC_Alarm_IRQHandler
429 PUBWEAK USBWakeUp_IRQHandler
430 SECTION .text:CODE:NOROOT:REORDER(1)
432 B USBWakeUp_IRQHandler
434 PUBWEAK SPI3_IRQHandler
435 SECTION .text:CODE:NOROOT:REORDER(1)
439 PUBWEAK TIM6_DAC_IRQHandler
440 SECTION .text:CODE:NOROOT:REORDER(1)
442 B TIM6_DAC_IRQHandler
444 PUBWEAK COMP2_IRQHandler
445 SECTION .text:CODE:NOROOT:REORDER(1)
449 PUBWEAK COMP4_6_IRQHandler
450 SECTION .text:CODE:NOROOT:REORDER(1)
454 PUBWEAK I2C3_EV_IRQHandler
455 SECTION .text:CODE:NOROOT:REORDER(1)
459 PUBWEAK I2C3_ER_IRQHandler
460 SECTION .text:CODE:NOROOT:REORDER(1)
464 PUBWEAK USB_HP_IRQHandler
465 SECTION .text:CODE:NOROOT:REORDER(1)
469 PUBWEAK USB_LP_IRQHandler
470 SECTION .text:CODE:NOROOT:REORDER(1)
474 PUBWEAK USBWakeUp_RMP_IRQHandler
475 SECTION .text:CODE:NOROOT:REORDER(1)
476 USBWakeUp_RMP_IRQHandler
477 B USBWakeUp_RMP_IRQHandler
479 PUBWEAK FPU_IRQHandler
480 SECTION .text:CODE:NOROOT:REORDER(1)
485 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/