summaryrefslogtreecommitdiff
path: root/bsp/yichip/yc3121-pos/libraries/startup/flash_start_iar.s
blob: a1307cd43dfc45fdd0df863c69e46e75a7d0a1ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
    MODULE ?cstartup

    EXTERN __iar_program_start

    SECTION CSTACK:DATA:NOROOT(3)

    PUBLIC start_flash
    SECTION .intvec:CODE:REORDER(2)
start_flash
    LDR R0, =hardware_init
    BX R0

    PUBLIC hard_fault_handler
hard_fault_handler
    BL HARD_FAULT_IRQHandler

    PUBLIC svc_handler
svc_handler
    BL SVC_IRQHandler

    PUBLIC pendsv_handler
pendsv_handler
    BL PENDSV_IRQHandler

    PUBLIC systick
systick
    BL SYSTICK_IRQHandler

    PUBLIC irq0
irq0
    movs r0,#0
    b isr

    PUBLIC irq1
irq1
    movs r0,#1
    b isr

    PUBLIC irq2
irq2
    movs r0,#2
    b isr

    PUBLIC irq3
irq3
    movs r0,#3
    b isr

    PUBLIC irq4
irq4
    movs r0,#4
    b isr

    PUBLIC irq5
irq5
    movs r0,#5
    b isr

    PUBLIC irq6
irq6
    movs r0,#6
    b isr

    PUBLIC irq7
irq7
    movs r0,#7
    b isr

    PUBLIC irq8
irq8
    movs r0,#8
    b isr

    PUBLIC irq9
irq9
    movs r0,#9
    b isr

    PUBLIC irq10
irq10
    movs r0,#10
    b isr

    PUBLIC irq11
irq11
    movs r0,#11
    b isr

    PUBLIC irq12
irq12
    movs r0,#12
    b isr

    PUBLIC irq13
irq13
    movs r0,#13
    b isr

    PUBLIC irq14
irq14
    movs r0,#14
    b isr

    PUBLIC irq15
irq15
    movs r0,#15
    b isr

    PUBLIC irq16
irq16
    movs r0,#16
    b isr

    PUBLIC irq17
irq17
    movs r0,#17
    b isr

    PUBLIC irq18
irq18
    movs r0,#18
    b isr

    PUBLIC irq19
irq19
    movs r0,#19
    b isr

    PUBLIC irq20
irq20
    movs r0,#20
    b isr

    PUBLIC irq21
irq21
    movs r0,#21
    b isr

    PUBLIC irq22
irq22
    movs r0,#22
    b isr

    PUBLIC irq23
irq23
    movs r0,#23
    b isr

    PUBLIC irq24
irq24
    movs r0,#24
    b isr

    PUBLIC irq25
irq25
    movs r0,#25
    b isr

    PUBLIC irq26
irq26
    movs r0,#26
    b isr

    PUBLIC irq27
irq27
    movs r0,#27
    b isr

    PUBLIC irq28
irq28
    movs r0,#28
    b isr

    PUBLIC irq29
irq29
    movs r0,#29
    b isr

    PUBLIC irq30
irq30
    movs r0,#30
    b isr

    PUBLIC irq31
irq31
    movs r0,#31
    b isr

    PUBLIC isr
isr
    ldr r1,=__vector_table
    ldr r0,[r0, r1]
    bx r0


    PUBWEAK HARD_FAULT_IRQHandler
    PUBWEAK SVC_IRQHandler
    PUBWEAK PENDSV_IRQHandler
    PUBWEAK SYSTICK_IRQHandler
    PUBWEAK USB_IRQHandler
    PUBWEAK IIC_IRQHandler
    PUBWEAK QSPI_IRQHandler
    PUBWEAK SPI0_IRQHandler
    PUBWEAK SPI1_IRQHandler
    PUBWEAK UART0_IRQHandler
    PUBWEAK UART1_IRQHandler
    PUBWEAK MEMCP_IRQHandler
    PUBWEAK RSA_IRQHandler
    PUBWEAK SCI0_IRQHandler
    PUBWEAK SCI1_IRQHandler
    PUBWEAK BT_IRQHandler
    PUBWEAK GPIO_IRQHandler
    PUBWEAK TIMER0_IRQHandler
    PUBWEAK TIMER1_IRQHandler
    PUBWEAK TIMER2_IRQHandler
    PUBWEAK TIMER3_IRQHandler
    PUBWEAK TIMER4_IRQHandler
    PUBWEAK TIMER5_IRQHandler
    PUBWEAK TIMER6_IRQHandler
    PUBWEAK TIMER7_IRQHandler
    PUBWEAK TIMER8_IRQHandler
    PUBWEAK SM4_IRQHandler
    PUBWEAK SEC_IRQHandler
    PUBWEAK MSR_IRQHandler
    PUBWEAK TRNG_IRQHandler
    PUBWEAK WDT_IRQHandler


HARD_FAULT_IRQHandler
SVC_IRQHandler
PENDSV_IRQHandler
SYSTICK_IRQHandler

USB_IRQHandler
IIC_IRQHandler
QSPI_IRQHandler
SPI0_IRQHandler
SPI1_IRQHandler
UART0_IRQHandler
UART1_IRQHandler
MEMCP_IRQHandler
RSA_IRQHandler
SCI0_IRQHandler
SCI1_IRQHandler
BT_IRQHandler
GPIO_IRQHandler
TIMER0_IRQHandler
TIMER1_IRQHandler
TIMER2_IRQHandler
TIMER3_IRQHandler
TIMER4_IRQHandler
TIMER5_IRQHandler
TIMER6_IRQHandler
TIMER7_IRQHandler
TIMER8_IRQHandler
SM4_IRQHandler
SEC_IRQHandler
MSR_IRQHandler
TRNG_IRQHandler
WDT_IRQHandler
    B       .

    PUBLIC delay
delay
    subs r0,#1
    bne delay
    nop
    bx lr

    PUBLIC __vector_table
    ALIGNROM 2
    data
__vector_table
    DCD USB_IRQHandler
    DCD IIC_IRQHandler
    DCD QSPI_IRQHandler
    DCD SPI0_IRQHandler
    DCD SPI1_IRQHandler
    DCD UART0_IRQHandler
    DCD UART1_IRQHandler
    DCD MEMCP_IRQHandler
    DCD RSA_IRQHandler
    DCD SCI0_IRQHandler
    DCD SCI1_IRQHandler
    DCD BT_IRQHandler
    DCD GPIO_IRQHandler
    DCD TIMER0_IRQHandler
    DCD TIMER1_IRQHandler
    DCD TIMER2_IRQHandler
    DCD TIMER3_IRQHandler
    DCD TIMER4_IRQHandler
    DCD TIMER5_IRQHandler
    DCD TIMER6_IRQHandler
    DCD TIMER7_IRQHandler
    DCD TIMER8_IRQHandler
    DCD SM4_IRQHandler
    DCD SEC_IRQHandler
    DCD MSR_IRQHandler
    DCD TRNG_IRQHandler
    DCD WDT_IRQHandler


    PUBLIC hardware_init
    SECTION .intvec:CODE:REORDER(2)
    CODE
hardware_init
    LDR R0, =sfe(CSTACK)
    mov	sp, R0
    LDR R0, =__iar_program_start
    BX 	R0
    END