1 ;
/******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
2 ;* File Name : startup_stm32f302x8.s
3 ;* Author : MCD Application Team
4 ;* Description : STM32F302x6/STM32F302x8 devices vector table for EWARM toolchain.
5 ;* This module performs:
6 ;* - Set the initial SP
7 ;* - Set the initial PC == _iar_program_start,
8 ;* - Set the vector table entries with the exceptions ISR
10 ;* - Branches to main in the C library (which eventually
12 ;* After Reset the Cortex-M4 processor is in Thread mode,
13 ;* priority is Privileged, and the Stack is set to Main.
14 ;********************************************************************************
16 ;* Redistribution and use in source and binary forms, with or without modification,
17 ;* are permitted provided that 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.
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.
38 ;*******************************************************************************
41 ; The modules in this file are included in the libraries, and may be replaced
42 ; by any user-defined modules that define the PUBLIC symbol _program_start or
43 ; a user defined start symbol.
44 ; To override the cstartup defined in the library, simply add your modified
45 ; version to the workbench project.
47 ; The vector table is normally located at address 0.
48 ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
49 ; The name "__vector_table" has special meaning for C-SPY:
50 ; it is where the SP start value is found, and the NVIC vector
51 ; table register (VTOR) is initialized to this address if != 0.
58 ;; Forward declaration of sections.
59 SECTION CSTACK:DATA:NOROOT(3)
61 SECTION .intvec:CODE:NOROOT(2)
63 EXTERN __iar_program_start
70 DCD Reset_Handler ; Reset Handler
72 DCD NMI_Handler ; NMI Handler
73 DCD HardFault_Handler ; Hard Fault Handler
74 DCD MemManage_Handler ; MPU Fault Handler
75 DCD BusFault_Handler ; Bus Fault Handler
76 DCD UsageFault_Handler ; Usage Fault Handler
81 DCD SVC_Handler ; SVCall Handler
82 DCD DebugMon_Handler ; Debug Monitor Handler
84 DCD PendSV_Handler ; PendSV Handler
85 DCD SysTick_Handler ; SysTick Handler
88 DCD WWDG_IRQHandler ; Window WatchDog
89 DCD PVD_IRQHandler ; PVD through EXTI Line detection
90 DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
91 DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
92 DCD FLASH_IRQHandler ; FLASH
93 DCD RCC_IRQHandler ; RCC
94 DCD EXTI0_IRQHandler ; EXTI Line0
95 DCD EXTI1_IRQHandler ; EXTI Line1
96 DCD EXTI2_TSC_IRQHandler ; EXTI Line2 and Touch Sense controller
97 DCD EXTI3_IRQHandler ; EXTI Line3
98 DCD EXTI4_IRQHandler ; EXTI Line4
99 DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
100 DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
101 DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
102 DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
103 DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
104 DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
105 DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
106 DCD ADC1_IRQHandler ; ADC1
107 DCD USB_HP_CAN_TX_IRQHandler ; USB Device High Priority or CAN TX
108 DCD USB_LP_CAN_RX0_IRQHandler ; USB Device Low Priority or CAN RX0
109 DCD CAN_RX1_IRQHandler ; CAN RX1
110 DCD CAN_SCE_IRQHandler ; CAN SCE
111 DCD EXTI9_5_IRQHandler ; External Line[9:5]s
112 DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15
113 DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16
114 DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Commutation and TIM17
115 DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
116 DCD TIM2_IRQHandler ; TIM2
119 DCD I2C1_EV_IRQHandler ; I2C1 Event
120 DCD I2C1_ER_IRQHandler ; I2C1 Error
121 DCD I2C2_EV_IRQHandler ; I2C2 Event
122 DCD I2C2_ER_IRQHandler ; I2C2 Error
124 DCD SPI2_IRQHandler ; SPI2
125 DCD USART1_IRQHandler ; USART1
126 DCD USART2_IRQHandler ; USART2
127 DCD USART3_IRQHandler ; USART3
128 DCD EXTI15_10_IRQHandler ; External Line[15:10]s
129 DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
130 DCD USBWakeUp_IRQHandler ; USB Wakeup through EXTI line
139 DCD SPI3_IRQHandler ; SPI3
142 DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1 underrun errors
152 DCD COMP2_IRQHandler ; COMP2
153 DCD COMP4_6_IRQHandler ; COMP4 and COMP6
160 DCD I2C3_EV_IRQHandler ; I2C3 Event
161 DCD I2C3_ER_IRQHandler ; I2C3 Error
162 DCD USB_HP_IRQHandler ; USB High Priority remap
163 DCD USB_LP_IRQHandler ; USB Low Priority remap
164 DCD USBWakeUp_RMP_IRQHandler ; USB Wakeup remap through EXTI
169 DCD FPU_IRQHandler ; FPU
171 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
173 ;; Default interrupt handlers.
176 PUBWEAK Reset_Handler
177 SECTION .text:CODE:NOROOT:REORDER(2)
182 LDR R0, =__iar_program_start
186 SECTION .text:CODE:NOROOT:REORDER(1)
190 PUBWEAK HardFault_Handler
191 SECTION .text:CODE:NOROOT:REORDER(1)
195 PUBWEAK MemManage_Handler
196 SECTION .text:CODE:NOROOT:REORDER(1)
200 PUBWEAK BusFault_Handler
201 SECTION .text:CODE:NOROOT:REORDER(1)
205 PUBWEAK UsageFault_Handler
206 SECTION .text:CODE:NOROOT:REORDER(1)
211 SECTION .text:CODE:NOROOT:REORDER(1)
215 PUBWEAK DebugMon_Handler
216 SECTION .text:CODE:NOROOT:REORDER(1)
220 PUBWEAK PendSV_Handler
221 SECTION .text:CODE:NOROOT:REORDER(1)
225 PUBWEAK SysTick_Handler
226 SECTION .text:CODE:NOROOT:REORDER(1)
230 PUBWEAK WWDG_IRQHandler
231 SECTION .text:CODE:NOROOT:REORDER(1)
235 PUBWEAK PVD_IRQHandler
236 SECTION .text:CODE:NOROOT:REORDER(1)
240 PUBWEAK TAMP_STAMP_IRQHandler
241 SECTION .text:CODE:NOROOT:REORDER(1)
242 TAMP_STAMP_IRQHandler
243 B TAMP_STAMP_IRQHandler
245 PUBWEAK RTC_WKUP_IRQHandler
246 SECTION .text:CODE:NOROOT:REORDER(1)
248 B RTC_WKUP_IRQHandler
250 PUBWEAK FLASH_IRQHandler
251 SECTION .text:CODE:NOROOT:REORDER(1)
255 PUBWEAK RCC_IRQHandler
256 SECTION .text:CODE:NOROOT:REORDER(1)
260 PUBWEAK EXTI0_IRQHandler
261 SECTION .text:CODE:NOROOT:REORDER(1)
265 PUBWEAK EXTI1_IRQHandler
266 SECTION .text:CODE:NOROOT:REORDER(1)
270 PUBWEAK EXTI2_TSC_IRQHandler
271 SECTION .text:CODE:NOROOT:REORDER(1)
273 B EXTI2_TSC_IRQHandler
275 PUBWEAK EXTI3_IRQHandler
276 SECTION .text:CODE:NOROOT:REORDER(1)
280 PUBWEAK EXTI4_IRQHandler
281 SECTION .text:CODE:NOROOT:REORDER(1)
285 PUBWEAK DMA1_Channel1_IRQHandler
286 SECTION .text:CODE:NOROOT:REORDER(1)
287 DMA1_Channel1_IRQHandler
288 B DMA1_Channel1_IRQHandler
290 PUBWEAK DMA1_Channel2_IRQHandler
291 SECTION .text:CODE:NOROOT:REORDER(1)
292 DMA1_Channel2_IRQHandler
293 B DMA1_Channel2_IRQHandler
295 PUBWEAK DMA1_Channel3_IRQHandler
296 SECTION .text:CODE:NOROOT:REORDER(1)
297 DMA1_Channel3_IRQHandler
298 B DMA1_Channel3_IRQHandler
300 PUBWEAK DMA1_Channel4_IRQHandler
301 SECTION .text:CODE:NOROOT:REORDER(1)
302 DMA1_Channel4_IRQHandler
303 B DMA1_Channel4_IRQHandler
305 PUBWEAK DMA1_Channel5_IRQHandler
306 SECTION .text:CODE:NOROOT:REORDER(1)
307 DMA1_Channel5_IRQHandler
308 B DMA1_Channel5_IRQHandler
310 PUBWEAK DMA1_Channel6_IRQHandler
311 SECTION .text:CODE:NOROOT:REORDER(1)
312 DMA1_Channel6_IRQHandler
313 B DMA1_Channel6_IRQHandler
315 PUBWEAK DMA1_Channel7_IRQHandler
316 SECTION .text:CODE:NOROOT:REORDER(1)
317 DMA1_Channel7_IRQHandler
318 B DMA1_Channel7_IRQHandler
320 PUBWEAK ADC1_IRQHandler
321 SECTION .text:CODE:NOROOT:REORDER(1)
325 PUBWEAK USB_HP_CAN_TX_IRQHandler
326 SECTION .text:CODE:NOROOT:REORDER(1)
327 USB_HP_CAN_TX_IRQHandler
328 B USB_HP_CAN_TX_IRQHandler
330 PUBWEAK USB_LP_CAN_RX0_IRQHandler
331 SECTION .text:CODE:NOROOT:REORDER(1)
332 USB_LP_CAN_RX0_IRQHandler
333 B USB_LP_CAN_RX0_IRQHandler
335 PUBWEAK CAN_RX1_IRQHandler
336 SECTION .text:CODE:NOROOT:REORDER(1)
340 PUBWEAK CAN_SCE_IRQHandler
341 SECTION .text:CODE:NOROOT:REORDER(1)
345 PUBWEAK EXTI9_5_IRQHandler
346 SECTION .text:CODE:NOROOT:REORDER(1)
350 PUBWEAK TIM1_BRK_TIM15_IRQHandler
351 SECTION .text:CODE:NOROOT:REORDER(1)
352 TIM1_BRK_TIM15_IRQHandler
353 B TIM1_BRK_TIM15_IRQHandler
355 PUBWEAK TIM1_UP_TIM16_IRQHandler
356 SECTION .text:CODE:NOROOT:REORDER(1)
357 TIM1_UP_TIM16_IRQHandler
358 B TIM1_UP_TIM16_IRQHandler
360 PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
361 SECTION .text:CODE:NOROOT:REORDER(1)
362 TIM1_TRG_COM_TIM17_IRQHandler
363 B TIM1_TRG_COM_TIM17_IRQHandler
365 PUBWEAK TIM1_CC_IRQHandler
366 SECTION .text:CODE:NOROOT:REORDER(1)
370 PUBWEAK TIM2_IRQHandler
371 SECTION .text:CODE:NOROOT:REORDER(1)
375 PUBWEAK I2C1_EV_IRQHandler
376 SECTION .text:CODE:NOROOT:REORDER(1)
380 PUBWEAK I2C1_ER_IRQHandler
381 SECTION .text:CODE:NOROOT:REORDER(1)
385 PUBWEAK I2C2_EV_IRQHandler
386 SECTION .text:CODE:NOROOT:REORDER(1)
390 PUBWEAK I2C2_ER_IRQHandler
391 SECTION .text:CODE:NOROOT:REORDER(1)
395 PUBWEAK SPI2_IRQHandler
396 SECTION .text:CODE:NOROOT:REORDER(1)
400 PUBWEAK USART1_IRQHandler
401 SECTION .text:CODE:NOROOT:REORDER(1)
405 PUBWEAK USART2_IRQHandler
406 SECTION .text:CODE:NOROOT:REORDER(1)
410 PUBWEAK USART3_IRQHandler
411 SECTION .text:CODE:NOROOT:REORDER(1)
415 PUBWEAK EXTI15_10_IRQHandler
416 SECTION .text:CODE:NOROOT:REORDER(1)
418 B EXTI15_10_IRQHandler
420 PUBWEAK RTC_Alarm_IRQHandler
421 SECTION .text:CODE:NOROOT:REORDER(1)
423 B RTC_Alarm_IRQHandler
425 PUBWEAK USBWakeUp_IRQHandler
426 SECTION .text:CODE:NOROOT:REORDER(1)
428 B USBWakeUp_IRQHandler
430 PUBWEAK SPI3_IRQHandler
431 SECTION .text:CODE:NOROOT:REORDER(1)
435 PUBWEAK TIM6_DAC_IRQHandler
436 SECTION .text:CODE:NOROOT:REORDER(1)
438 B TIM6_DAC_IRQHandler
440 PUBWEAK COMP2_IRQHandler
441 SECTION .text:CODE:NOROOT:REORDER(1)
445 PUBWEAK COMP4_6_IRQHandler
446 SECTION .text:CODE:NOROOT:REORDER(1)
450 PUBWEAK I2C3_EV_IRQHandler
451 SECTION .text:CODE:NOROOT:REORDER(1)
455 PUBWEAK I2C3_ER_IRQHandler
456 SECTION .text:CODE:NOROOT:REORDER(1)
460 PUBWEAK USB_HP_IRQHandler
461 SECTION .text:CODE:NOROOT:REORDER(1)
465 PUBWEAK USB_LP_IRQHandler
466 SECTION .text:CODE:NOROOT:REORDER(1)
470 PUBWEAK USBWakeUp_RMP_IRQHandler
471 SECTION .text:CODE:NOROOT:REORDER(1)
472 USBWakeUp_RMP_IRQHandler
473 B USBWakeUp_RMP_IRQHandler
475 PUBWEAK FPU_IRQHandler
476 SECTION .text:CODE:NOROOT:REORDER(1)
481 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/