OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [CORTEX_STM32F103_GCC_Rowley/] [STM32F10x_Startup.s] - Blame information for rev 615

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 582 jeremybenn
/*****************************************************************************
2
 * Copyright (c) 2007 Rowley Associates Limited.                             *
3
 *                                                                           *
4
 * This file may be distributed under the terms of the License Agreement     *
5
 * provided with this software.                                              *
6
 *                                                                           *
7
 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE   *
8
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. *
9
 *****************************************************************************/
10
 
11
/*****************************************************************************
12
 *                           Preprocessor Definitions
13
 *                           ------------------------
14
 *
15
 * STARTUP_FROM_RESET
16
 *
17
 *   If defined, the program will startup from power-on/reset. If not defined
18
 *   the program will just loop endlessly from power-on/reset.
19
 *
20
 *   This definition is not defined by default on this target because the
21
 *   debugger is unable to reset this target and maintain control of it over the
22
 *   JTAG interface. The advantage of doing this is that it allows the debugger
23
 *   to reset the CPU and run programs from a known reset CPU state on each run.
24
 *   It also acts as a safety net if you accidently download a program in FLASH
25
 *   that crashes and prevents the debugger from taking control over JTAG
26
 *   rendering the target unusable over JTAG. The obvious disadvantage of doing
27
 *   this is that your application will not startup without the debugger.
28
 *
29
 *   We advise that on this target you keep STARTUP_FROM_RESET undefined whilst
30
 *   you are developing and only define STARTUP_FROM_RESET when development is
31
 *   complete.
32
 *
33
 *****************************************************************************/
34
 
35
.extern xPortPendSVHandler
36
.extern xPortSysTickHandler
37
.extern vPortSVCHandler
38
 
39
  .global reset_handler
40
 
41
  .section .vectors, "ax"
42
  .code 16
43
  .align 0
44
  .global _vectors
45
 
46
.macro DEFAULT_ISR_HANDLER name=
47
  .thumb_func
48
  .weak \name
49
\name:
50
1: b 1b /* endless loop */
51
.endm
52
 
53
_vectors:
54
  .word __stack_end__
55
#ifdef STARTUP_FROM_RESET
56
  .word reset_handler
57
#else
58
  .word reset_wait
59
#endif /* STARTUP_FROM_RESET */
60
  .word NMIException
61
  .word HardFaultException
62
  .word MemManageException
63
  .word BusFaultException
64
  .word UsageFaultException
65
  .word 0 // Reserved
66
  .word 0 // Reserved
67
  .word 0 // Reserved
68
  .word 0 // Reserved
69
  .word vPortSVCHandler
70
  .word DebugMonitor
71
  .word 0 // Reserved
72
  .word xPortPendSVHandler
73
  .word xPortSysTickHandler
74
  .word WWDG_IRQHandler
75
  .word PVD_IRQHandler
76
  .word TAMPER_IRQHandler
77
  .word RTC_IRQHandler
78
  .word FLASH_IRQHandler
79
  .word RCC_IRQHandler
80
  .word EXTI0_IRQHandler
81
  .word EXTI1_IRQHandler
82
  .word EXTI2_IRQHandler
83
  .word EXTI3_IRQHandler
84
  .word EXTI4_IRQHandler
85
  .word DMAChannel1_IRQHandler
86
  .word DMAChannel2_IRQHandler
87
  .word DMAChannel3_IRQHandler
88
  .word DMAChannel4_IRQHandler
89
  .word DMAChannel5_IRQHandler
90
  .word DMAChannel6_IRQHandler
91
  .word DMAChannel7_IRQHandler
92
  .word ADC_IRQHandler
93
  .word USB_HP_CAN_TX_IRQHandler
94
  .word USB_LP_CAN_RX0_IRQHandler
95
  .word CAN_RX1_IRQHandler
96
  .word CAN_SCE_IRQHandler
97
  .word EXTI9_5_IRQHandler
98
  .word TIM1_BRK_IRQHandler
99
  .word TIM1_UP_IRQHandler
100
  .word TIM1_TRG_COM_IRQHandler
101
  .word TIM1_CC_IRQHandler
102
  .word TIM2_IRQHandler
103
  .word TIM3_IRQHandler
104
  .word TIM4_IRQHandler
105
  .word I2C1_EV_IRQHandler
106
  .word I2C1_ER_IRQHandler
107
  .word I2C2_EV_IRQHandler
108
  .word I2C2_ER_IRQHandler
109
  .word SPI1_IRQHandler
110
  .word SPI2_IRQHandler
111
  .word USART1_IRQHandler
112
  .word USART2_IRQHandler
113
  .word USART3_IRQHandler
114
  .word EXTI15_10_IRQHandler
115
  .word RTCAlarm_IRQHandler
116
  .word USBWakeUp_IRQHandler
117
  .word TIM8_BRK_IRQHandler
118
  .word TIM8_UP_IRQHandler
119
  .word TIM8_TRG_COM_IRQHandler
120
  .word TIM8_CC_IRQHandler
121
  .word ADC3_IRQHandler
122
  .word FSMC_IRQHandler
123
  .word SDIO_IRQHandler
124
  .word TIM5_IRQHandler
125
  .word SPI3_IRQHandler
126
  .word UART4_IRQHandler
127
  .word UART5_IRQHandler
128
  .word TIM6_IRQHandler
129
  .word TIM7_IRQHandler
130
  .word DMA2_Channel1_IRQHandler
131
  .word DMA2_Channel2_IRQHandler
132
  .word DMA2_Channel3_IRQHandler
133
  .word DMA2_Channel4_5_IRQHandler
134
 
135
  .section .init, "ax"
136
  .thumb_func
137
 
138
  reset_handler:
139
#ifndef __FLASH_BUILD
140
  /* If this is a RAM build, configure vector table offset register to point
141
     to the RAM vector table. */
142
  ldr r0, =0xE000ED08
143
  ldr r1, =_vectors
144
  str r1, [r0]
145
#endif
146
  b _start
147
 
148
DEFAULT_ISR_HANDLER NMIException
149
DEFAULT_ISR_HANDLER HardFaultException
150
DEFAULT_ISR_HANDLER MemManageException
151
DEFAULT_ISR_HANDLER BusFaultException
152
DEFAULT_ISR_HANDLER UsageFaultException
153
DEFAULT_ISR_HANDLER SVCHandler
154
DEFAULT_ISR_HANDLER DebugMonitor
155
DEFAULT_ISR_HANDLER PendSV
156
DEFAULT_ISR_HANDLER SysTickHandler
157
DEFAULT_ISR_HANDLER WWDG_IRQHandler
158
DEFAULT_ISR_HANDLER PVD_IRQHandler
159
DEFAULT_ISR_HANDLER TAMPER_IRQHandler
160
DEFAULT_ISR_HANDLER RTC_IRQHandler
161
DEFAULT_ISR_HANDLER FLASH_IRQHandler
162
DEFAULT_ISR_HANDLER RCC_IRQHandler
163
DEFAULT_ISR_HANDLER EXTI0_IRQHandler
164
DEFAULT_ISR_HANDLER EXTI1_IRQHandler
165
DEFAULT_ISR_HANDLER EXTI2_IRQHandler
166
DEFAULT_ISR_HANDLER EXTI3_IRQHandler
167
DEFAULT_ISR_HANDLER EXTI4_IRQHandler
168
DEFAULT_ISR_HANDLER DMAChannel1_IRQHandler
169
DEFAULT_ISR_HANDLER DMAChannel2_IRQHandler
170
DEFAULT_ISR_HANDLER DMAChannel3_IRQHandler
171
DEFAULT_ISR_HANDLER DMAChannel4_IRQHandler
172
DEFAULT_ISR_HANDLER DMAChannel5_IRQHandler
173
DEFAULT_ISR_HANDLER DMAChannel6_IRQHandler
174
DEFAULT_ISR_HANDLER DMAChannel7_IRQHandler
175
DEFAULT_ISR_HANDLER ADC_IRQHandler
176
DEFAULT_ISR_HANDLER USB_HP_CAN_TX_IRQHandler
177
DEFAULT_ISR_HANDLER USB_LP_CAN_RX0_IRQHandler
178
DEFAULT_ISR_HANDLER CAN_RX1_IRQHandler
179
DEFAULT_ISR_HANDLER CAN_SCE_IRQHandler
180
DEFAULT_ISR_HANDLER EXTI9_5_IRQHandler
181
DEFAULT_ISR_HANDLER TIM1_BRK_IRQHandler
182
DEFAULT_ISR_HANDLER TIM1_UP_IRQHandler
183
DEFAULT_ISR_HANDLER TIM1_TRG_COM_IRQHandler
184
DEFAULT_ISR_HANDLER TIM1_CC_IRQHandler
185
DEFAULT_ISR_HANDLER TIM2_IRQHandler
186
DEFAULT_ISR_HANDLER TIM3_IRQHandler
187
DEFAULT_ISR_HANDLER TIM4_IRQHandler
188
DEFAULT_ISR_HANDLER I2C1_EV_IRQHandler
189
DEFAULT_ISR_HANDLER I2C1_ER_IRQHandler
190
DEFAULT_ISR_HANDLER I2C2_EV_IRQHandler
191
DEFAULT_ISR_HANDLER I2C2_ER_IRQHandler
192
DEFAULT_ISR_HANDLER SPI1_IRQHandler
193
DEFAULT_ISR_HANDLER SPI2_IRQHandler
194
DEFAULT_ISR_HANDLER USART1_IRQHandler
195
DEFAULT_ISR_HANDLER USART2_IRQHandler
196
DEFAULT_ISR_HANDLER USART3_IRQHandler
197
DEFAULT_ISR_HANDLER EXTI15_10_IRQHandler
198
DEFAULT_ISR_HANDLER RTCAlarm_IRQHandler
199
DEFAULT_ISR_HANDLER USBWakeUp_IRQHandler
200
DEFAULT_ISR_HANDLER TIM8_BRK_IRQHandler
201
DEFAULT_ISR_HANDLER TIM8_UP_IRQHandler
202
DEFAULT_ISR_HANDLER TIM8_TRG_COM_IRQHandler
203
DEFAULT_ISR_HANDLER TIM8_CC_IRQHandler
204
DEFAULT_ISR_HANDLER ADC3_IRQHandler
205
DEFAULT_ISR_HANDLER FSMC_IRQHandler
206
DEFAULT_ISR_HANDLER SDIO_IRQHandler
207
DEFAULT_ISR_HANDLER TIM5_IRQHandler
208
DEFAULT_ISR_HANDLER SPI3_IRQHandler
209
DEFAULT_ISR_HANDLER UART4_IRQHandler
210
DEFAULT_ISR_HANDLER UART5_IRQHandler
211
DEFAULT_ISR_HANDLER TIM6_IRQHandler
212
DEFAULT_ISR_HANDLER TIM7_IRQHandler
213
DEFAULT_ISR_HANDLER DMA2_Channel1_IRQHandler
214
DEFAULT_ISR_HANDLER DMA2_Channel2_IRQHandler
215
DEFAULT_ISR_HANDLER DMA2_Channel3_IRQHandler
216
DEFAULT_ISR_HANDLER DMA2_Channel4_5_IRQHandler
217
 
218
#ifndef STARTUP_FROM_RESET
219
DEFAULT_ISR_HANDLER reset_wait
220
#endif /* STARTUP_FROM_RESET */
221
 
222
  // STM32 library requires these
223
  .global __WFI
224
  .global __WFE
225
  .global __SEV
226
  .global __ISB
227
  .global __DSB
228
  .global __DMB
229
  .global __SVC
230
  .global __MRS_CONTROL
231
  .global __MSR_CONTROL
232
  .global __MRS_PSP
233
  .global __MSR_PSP
234
  .global __MRS_MSP
235
  .global __MSR_MSP
236
  .global __SETPRIMASK
237
  .global __RESETPRIMASK
238
  .global __SETFAULTMASK
239
  .global __RESETFAULTMASK
240
  .global __BASEPRICONFIG
241
  .global __GetBASEPRI
242
  .global __REV_HalfWord
243
  .global __REV_Word
244
 
245
.thumb_func
246
__WFI:
247
  wfi
248
  bx r14
249
.thumb_func
250
__WFE:
251
  wfe
252
  bx r14
253
.thumb_func
254
__SEV:
255
  sev
256
  bx r14
257
.thumb_func
258
__ISB:
259
  isb
260
  bx r14
261
.thumb_func
262
__DSB:
263
  dsb
264
  bx r14
265
.thumb_func
266
__DMB:
267
  dmb
268
  bx r14
269
.thumb_func
270
__SVC:
271
  svc 0x01
272
  bx r14
273
.thumb_func
274
__MRS_CONTROL:
275
  mrs r0, control
276
  bx r14
277
.thumb_func
278
__MSR_CONTROL:
279
  msr control, r0
280
  isb
281
  bx r14
282
.thumb_func
283
__MRS_PSP:
284
  mrs r0, psp
285
  bx r14
286
.thumb_func
287
__MSR_PSP:
288
  msr psp, r0
289
  bx r14
290
.thumb_func
291
__MRS_MSP:
292
  mrs r0, msp
293
  bx r14
294
.thumb_func
295
__MSR_MSP:
296
  msr msp, r0
297
  bx r14
298
.thumb_func
299
__SETPRIMASK:
300
  cpsid i
301
  bx r14
302
.thumb_func
303
__RESETPRIMASK:
304
  cpsie i
305
  bx r14
306
.thumb_func
307
__SETFAULTMASK:
308
  cpsid f
309
  bx r14
310
.thumb_func
311
__RESETFAULTMASK:
312
  cpsie f
313
  bx r14
314
.thumb_func
315
__BASEPRICONFIG:
316
  msr basepri, r0
317
  bx r14
318
.thumb_func
319
__GetBASEPRI:
320
  mrs r0, basepri_max
321
  bx r14
322
.thumb_func
323
__REV_HalfWord:
324
  rev16 r0, r0
325
  bx r14
326
.thumb_func
327
__REV_Word:
328
  rev r0, r0
329
  bx r14
330
 
331
 
332
 
333
 
334
 
335
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.