Subversion Repositories FuelGauge

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
;*******************************************************************************
2
;* File Name          : startup_stm32f070x6.s
3
;* Author             : MCD Application Team
4
;* Description        : STM32F070x6 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
;* @attention
16
;*
17
;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics.
18
;* All rights reserved.</center></h2>
19
;*
20
;* This software component is licensed by ST under BSD 3-Clause license,
21
;* the "License"; You may not use this file except in compliance with the
22
;* License. You may obtain a copy of the License at:
23
;*                        opensource.org/licenses/BSD-3-Clause
24
;*
25
;*******************************************************************************
26
;
27
;
28
; The modules in this file are included in the libraries, and may be replaced
29
; by any user-defined modules that define the PUBLIC symbol _program_start or
30
; a user defined start symbol.
31
; To override the cstartup defined in the library, simply add your modified
32
; version to the workbench project.
33
;
34
; The vector table is normally located at address 0.
35
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
36
; The name "__vector_table" has special meaning for C-SPY:
37
; it is where the SP start value is found, and the NVIC vector
38
; table register (VTOR) is initialized to this address if != 0.
39
;
40
; Cortex-M version
41
;
42
 
43
        MODULE  ?cstartup
44
 
45
        ;; Forward declaration of sections.
46
        SECTION CSTACK:DATA:NOROOT(3)
47
 
48
        SECTION .intvec:CODE:NOROOT(2)
49
 
50
        EXTERN  __iar_program_start
51
        EXTERN  SystemInit
52
        PUBLIC  __vector_table
53
 
54
        DATA
55
__vector_table
56
        DCD     sfe(CSTACK)
57
        DCD     Reset_Handler                  ; Reset Handler
58
 
59
        DCD     NMI_Handler                    ; NMI Handler
60
        DCD     HardFault_Handler              ; Hard Fault Handler
61
        DCD     0                              ; Reserved
62
        DCD     0                              ; Reserved
63
        DCD     0                              ; Reserved
64
        DCD     0                              ; Reserved
65
        DCD     0                              ; Reserved
66
        DCD     0                              ; Reserved
67
        DCD     0                              ; Reserved
68
        DCD     SVC_Handler                    ; SVCall Handler
69
        DCD     0                              ; Reserved
70
        DCD     0                              ; Reserved
71
        DCD     PendSV_Handler                 ; PendSV Handler
72
        DCD     SysTick_Handler                ; SysTick Handler
73
 
74
        ; External Interrupts
75
        DCD     WWDG_IRQHandler                ; Window Watchdog
76
        DCD     0                              ; Reserved        
77
        DCD     RTC_IRQHandler                 ; RTC through EXTI Line
78
        DCD     FLASH_IRQHandler               ; FLASH
79
        DCD     RCC_IRQHandler                 ; RCC
80
        DCD     EXTI0_1_IRQHandler             ; EXTI Line 0 and 1
81
        DCD     EXTI2_3_IRQHandler             ; EXTI Line 2 and 3
82
        DCD     EXTI4_15_IRQHandler            ; EXTI Line 4 to 15
83
        DCD     0                              ; Reserved
84
        DCD     DMA1_Channel1_IRQHandler       ; DMA1 Channel 1
85
        DCD     DMA1_Channel2_3_IRQHandler     ; DMA1 Channel 2 and Channel 3
86
        DCD     DMA1_Channel4_5_IRQHandler     ; DMA1 Channel 4 and Channel 5
87
        DCD     ADC1_IRQHandler                ; ADC1 
88
        DCD     TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
89
        DCD     TIM1_CC_IRQHandler             ; TIM1 Capture Compare
90
        DCD     0                              ; Reserved
91
        DCD     TIM3_IRQHandler                ; TIM3
92
        DCD     0                              ; Reserved
93
        DCD     0                              ; Reserved
94
        DCD     TIM14_IRQHandler               ; TIM14
95
        DCD     0                              ; Reserved
96
        DCD     TIM16_IRQHandler               ; TIM16
97
        DCD     TIM17_IRQHandler               ; TIM17
98
        DCD     I2C1_IRQHandler                ; I2C1
99
        DCD     0                              ; Reserved
100
        DCD     SPI1_IRQHandler                ; SPI1
101
        DCD     0                              ; Reserved
102
        DCD     USART1_IRQHandler              ; USART1
103
        DCD     USART2_IRQHandler              ; USART2
104
        DCD     0                              ; Reserved
105
        DCD     0                              ; Reserved
106
        DCD     USB_IRQHandler                 ; USB
107
 
108
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
109
;;
110
;; Default interrupt handlers.
111
;;
112
        THUMB
113
 
114
        PUBWEAK Reset_Handler
115
        SECTION .text:CODE:NOROOT:REORDER(2)
116
Reset_Handler
117
 
118
        LDR     R0, =sfe(CSTACK)          ; set stack pointer 
119
        MSR     MSP, R0 
120
 
121
;;Check if boot space corresponds to test memory 
122
        LDR R0,=0x00000004
123
        LDR R1, [R0]
124
        LSRS R1, R1, #24
125
        LDR R2,=0x1F
126
        CMP R1, R2
127
 
128
        BNE ApplicationStart       
129
;; SYSCFG clock enable         
130
        LDR R0,=0x40021018 
131
        LDR R1,=0x00000001
132
        STR R1, [R0]
133
 
134
;; Set CFGR1 register with flash memory remap at address 0
135
 
136
        LDR R0,=0x40010000 
137
        LDR R1,=0x00000000
138
        STR R1, [R0]
139
ApplicationStart
140
        LDR     R0, =SystemInit
141
        BLX     R0
142
        LDR     R0, =__iar_program_start
143
        BX      R0
144
 
145
        PUBWEAK NMI_Handler
146
        SECTION .text:CODE:NOROOT:REORDER(1)
147
NMI_Handler
148
        B NMI_Handler
149
 
150
        PUBWEAK HardFault_Handler
151
        SECTION .text:CODE:NOROOT:REORDER(1)
152
HardFault_Handler
153
        B HardFault_Handler
154
 
155
        PUBWEAK SVC_Handler
156
        SECTION .text:CODE:NOROOT:REORDER(1)
157
SVC_Handler
158
        B SVC_Handler
159
 
160
        PUBWEAK PendSV_Handler
161
        SECTION .text:CODE:NOROOT:REORDER(1)
162
PendSV_Handler
163
        B PendSV_Handler
164
 
165
        PUBWEAK SysTick_Handler
166
        SECTION .text:CODE:NOROOT:REORDER(1)
167
SysTick_Handler
168
        B SysTick_Handler
169
 
170
        PUBWEAK WWDG_IRQHandler
171
        SECTION .text:CODE:NOROOT:REORDER(1)
172
WWDG_IRQHandler
173
        B WWDG_IRQHandler
174
 
175
        PUBWEAK RTC_IRQHandler
176
        SECTION .text:CODE:NOROOT:REORDER(1)
177
RTC_IRQHandler
178
        B RTC_IRQHandler
179
 
180
        PUBWEAK FLASH_IRQHandler
181
        SECTION .text:CODE:NOROOT:REORDER(1)
182
FLASH_IRQHandler
183
        B FLASH_IRQHandler
184
 
185
        PUBWEAK RCC_IRQHandler
186
        SECTION .text:CODE:NOROOT:REORDER(1)
187
RCC_IRQHandler
188
        B RCC_IRQHandler
189
 
190
        PUBWEAK EXTI0_1_IRQHandler
191
        SECTION .text:CODE:NOROOT:REORDER(1)
192
EXTI0_1_IRQHandler
193
        B EXTI0_1_IRQHandler
194
 
195
        PUBWEAK EXTI2_3_IRQHandler
196
        SECTION .text:CODE:NOROOT:REORDER(1)
197
EXTI2_3_IRQHandler
198
        B EXTI2_3_IRQHandler
199
 
200
        PUBWEAK EXTI4_15_IRQHandler
201
        SECTION .text:CODE:NOROOT:REORDER(1)
202
EXTI4_15_IRQHandler
203
        B EXTI4_15_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_IRQHandler
216
        SECTION .text:CODE:NOROOT:REORDER(1)
217
DMA1_Channel4_5_IRQHandler
218
        B DMA1_Channel4_5_IRQHandler
219
 
220
        PUBWEAK ADC1_IRQHandler
221
        SECTION .text:CODE:NOROOT:REORDER(1)
222
ADC1_IRQHandler
223
        B ADC1_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 TIM3_IRQHandler
236
        SECTION .text:CODE:NOROOT:REORDER(1)
237
TIM3_IRQHandler
238
        B TIM3_IRQHandler
239
 
240
        PUBWEAK TIM14_IRQHandler
241
        SECTION .text:CODE:NOROOT:REORDER(1)
242
TIM14_IRQHandler
243
        B TIM14_IRQHandler
244
 
245
        PUBWEAK TIM16_IRQHandler
246
        SECTION .text:CODE:NOROOT:REORDER(1)
247
TIM16_IRQHandler
248
        B TIM16_IRQHandler
249
 
250
        PUBWEAK TIM17_IRQHandler
251
        SECTION .text:CODE:NOROOT:REORDER(1)
252
TIM17_IRQHandler
253
        B TIM17_IRQHandler
254
 
255
        PUBWEAK I2C1_IRQHandler
256
        SECTION .text:CODE:NOROOT:REORDER(1)
257
I2C1_IRQHandler
258
        B I2C1_IRQHandler
259
 
260
        PUBWEAK SPI1_IRQHandler
261
        SECTION .text:CODE:NOROOT:REORDER(1)
262
SPI1_IRQHandler
263
        B SPI1_IRQHandler
264
 
265
        PUBWEAK USART1_IRQHandler
266
        SECTION .text:CODE:NOROOT:REORDER(1)
267
USART1_IRQHandler
268
        B USART1_IRQHandler
269
 
270
        PUBWEAK USART2_IRQHandler
271
        SECTION .text:CODE:NOROOT:REORDER(1)
272
USART2_IRQHandler
273
        B USART2_IRQHandler
274
 
275
        PUBWEAK USB_IRQHandler
276
        SECTION .text:CODE:NOROOT:REORDER(1)
277
USB_IRQHandler
278
        B USB_IRQHandler
279
 
280
        END
281
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****