QuakeGod
2024-02-24 8b51c78f1b88d94a89bb8c37ae38a54f523cb597
提交 | 用户 | age
8b51c7 1 ;******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
Q 2 ;* File Name          : startup_stm32f072xb.s
3 ;* Author             : MCD Application Team
4 ;* Description        : STM32F072x8/STM32F072xB 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 
9 ;*                        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 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.
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 ;
40 ;
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.
46 ;
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.
52 ;
53 ; Cortex-M version
54 ;
55
56         MODULE  ?cstartup
57
58         ;; Forward declaration of sections.
59         SECTION CSTACK:DATA:NOROOT(3)
60
61         SECTION .intvec:CODE:NOROOT(2)
62
63         EXTERN  __iar_program_start
64         EXTERN  SystemInit
65         PUBLIC  __vector_table
66
67         DATA
68 __vector_table
69         DCD     sfe(CSTACK)
70         DCD     Reset_Handler                  ; Reset Handler
71
72         DCD     NMI_Handler                    ; NMI Handler
73         DCD     HardFault_Handler              ; Hard Fault Handler
74         DCD     0                              ; Reserved
75         DCD     0                              ; Reserved
76         DCD     0                              ; Reserved
77         DCD     0                              ; Reserved
78         DCD     0                              ; Reserved
79         DCD     0                              ; Reserved
80         DCD     0                              ; Reserved
81         DCD     SVC_Handler                    ; SVCall Handler
82         DCD     0                              ; Reserved
83         DCD     0                              ; Reserved
84         DCD     PendSV_Handler                 ; PendSV Handler
85         DCD     SysTick_Handler                ; SysTick Handler
86
87         ; External Interrupts
88         DCD     WWDG_IRQHandler                ; Window Watchdog
89         DCD     PVD_VDDIO2_IRQHandler          ; PVD and VDDIO2 through EXTI Line detect
90         DCD     RTC_IRQHandler                 ; RTC through EXTI Line
91         DCD     FLASH_IRQHandler               ; FLASH
92         DCD     RCC_CRS_IRQHandler             ; RCC and CRS
93         DCD     EXTI0_1_IRQHandler             ; EXTI Line 0 and 1
94         DCD     EXTI2_3_IRQHandler             ; EXTI Line 2 and 3
95         DCD     EXTI4_15_IRQHandler            ; EXTI Line 4 to 15
96         DCD     TSC_IRQHandler                 ; TSC
97         DCD     DMA1_Channel1_IRQHandler       ; DMA1 Channel 1
98         DCD     DMA1_Channel2_3_IRQHandler     ; DMA1 Channel 2 and Channel 3
99         DCD     DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4 to Channel 7
100         DCD     ADC1_COMP_IRQHandler           ; ADC1, COMP1 and COMP2 
101         DCD     TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
102         DCD     TIM1_CC_IRQHandler             ; TIM1 Capture Compare
103         DCD     TIM2_IRQHandler                ; TIM2
104         DCD     TIM3_IRQHandler                ; TIM3
105         DCD     TIM6_DAC_IRQHandler            ; TIM6 and DAC
106         DCD     TIM7_IRQHandler                ; TIM7
107         DCD     TIM14_IRQHandler               ; TIM14
108         DCD     TIM15_IRQHandler               ; TIM15
109         DCD     TIM16_IRQHandler               ; TIM16
110         DCD     TIM17_IRQHandler               ; TIM17
111         DCD     I2C1_IRQHandler                ; I2C1
112         DCD     I2C2_IRQHandler                ; I2C2
113         DCD     SPI1_IRQHandler                ; SPI1
114         DCD     SPI2_IRQHandler                ; SPI2
115         DCD     USART1_IRQHandler              ; USART1
116         DCD     USART2_IRQHandler              ; USART2
117         DCD     USART3_4_IRQHandler            ; USART3 and USART4
118         DCD     CEC_CAN_IRQHandler             ; CEC and CAN
119         DCD     USB_IRQHandler                 ; USB
120         
121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
122 ;;
123 ;; Default interrupt handlers.
124 ;;
125         THUMB
126
127         PUBWEAK Reset_Handler
128         SECTION .text:CODE:NOROOT:REORDER(2)
129 Reset_Handler
130         LDR     R0, =SystemInit
131         BLX     R0
132         LDR     R0, =__iar_program_start
133         BX      R0
134         
135         PUBWEAK NMI_Handler
136         SECTION .text:CODE:NOROOT:REORDER(1)
137 NMI_Handler
138         B NMI_Handler
139
140         PUBWEAK HardFault_Handler
141         SECTION .text:CODE:NOROOT:REORDER(1)
142 HardFault_Handler
143         B HardFault_Handler
144
145         PUBWEAK SVC_Handler
146         SECTION .text:CODE:NOROOT:REORDER(1)
147 SVC_Handler
148         B SVC_Handler
149
150         PUBWEAK PendSV_Handler
151         SECTION .text:CODE:NOROOT:REORDER(1)
152 PendSV_Handler
153         B PendSV_Handler
154
155         PUBWEAK SysTick_Handler
156         SECTION .text:CODE:NOROOT:REORDER(1)
157 SysTick_Handler
158         B SysTick_Handler
159
160         PUBWEAK WWDG_IRQHandler
161         SECTION .text:CODE:NOROOT:REORDER(1)
162 WWDG_IRQHandler
163         B WWDG_IRQHandler
164
165         PUBWEAK PVD_VDDIO2_IRQHandler
166         SECTION .text:CODE:NOROOT:REORDER(1)
167 PVD_VDDIO2_IRQHandler
168         B PVD_VDDIO2_IRQHandler
169
170         PUBWEAK RTC_IRQHandler
171         SECTION .text:CODE:NOROOT:REORDER(1)
172 RTC_IRQHandler
173         B RTC_IRQHandler
174
175         PUBWEAK FLASH_IRQHandler
176         SECTION .text:CODE:NOROOT:REORDER(1)
177 FLASH_IRQHandler
178         B FLASH_IRQHandler
179
180         PUBWEAK RCC_CRS_IRQHandler
181         SECTION .text:CODE:NOROOT:REORDER(1)
182 RCC_CRS_IRQHandler
183         B RCC_CRS_IRQHandler
184
185         PUBWEAK EXTI0_1_IRQHandler
186         SECTION .text:CODE:NOROOT:REORDER(1)
187 EXTI0_1_IRQHandler
188         B EXTI0_1_IRQHandler
189
190         PUBWEAK EXTI2_3_IRQHandler
191         SECTION .text:CODE:NOROOT:REORDER(1)
192 EXTI2_3_IRQHandler
193         B EXTI2_3_IRQHandler
194
195         PUBWEAK EXTI4_15_IRQHandler
196         SECTION .text:CODE:NOROOT:REORDER(1)
197 EXTI4_15_IRQHandler
198         B EXTI4_15_IRQHandler
199
200         PUBWEAK TSC_IRQHandler
201         SECTION .text:CODE:NOROOT:REORDER(1)
202 TSC_IRQHandler
203         B TSC_IRQHandler
204
205         PUBWEAK DMA1_Channel1_IRQHandler
206         SECTION .text:CODE:NOROOT:REORDER(1)
207 DMA1_Channel1_IRQHandler
208         B DMA1_Channel1_IRQHandler
209
210         PUBWEAK DMA1_Channel2_3_IRQHandler
211         SECTION .text:CODE:NOROOT:REORDER(1)
212 DMA1_Channel2_3_IRQHandler
213         B DMA1_Channel2_3_IRQHandler
214
215         PUBWEAK DMA1_Channel4_5_6_7_IRQHandler
216         SECTION .text:CODE:NOROOT:REORDER(1)
217 DMA1_Channel4_5_6_7_IRQHandler
218         B DMA1_Channel4_5_6_7_IRQHandler
219
220         PUBWEAK ADC1_COMP_IRQHandler
221         SECTION .text:CODE:NOROOT:REORDER(1)
222 ADC1_COMP_IRQHandler
223         B ADC1_COMP_IRQHandler
224
225         PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler
226         SECTION .text:CODE:NOROOT:REORDER(1)
227 TIM1_BRK_UP_TRG_COM_IRQHandler
228         B TIM1_BRK_UP_TRG_COM_IRQHandler
229
230         PUBWEAK TIM1_CC_IRQHandler
231         SECTION .text:CODE:NOROOT:REORDER(1)
232 TIM1_CC_IRQHandler
233         B TIM1_CC_IRQHandler
234
235         PUBWEAK TIM2_IRQHandler
236         SECTION .text:CODE:NOROOT:REORDER(1)
237 TIM2_IRQHandler
238         B TIM2_IRQHandler
239
240         PUBWEAK TIM3_IRQHandler
241         SECTION .text:CODE:NOROOT:REORDER(1)
242 TIM3_IRQHandler
243         B TIM3_IRQHandler
244
245         PUBWEAK TIM6_DAC_IRQHandler
246         SECTION .text:CODE:NOROOT:REORDER(1)
247 TIM6_DAC_IRQHandler
248         B TIM6_DAC_IRQHandler
249         
250         PUBWEAK TIM7_IRQHandler
251         SECTION .text:CODE:NOROOT:REORDER(1)
252 TIM7_IRQHandler
253         B TIM7_IRQHandler
254
255         PUBWEAK TIM14_IRQHandler
256         SECTION .text:CODE:NOROOT:REORDER(1)
257 TIM14_IRQHandler
258         B TIM14_IRQHandler
259
260         PUBWEAK TIM15_IRQHandler
261         SECTION .text:CODE:NOROOT:REORDER(1)
262 TIM15_IRQHandler
263         B TIM15_IRQHandler
264
265         PUBWEAK TIM16_IRQHandler
266         SECTION .text:CODE:NOROOT:REORDER(1)
267 TIM16_IRQHandler
268         B TIM16_IRQHandler
269
270         PUBWEAK TIM17_IRQHandler
271         SECTION .text:CODE:NOROOT:REORDER(1)
272 TIM17_IRQHandler
273         B TIM17_IRQHandler
274
275         PUBWEAK I2C1_IRQHandler
276         SECTION .text:CODE:NOROOT:REORDER(1)
277 I2C1_IRQHandler
278         B I2C1_IRQHandler
279
280         PUBWEAK I2C2_IRQHandler
281         SECTION .text:CODE:NOROOT:REORDER(1)
282 I2C2_IRQHandler
283         B I2C2_IRQHandler
284
285         PUBWEAK SPI1_IRQHandler
286         SECTION .text:CODE:NOROOT:REORDER(1)
287 SPI1_IRQHandler
288         B SPI1_IRQHandler
289
290         PUBWEAK SPI2_IRQHandler
291         SECTION .text:CODE:NOROOT:REORDER(1)
292 SPI2_IRQHandler
293         B SPI2_IRQHandler
294
295         PUBWEAK USART1_IRQHandler
296         SECTION .text:CODE:NOROOT:REORDER(1)
297 USART1_IRQHandler
298         B USART1_IRQHandler
299
300         PUBWEAK USART2_IRQHandler
301         SECTION .text:CODE:NOROOT:REORDER(1)
302 USART2_IRQHandler
303         B USART2_IRQHandler
304
305         PUBWEAK USART3_4_IRQHandler
306         SECTION .text:CODE:NOROOT:REORDER(1)
307 USART3_4_IRQHandler
308         B USART3_4_IRQHandler
309
310         PUBWEAK CEC_CAN_IRQHandler
311         SECTION .text:CODE:NOROOT:REORDER(1)
312 CEC_CAN_IRQHandler
313         B CEC_CAN_IRQHandler
314
315         PUBWEAK USB_IRQHandler
316         SECTION .text:CODE:NOROOT:REORDER(1)
317 USB_IRQHandler
318         B USB_IRQHandler
319         
320         END
321 ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****