CMSIS2000  0.0.7
 Указатель Структуры данных Файлы Функции Переменные Определения типов Перечисления Элементы перечислений Макросы Группы Страницы
startup_ARMCM4.s
См. документацию.
1 /**************************************************************************//**
2  * @file startup_ARMCM4.s
3  * @brief CMSIS Core Device Startup File for
4  * ARMCM4 Device Series
5  * @version V1.07
6  * @date 30. January 2012
7  *
8  * @note Version CodeSourcery Sourcery G++ Lite (with CS3)
9  * Copyright (C) 2012 ARM Limited. All rights reserved.
10  *
11  * @par
12  * ARM Limited (ARM) is supplying this software for use with Cortex-M
13  * processor based microcontrollers. This file can be freely distributed
14  * within development tools that are supporting such ARM based processors.
15  *
16  * @par
17  * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
18  * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
19  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
20  * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
21  * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
22  *
23  ******************************************************************************/
24 /*
25 //-------- <<< Use Configuration Wizard in Context Menu >>> ------------------
26 */
27 
28 
29 /*
30 // <h> Stack Configuration
31 // <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
32 // </h>
33 */
34 
35  .equ Stack_Size, 0x00000400
36  .section ".stack", "w"
37  .align 3
38  .globl __cs3_stack_mem
39  .globl __cs3_stack_size
41  .if Stack_Size
42  .space Stack_Size
43  .endif
46 
47 
48 /*
49 // <h> Heap Configuration
50 // <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
51 // </h>
52 */
53 
54  .equ Heap_Size, 0x00000C00
55 
56  .section ".heap", "w"
57  .align 3
58  .globl __cs3_heap_start
59  .globl __cs3_heap_end
61  .if Heap_Size
62  .space Heap_Size
63  .endif
64 __cs3_heap_end:
65 
66 
67 /* Vector Table */
68 
69  .section ".cs3.interrupt_vector"
71  .type __cs3_interrupt_vector_cortex_m, %object
72 
74  .long __cs3_stack /* Top of Stack */
75  .long __cs3_reset /* Reset Handler */
76  .long NMI_Handler /* NMI Handler */
77  .long HardFault_Handler /* Hard Fault Handler */
78  .long MemManage_Handler /* MPU Fault Handler */
79  .long BusFault_Handler /* Bus Fault Handler */
80  .long UsageFault_Handler /* Usage Fault Handler */
81  .long 0 /* Reserved */
82  .long 0 /* Reserved */
83  .long 0 /* Reserved */
84  .long 0 /* Reserved */
85  .long SVC_Handler /* SVCall Handler */
86  .long DebugMon_Handler /* Debug Monitor Handler */
87  .long 0 /* Reserved */
88  .long PendSV_Handler /* PendSV Handler */
89  .long SysTick_Handler /* SysTick Handler */
90 
91  /* External Interrupts */
92  .long WDT_IRQHandler /* 0: Watchdog Timer */
93  .long RTC_IRQHandler /* 1: Real Time Clock */
94  .long TIM0_IRQHandler /* 2: Timer0 / Timer1 */
95  .long TIM2_IRQHandler /* 3: Timer2 / Timer3 */
96  .long MCIA_IRQHandler /* 4: MCIa */
97  .long MCIB_IRQHandler /* 5: MCIb */
98  .long UART0_IRQHandler /* 6: UART0 - DUT FPGA */
99  .long UART1_IRQHandler /* 7: UART1 - DUT FPGA */
100  .long UART2_IRQHandler /* 8: UART2 - DUT FPGA */
101  .long UART4_IRQHandler /* 9: UART4 - not connected */
102  .long AACI_IRQHandler /* 10: AACI / AC97 */
103  .long CLCD_IRQHandler /* 11: CLCD Combined Interrupt */
104  .long ENET_IRQHandler /* 12: Ethernet */
105  .long USBDC_IRQHandler /* 13: USB Device */
106  .long USBHC_IRQHandler /* 14: USB Host Controller */
107  .long CHLCD_IRQHandler /* 15: Character LCD */
108  .long FLEXRAY_IRQHandler /* 16: Flexray */
109  .long CAN_IRQHandler /* 17: CAN */
110  .long LIN_IRQHandler /* 18: LIN */
111  .long I2C_IRQHandler /* 19: I2C ADC/DAC */
112  .long 0 /* 20: Reserved */
113  .long 0 /* 21: Reserved */
114  .long 0 /* 22: Reserved */
115  .long 0 /* 23: Reserved */
116  .long 0 /* 24: Reserved */
117  .long 0 /* 25: Reserved */
118  .long 0 /* 26: Reserved */
119  .long 0 /* 27: Reserved */
120  .long CPU_CLCD_IRQHandler /* 28: Reserved - CPU FPGA CLCD */
121  .long 0 /* 29: Reserved - CPU FPGA */
122  .long UART3_IRQHandler /* 30: UART3 - CPU FPGA */
123  .long SPI_IRQHandler /* 31: SPI Touchscreen - CPU FPGA */
124 
126 
127 
128  .thumb
129 
130 
131 /* Reset Handler */
132 
133  .section .cs3.reset,"x",%progbits
134  .thumb_func
135  .globl __cs3_reset_cortex_m
136  .type __cs3_reset_cortex_m, %function
138  .fnstart
139  LDR R0, =SystemInit
140  BLX R0
141  LDR R0,=_start
142  BX R0
143  .pool
144  .cantunwind
145  .fnend
147 
148  .section ".text"
149 
150 /* Exception Handlers */
151 
152  .weak NMI_Handler
153  .type NMI_Handler, %function
155  B .
156  .size NMI_Handler, . - NMI_Handler
157 
158  .weak HardFault_Handler
159  .type HardFault_Handler, %function
161  B .
163 
164  .weak MemManage_Handler
165  .type MemManage_Handler, %function
167  B .
169 
170  .weak BusFault_Handler
171  .type BusFault_Handler, %function
173  B .
175 
176  .weak UsageFault_Handler
177  .type UsageFault_Handler, %function
179  B .
181 
182  .weak SVC_Handler
183  .type SVC_Handler, %function
185  B .
186  .size SVC_Handler, . - SVC_Handler
187 
188  .weak DebugMon_Handler
189  .type DebugMon_Handler, %function
191  B .
193 
194  .weak PendSV_Handler
195  .type PendSV_Handler, %function
197  B .
198  .size PendSV_Handler, . - PendSV_Handler
199 
200  .weak SysTick_Handler
201  .type SysTick_Handler, %function
203  B .
205 
206 
207 /* IRQ Handlers */
208 
209  .globl Default_Handler
210  .type Default_Handler, %function
212  B .
214 
215  .macro def_irq_handler handler
216  .weak \handler
217  .set \handler, Default_Handler
218  .endm
219 
220  def_irq_handler WDT_IRQHandler
221  def_irq_handler RTC_IRQHandler
222  def_irq_handler TIM0_IRQHandler
223  def_irq_handler TIM2_IRQHandler
224  def_irq_handler MCIA_IRQHandler
225  def_irq_handler MCIB_IRQHandler
226  def_irq_handler UART0_IRQHandler
227  def_irq_handler UART1_IRQHandler
228  def_irq_handler UART2_IRQHandler
229  def_irq_handler UART3_IRQHandler
230  def_irq_handler UART4_IRQHandler
231  def_irq_handler AACI_IRQHandler
232  def_irq_handler CLCD_IRQHandler
233  def_irq_handler ENET_IRQHandler
234  def_irq_handler USBDC_IRQHandler
235  def_irq_handler USBHC_IRQHandler
236  def_irq_handler CHLCD_IRQHandler
237  def_irq_handler FLEXRAY_IRQHandler
238  def_irq_handler CAN_IRQHandler
239  def_irq_handler LIN_IRQHandler
240  def_irq_handler I2C_IRQHandler
241  def_irq_handler CPU_CLCD_IRQHandler
242  def_irq_handler SPI_IRQHandler
243 
244  .end