]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_LM3S811_KEIL/startup_rvmdk.S
Update the demo directory to use the version 8 type naming conventions.
[freertos] / FreeRTOS / Demo / CORTEX_LM3S811_KEIL / startup_rvmdk.S
1 ; <<< Use Configuration Wizard in Context Menu >>>\r
2 ;******************************************************************************\r
3 ;\r
4 ; startup_rvmdk.S - Startup code for Stellaris.\r
5 ;\r
6 ; Copyright (c) 2006 Luminary Micro, Inc.  All rights reserved.\r
7 ;\r
8 ; Software License Agreement\r
9 ;\r
10 ; Luminary Micro, Inc. (LMI) is supplying this software for use solely and\r
11 ; exclusively on LMI's Stellaris Family of microcontroller products.\r
12 ;\r
13 ; The software is owned by LMI and/or its suppliers, and is protected under\r
14 ; applicable copyright laws.  All rights are reserved.  Any use in violation of\r
15 ; the foregoing restrictions may subject the user to criminal sanctions under\r
16 ; applicable laws, as well as to civil liability for the breach of the terms\r
17 ; and conditions of this license.\r
18 ;\r
19 ; THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
20 ; OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
21 ; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
22 ; LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
23 ; CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
24 ;\r
25 ; This is part of revision 816 of the Stellaris Driver Library.\r
26 ;\r
27 ;******************************************************************************\r
28 \r
29 ;******************************************************************************\r
30 ;\r
31 ; <h> Stack Configuration\r
32 ;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>\r
33 ; </h>\r
34 ;\r
35 ;******************************************************************************\r
36 Stack   EQU     0x00000100\r
37 \r
38 ;******************************************************************************\r
39 ;\r
40 ; <h> Heap Configuration\r
41 ;   <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>\r
42 ; </h>\r
43 ;\r
44 ;******************************************************************************\r
45 Heap    EQU     0x00000000\r
46 \r
47 ;******************************************************************************\r
48 ;\r
49 ; Allocate space for the stack.\r
50 ;\r
51 ;******************************************************************************\r
52         AREA    STACK, NOINIT, READWRITE, ALIGN=3\r
53 StackMem\r
54         SPACE   Stack\r
55 \r
56 ;******************************************************************************\r
57 ;\r
58 ; Allocate space for the heap.\r
59 ;\r
60 ;******************************************************************************\r
61         AREA    HEAP, NOINIT, READWRITE, ALIGN=3\r
62 HeapMem\r
63         SPACE   Heap\r
64 \r
65 ;******************************************************************************\r
66 ;\r
67 ; Indicate that the code in this file preserves 8-byte alignment of the stack.\r
68 ;\r
69 ;******************************************************************************\r
70         PRESERVE8\r
71 \r
72 ;******************************************************************************\r
73 ;\r
74 ; Place code into the reset code section.\r
75 ;\r
76 ;******************************************************************************\r
77         AREA    RESET, CODE, READONLY\r
78         THUMB\r
79 \r
80 ;******************************************************************************\r
81 ;\r
82 ; The vector table.\r
83 ;\r
84 ;******************************************************************************\r
85                 EXPORT __Vectors\r
86 __Vectors\r
87         DCD     StackMem + Stack            ; Top of Stack\r
88         DCD     Reset_Handler               ; Reset Handler\r
89         DCD     NmiSR                       ; NMI Handler\r
90         DCD     FaultISR                    ; Hard Fault Handler\r
91         DCD     IntDefaultHandler           ; MPU Fault Handler\r
92         DCD     IntDefaultHandler           ; Bus Fault Handler\r
93         DCD     IntDefaultHandler           ; Usage Fault Handler\r
94         DCD     0                           ; Reserved\r
95         DCD     0                           ; Reserved\r
96         DCD     0                           ; Reserved\r
97         DCD     0                           ; Reserved\r
98         DCD     vPortSVCHandler             ; SVCall Handler\r
99         DCD     IntDefaultHandler           ; Debug Monitor Handler\r
100         DCD     0                           ; Reserved\r
101         DCD     xPortPendSVHandler              ; PendSV Handler\r
102         DCD     xPortSysTickHandler             ; SysTick Handler\r
103         DCD     IntDefaultHandler           ; GPIO Port A\r
104         DCD     IntDefaultHandler           ; GPIO Port B\r
105         DCD     vGPIO_ISR               ; GPIO Port C\r
106         DCD     IntDefaultHandler           ; GPIO Port D\r
107         DCD     IntDefaultHandler           ; GPIO Port E\r
108         DCD     vUART_ISR                       ; UART0\r
109         DCD     IntDefaultHandler           ; UART1\r
110         DCD     IntDefaultHandler           ; SSI\r
111         DCD     IntDefaultHandler           ; I2C\r
112         DCD     IntDefaultHandler           ; PWM Fault\r
113         DCD     IntDefaultHandler           ; PWM Generator 0\r
114         DCD     IntDefaultHandler           ; PWM Generator 1\r
115         DCD     IntDefaultHandler           ; PWM Generator 2\r
116         DCD     IntDefaultHandler           ; Quadrature Encoder\r
117         DCD     IntDefaultHandler           ; ADC Sequence 0\r
118         DCD     IntDefaultHandler           ; ADC Sequence 1\r
119         DCD     IntDefaultHandler           ; ADC Sequence 2\r
120         DCD     IntDefaultHandler           ; ADC Sequence 3\r
121         DCD     IntDefaultHandler           ; Watchdog\r
122         DCD     IntDefaultHandler           ; Timer 0A\r
123         DCD     IntDefaultHandler           ; Timer 0B\r
124         DCD     IntDefaultHandler           ; Timer 1A\r
125         DCD     IntDefaultHandler           ; Timer 1B\r
126         DCD     IntDefaultHandler           ; Timer 2A\r
127         DCD     IntDefaultHandler           ; Timer 2B\r
128         DCD     IntDefaultHandler           ; Comp 0\r
129         DCD     IntDefaultHandler           ; Comp 1\r
130         DCD     IntDefaultHandler           ; Comp 2\r
131         DCD     IntDefaultHandler           ; System Control\r
132         DCD     IntDefaultHandler           ; Flash Control\r
133 \r
134 ;******************************************************************************\r
135 ;\r
136 ; This is the code that gets called when the processor first starts execution\r
137 ; following a reset event.\r
138 ;\r
139 ;******************************************************************************\r
140         EXPORT  Reset_Handler\r
141 Reset_Handler\r
142         ;\r
143         ; Call __main() in the C library, which will call the application\r
144         ; supplied main().\r
145         ;\r
146         IMPORT  __main\r
147                 IMPORT  vGPIO_ISR\r
148                 IMPORT  vUART_ISR\r
149                 IMPORT  xPortPendSVHandler\r
150                 IMPORT  xPortSysTickHandler\r
151                 IMPORT  vPortSVCHandler\r
152 \r
153         LDR     R0, =__main\r
154         BX      R0\r
155 \r
156 ;******************************************************************************\r
157 ;\r
158 ; This is the code that gets called when the processor receives a NMI.  This\r
159 ; simply enters an infinite loop, preserving the system state for examination\r
160 ; by a debugger.\r
161 ;\r
162 ;******************************************************************************\r
163 NmiSR\r
164         B       NmiSR\r
165 \r
166 ;******************************************************************************\r
167 ;\r
168 ; This is the code that gets called when the processor receives a fault\r
169 ; interrupt.  This simply enters an infinite loop, preserving the system state\r
170 ; for examination by a debugger.\r
171 ;\r
172 ;******************************************************************************\r
173 FaultISR\r
174         B       FaultISR\r
175 \r
176 ;******************************************************************************\r
177 ;\r
178 ; This is the code that gets called when the processor receives an unexpected\r
179 ; interrupt.  This simply enters an infinite loop, preserving the system state\r
180 ; for examination by a debugger.\r
181 ;\r
182 ;******************************************************************************\r
183 IntDefaultHandler\r
184         B       IntDefaultHandler\r
185 \r
186 ;******************************************************************************\r
187 ;\r
188 ; Make sure the end of this section is aligned.\r
189 ;\r
190 ;******************************************************************************\r
191         ALIGN\r
192 \r
193 ;******************************************************************************\r
194 ;\r
195 ; Some code in the normal code section for initializing the heap and stack.\r
196 ;\r
197 ;******************************************************************************\r
198         AREA    |.text|, CODE, READONLY\r
199 \r
200 ;******************************************************************************\r
201 ;\r
202 ; The function expected of the C library startup code for defining the stack\r
203 ; and heap memory locations.\r
204 ;\r
205 ;******************************************************************************\r
206         IMPORT  __use_two_region_memory\r
207         EXPORT  __user_initial_stackheap\r
208 __user_initial_stackheap\r
209         LDR     R0, =HeapMem\r
210         LDR     R1, =(StackMem + Stack)\r
211         LDR     R2, =(HeapMem + Heap)\r
212         LDR     R3, =StackMem\r
213         BX      LR\r
214 \r
215 ;******************************************************************************\r
216 ;\r
217 ; Make sure the end of this section is aligned.\r
218 ;\r
219 ;******************************************************************************\r
220         ALIGN\r
221 \r
222 ; Note: \r
223 ; Using READWRITE places Section .RTOSHeap in Region ER_RW.\r
224 ; Using NOINIT places Section .RTOSHeap in Region ER_ZI,which means\r
225 ; "ZEROINITIALIZE" (sic), and which is the last region in memory. Then\r
226 ; we need to make this section the last section, which is somewhat tricky,\r
227 ; because we cannot use the sectionname, but need to use a defined symbol:\r
228 ; Linker option: "--last xHeap"\r
229 \r
230                 EXPORT xHeap\r
231 \r
232                 AREA    RTOSHeap, DATA, NOINIT\r
233 xHeap\r
234 \r
235 ;******************************************************************************\r
236 ;\r
237 ; Tell the assembler that we're done.\r
238 ;\r
239 ;******************************************************************************\r
240         END\r