Subversion Repositories DashDisplay

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/**
5 mjames 2
  *************** (C) COPYRIGHT 2016 STMicroelectronics ************************
2 mjames 3
  * @file      startup_stm32f101xg.s
4
  * @author    MCD Application Team
5 mjames 5
  * @version   V4.1.0
6
  * @date      29-April-2016
2 mjames 7
  * @brief     STM32F101xG Devices vector table for Atollic toolchain.
8
  *            This module performs:
9
  *                - Set the initial SP
10
  *                - Set the initial PC == Reset_Handler,
11
  *                - Set the vector table entries with the exceptions ISR address
12
  *                - Configure the clock system   
13
  *                - Branches to main in the C library (which eventually
14
  *                  calls main()).
15
  *            After Reset the Cortex-M3 processor is in Thread mode,
16
  *            priority is Privileged, and the Stack is set to Main.
17
  ******************************************************************************
18
  *
5 mjames 19
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
2 mjames 20
  *
21
  * Redistribution and use in source and binary forms, with or without modification,
22
  * are permitted provided that the following conditions are met:
23
  *   1. Redistributions of source code must retain the above copyright notice,
24
  *      this list of conditions and the following disclaimer.
25
  *   2. Redistributions in binary form must reproduce the above copyright notice,
26
  *      this list of conditions and the following disclaimer in the documentation
27
  *      and/or other materials provided with the distribution.
28
  *   3. Neither the name of STMicroelectronics nor the names of its contributors
29
  *      may be used to endorse or promote products derived from this software
30
  *      without specific prior written permission.
31
  *
32
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35
  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
38
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
39
  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
40
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
  *
43
  ******************************************************************************
44
  */
45
 
46
  .syntax unified
47
  .cpu cortex-m3
48
  .fpu softvfp
49
  .thumb
50
 
51
.global g_pfnVectors
52
.global Default_Handler
53
 
54
/* start address for the initialization values of the .data section.
55
defined in linker script */
56
.word _sidata
57
/* start address for the .data section. defined in linker script */
58
.word _sdata
59
/* end address for the .data section. defined in linker script */
60
.word _edata
61
/* start address for the .bss section. defined in linker script */
62
.word _sbss
63
/* end address for the .bss section. defined in linker script */
64
.word _ebss
65
 
66
.equ  BootRAM,        0xF1E0F85F
67
/**
68
 * @brief  This is the code that gets called when the processor first
69
 *          starts execution following a reset event. Only the absolutely
70
 *          necessary set is performed, after which the application
71
 *          supplied main() routine is called.
72
 * @param  None
73
 * @retval : None
74
*/
75
 
76
  .section .text.Reset_Handler
77
  .weak Reset_Handler
78
  .type Reset_Handler, %function
79
Reset_Handler:
80
 
81
/* Copy the data segment initializers from flash to SRAM */
82
  movs r1, #0
83
  b LoopCopyDataInit
84
 
85
CopyDataInit:
86
  ldr r3, =_sidata
87
  ldr r3, [r3, r1]
88
  str r3, [r0, r1]
89
  adds r1, r1, #4
90
 
91
LoopCopyDataInit:
92
  ldr r0, =_sdata
93
  ldr r3, =_edata
94
  adds r2, r0, r1
95
  cmp r2, r3
96
  bcc CopyDataInit
97
  ldr r2, =_sbss
98
  b LoopFillZerobss
99
/* Zero fill the bss segment. */
100
FillZerobss:
101
  movs r3, #0
102
  str r3, [r2], #4
103
 
104
LoopFillZerobss:
105
  ldr r3, = _ebss
106
  cmp r2, r3
107
  bcc FillZerobss
108
 
109
/* Call the clock system intitialization function.*/
110
    bl  SystemInit
111
/* Call static constructors */
112
    bl __libc_init_array
113
/* Call the application's entry point.*/
114
  bl main
115
  bx lr
116
.size Reset_Handler, .-Reset_Handler
117
 
118
/**
119
 * @brief  This is the code that gets called when the processor receives an
120
 *         unexpected interrupt.  This simply enters an infinite loop, preserving
121
 *         the system state for examination by a debugger.
122
 * @param  None
123
 * @retval None       
124
*/
125
    .section .text.Default_Handler,"ax",%progbits
126
Default_Handler:
127
Infinite_Loop:
128
  b Infinite_Loop
129
  .size Default_Handler, .-Default_Handler
130
/******************************************************************************
131
*
132
* The minimal vector table for a Cortex M3.  Note that the proper constructs
133
* must be placed on this to ensure that it ends up at physical address
134
* 0x0000.0000.
135
*
136
******************************************************************************/
137
  .section .isr_vector,"a",%progbits
138
  .type g_pfnVectors, %object
139
  .size g_pfnVectors, .-g_pfnVectors
140
 
141
 
142
g_pfnVectors:
143
 
144
  .word  _estack
145
  .word  Reset_Handler
146
  .word  NMI_Handler
147
  .word  HardFault_Handler
148
  .word  MemManage_Handler
149
  .word  BusFault_Handler
150
  .word  UsageFault_Handler
151
  .word  0
152
  .word  0
153
  .word  0
154
  .word  0
155
  .word  SVC_Handler
156
  .word  DebugMon_Handler
157
  .word  0
158
  .word  PendSV_Handler
159
  .word  SysTick_Handler
160
  .word  WWDG_IRQHandler
161
  .word  PVD_IRQHandler
162
  .word  TAMPER_IRQHandler
163
  .word  RTC_IRQHandler
164
  .word  FLASH_IRQHandler
165
  .word  RCC_IRQHandler
166
  .word  EXTI0_IRQHandler
167
  .word  EXTI1_IRQHandler
168
  .word  EXTI2_IRQHandler
169
  .word  EXTI3_IRQHandler
170
  .word  EXTI4_IRQHandler
171
  .word  DMA1_Channel1_IRQHandler
172
  .word  DMA1_Channel2_IRQHandler
173
  .word  DMA1_Channel3_IRQHandler
174
  .word  DMA1_Channel4_IRQHandler
175
  .word  DMA1_Channel5_IRQHandler
176
  .word  DMA1_Channel6_IRQHandler
177
  .word  DMA1_Channel7_IRQHandler
178
  .word  ADC1_2_IRQHandler
179
  .word  0
180
  .word  0
181
  .word  0
182
  .word  0
183
  .word  EXTI9_5_IRQHandler
184
  .word  TIM9_IRQHandler
185
  .word  TIM10_IRQHandler
186
  .word  TIM11_IRQHandler
187
  .word  0
188
  .word  TIM2_IRQHandler
189
  .word  TIM3_IRQHandler
190
  .word  TIM4_IRQHandler
191
  .word  I2C1_EV_IRQHandler
192
  .word  I2C1_ER_IRQHandler
193
  .word  I2C2_EV_IRQHandler
194
  .word  I2C2_ER_IRQHandler
195
  .word  SPI1_IRQHandler
196
  .word  SPI2_IRQHandler
197
  .word  USART1_IRQHandler
198
  .word  USART2_IRQHandler
199
  .word  USART3_IRQHandler
200
  .word  EXTI15_10_IRQHandler
201
  .word  RTC_Alarm_IRQHandler
202
  .word 0
203
  .word TIM12_IRQHandler
204
  .word TIM13_IRQHandler
205
  .word TIM14_IRQHandler
206
  .word 0
207
  .word 0
208
  .word  FSMC_IRQHandler
209
  .word 0
210
  .word  TIM5_IRQHandler
211
  .word  SPI3_IRQHandler
212
  .word  UART4_IRQHandler
213
  .word  UART5_IRQHandler
214
  .word  TIM6_IRQHandler
215
  .word  TIM7_IRQHandler
216
  .word  DMA2_Channel1_IRQHandler
217
  .word  DMA2_Channel2_IRQHandler
218
  .word  DMA2_Channel3_IRQHandler
219
  .word  DMA2_Channel4_5_IRQHandler
220
  .word  0
221
  .word  0
222
  .word  0
223
  .word  0
224
  .word  0
225
  .word  0
226
  .word  0
227
  .word  0
228
  .word  0
229
  .word  0
230
  .word  0
231
  .word  0
232
  .word  0
233
  .word  0
234
  .word  0
235
  .word  0
236
  .word  0
237
  .word  0
238
  .word  0
239
  .word  0
240
  .word  0
241
  .word  0
242
  .word  0
243
  .word  0
244
  .word  0
245
  .word  0
246
  .word  0
247
  .word  0
248
  .word  0
249
  .word  0
250
  .word  0
251
  .word  0
252
  .word  0
253
  .word  0
254
  .word  0
255
  .word  0
256
  .word  0
257
  .word  0
258
  .word  0
259
  .word  0
260
  .word  0
261
  .word  0
262
  .word  0
263
  .word  0
264
  .word  BootRAM       /* @0x1E0. This is for boot in RAM mode for 
265
                         STM32F10x XL-Density devices. */
266
/*******************************************************************************
267
*
268
* Provide weak aliases for each Exception handler to the Default_Handler. 
269
* As they are weak aliases, any function with the same name will override 
270
* this definition.
271
* 
272
*******************************************************************************/
273
 
274
  .weak  NMI_Handler
275
  .thumb_set NMI_Handler,Default_Handler
276
 
277
  .weak  HardFault_Handler
278
  .thumb_set HardFault_Handler,Default_Handler
279
 
280
  .weak  MemManage_Handler
281
  .thumb_set MemManage_Handler,Default_Handler
282
 
283
  .weak  BusFault_Handler
284
  .thumb_set BusFault_Handler,Default_Handler
285
 
286
  .weak  UsageFault_Handler
287
  .thumb_set UsageFault_Handler,Default_Handler
288
 
289
  .weak  SVC_Handler
290
  .thumb_set SVC_Handler,Default_Handler
291
 
292
  .weak  DebugMon_Handler
293
  .thumb_set DebugMon_Handler,Default_Handler
294
 
295
  .weak  PendSV_Handler
296
  .thumb_set PendSV_Handler,Default_Handler
297
 
298
  .weak  SysTick_Handler
299
  .thumb_set SysTick_Handler,Default_Handler
300
 
301
  .weak  WWDG_IRQHandler
302
  .thumb_set WWDG_IRQHandler,Default_Handler
303
 
304
  .weak  PVD_IRQHandler
305
  .thumb_set PVD_IRQHandler,Default_Handler
306
 
307
  .weak  TAMPER_IRQHandler
308
  .thumb_set TAMPER_IRQHandler,Default_Handler
309
 
310
  .weak  RTC_IRQHandler
311
  .thumb_set RTC_IRQHandler,Default_Handler
312
 
313
  .weak  FLASH_IRQHandler
314
  .thumb_set FLASH_IRQHandler,Default_Handler
315
 
316
  .weak  RCC_IRQHandler
317
  .thumb_set RCC_IRQHandler,Default_Handler
318
 
319
  .weak  EXTI0_IRQHandler
320
  .thumb_set EXTI0_IRQHandler,Default_Handler
321
 
322
  .weak  EXTI1_IRQHandler
323
  .thumb_set EXTI1_IRQHandler,Default_Handler
324
 
325
  .weak  EXTI2_IRQHandler
326
  .thumb_set EXTI2_IRQHandler,Default_Handler
327
 
328
  .weak  EXTI3_IRQHandler
329
  .thumb_set EXTI3_IRQHandler,Default_Handler
330
 
331
  .weak  EXTI4_IRQHandler
332
  .thumb_set EXTI4_IRQHandler,Default_Handler
333
 
334
  .weak  DMA1_Channel1_IRQHandler
335
  .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
336
 
337
  .weak  DMA1_Channel2_IRQHandler
338
  .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
339
 
340
  .weak  DMA1_Channel3_IRQHandler
341
  .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
342
 
343
  .weak  DMA1_Channel4_IRQHandler
344
  .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
345
 
346
  .weak  DMA1_Channel5_IRQHandler
347
  .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
348
 
349
  .weak  DMA1_Channel6_IRQHandler
350
  .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
351
 
352
  .weak  DMA1_Channel7_IRQHandler
353
  .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
354
 
355
  .weak  ADC1_2_IRQHandler
356
  .thumb_set ADC1_2_IRQHandler,Default_Handler
357
 
358
  .weak  EXTI9_5_IRQHandler
359
  .thumb_set EXTI9_5_IRQHandler,Default_Handler
360
 
361
  .weak  TIM9_IRQHandler
362
  .thumb_set TIM9_IRQHandler,Default_Handler
363
 
364
  .weak  TIM10_IRQHandler
365
  .thumb_set TIM10_IRQHandler,Default_Handler
366
 
367
  .weak  TIM11_IRQHandler
368
  .thumb_set TIM11_IRQHandler,Default_Handler
369
 
370
  .weak  TIM2_IRQHandler
371
  .thumb_set TIM2_IRQHandler,Default_Handler
372
 
373
  .weak  TIM3_IRQHandler
374
  .thumb_set TIM3_IRQHandler,Default_Handler
375
 
376
  .weak  TIM4_IRQHandler
377
  .thumb_set TIM4_IRQHandler,Default_Handler
378
 
379
  .weak  I2C1_EV_IRQHandler
380
  .thumb_set I2C1_EV_IRQHandler,Default_Handler
381
 
382
  .weak  I2C1_ER_IRQHandler
383
  .thumb_set I2C1_ER_IRQHandler,Default_Handler
384
 
385
  .weak  I2C2_EV_IRQHandler
386
  .thumb_set I2C2_EV_IRQHandler,Default_Handler
387
 
388
  .weak  I2C2_ER_IRQHandler
389
  .thumb_set I2C2_ER_IRQHandler,Default_Handler
390
 
391
  .weak  SPI1_IRQHandler
392
  .thumb_set SPI1_IRQHandler,Default_Handler
393
 
394
  .weak  SPI2_IRQHandler
395
  .thumb_set SPI2_IRQHandler,Default_Handler
396
 
397
  .weak  USART1_IRQHandler
398
  .thumb_set USART1_IRQHandler,Default_Handler
399
 
400
  .weak  USART2_IRQHandler
401
  .thumb_set USART2_IRQHandler,Default_Handler
402
 
403
  .weak  USART3_IRQHandler
404
  .thumb_set USART3_IRQHandler,Default_Handler
405
 
406
  .weak  EXTI15_10_IRQHandler
407
  .thumb_set EXTI15_10_IRQHandler,Default_Handler
408
 
409
  .weak  RTC_Alarm_IRQHandler
410
  .thumb_set RTC_Alarm_IRQHandler,Default_Handler
411
 
412
  .weak  TIM12_IRQHandler
413
  .thumb_set TIM12_IRQHandler,Default_Handler
414
 
415
  .weak  TIM13_IRQHandler
416
  .thumb_set TIM13_IRQHandler,Default_Handler
417
 
418
  .weak  TIM14_IRQHandler
419
  .thumb_set TIM14_IRQHandler,Default_Handler
420
 
421
  .weak  FSMC_IRQHandler
422
  .thumb_set FSMC_IRQHandler,Default_Handler
423
 
424
  .weak  TIM5_IRQHandler
425
  .thumb_set TIM5_IRQHandler,Default_Handler
426
 
427
  .weak  SPI3_IRQHandler
428
  .thumb_set SPI3_IRQHandler,Default_Handler
429
 
430
  .weak  UART4_IRQHandler
431
  .thumb_set UART4_IRQHandler,Default_Handler
432
 
433
  .weak  UART5_IRQHandler
434
  .thumb_set UART5_IRQHandler,Default_Handler
435
 
436
  .weak  TIM6_IRQHandler
437
  .thumb_set TIM6_IRQHandler,Default_Handler
438
 
439
  .weak  TIM7_IRQHandler
440
  .thumb_set TIM7_IRQHandler,Default_Handler
441
 
442
  .weak  DMA2_Channel1_IRQHandler
443
  .thumb_set DMA2_Channel1_IRQHandler,Default_Handler
444
 
445
  .weak  DMA2_Channel2_IRQHandler
446
  .thumb_set DMA2_Channel2_IRQHandler,Default_Handler
447
 
448
  .weak  DMA2_Channel3_IRQHandler
449
  .thumb_set DMA2_Channel3_IRQHandler,Default_Handler
450
 
451
  .weak  DMA2_Channel4_5_IRQHandler
452
  .thumb_set DMA2_Channel4_5_IRQHandler,Default_Handler
453
 
454
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/