1 ; <<< Use Configuration Wizard in Context Menu >>>
\r
2 ;******************************************************************************
\r
4 ; startup_rvmdk.S - Startup code for Stellaris.
\r
6 ; Copyright (c) 2006 Luminary Micro, Inc. All rights reserved.
\r
8 ; Software License Agreement
\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
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
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
25 ; This is part of revision 816 of the Stellaris Driver Library.
\r
27 ;******************************************************************************
\r
29 ;******************************************************************************
\r
31 ; <h> Stack Configuration
\r
32 ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
\r
35 ;******************************************************************************
\r
36 Stack EQU 0x00000100
\r
38 ;******************************************************************************
\r
40 ; <h> Heap Configuration
\r
41 ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
\r
44 ;******************************************************************************
\r
47 ;******************************************************************************
\r
49 ; Allocate space for the stack.
\r
51 ;******************************************************************************
\r
52 AREA STACK, NOINIT, READWRITE, ALIGN=3
\r
56 ;******************************************************************************
\r
58 ; Allocate space for the heap.
\r
60 ;******************************************************************************
\r
61 AREA HEAP, NOINIT, READWRITE, ALIGN=3
\r
65 ;******************************************************************************
\r
67 ; Indicate that the code in this file preserves 8-byte alignment of the stack.
\r
69 ;******************************************************************************
\r
72 ;******************************************************************************
\r
74 ; Place code into the reset code section.
\r
76 ;******************************************************************************
\r
77 AREA RESET, CODE, READONLY
\r
80 ;******************************************************************************
\r
84 ;******************************************************************************
\r
86 DCD StackMem + Stack ; Top of Stack
\r
87 DCD Reset_Handler ; Reset Handler
\r
88 DCD NmiSR ; NMI Handler
\r
89 DCD FaultISR ; Hard Fault Handler
\r
90 DCD IntDefaultHandler ; MPU Fault Handler
\r
91 DCD IntDefaultHandler ; Bus Fault Handler
\r
92 DCD IntDefaultHandler ; Usage Fault Handler
\r
97 DCD IntDefaultHandler ; SVCall Handler
\r
98 DCD IntDefaultHandler ; Debug Monitor Handler
\r
100 DCD xPortPendSVHandler ; PendSV Handler
\r
101 DCD xPortSysTickHandler ; SysTick Handler
\r
102 DCD IntDefaultHandler ; GPIO Port A
\r
103 DCD IntDefaultHandler ; GPIO Port B
\r
104 DCD vGPIO_ISR ; GPIO Port C
\r
105 DCD IntDefaultHandler ; GPIO Port D
\r
106 DCD IntDefaultHandler ; GPIO Port E
\r
107 DCD vUART_ISR ; UART0
\r
108 DCD IntDefaultHandler ; UART1
\r
109 DCD IntDefaultHandler ; SSI
\r
110 DCD IntDefaultHandler ; I2C
\r
111 DCD IntDefaultHandler ; PWM Fault
\r
112 DCD IntDefaultHandler ; PWM Generator 0
\r
113 DCD IntDefaultHandler ; PWM Generator 1
\r
114 DCD IntDefaultHandler ; PWM Generator 2
\r
115 DCD IntDefaultHandler ; Quadrature Encoder
\r
116 DCD IntDefaultHandler ; ADC Sequence 0
\r
117 DCD IntDefaultHandler ; ADC Sequence 1
\r
118 DCD IntDefaultHandler ; ADC Sequence 2
\r
119 DCD IntDefaultHandler ; ADC Sequence 3
\r
120 DCD IntDefaultHandler ; Watchdog
\r
121 DCD IntDefaultHandler ; Timer 0A
\r
122 DCD IntDefaultHandler ; Timer 0B
\r
123 DCD IntDefaultHandler ; Timer 1A
\r
124 DCD IntDefaultHandler ; Timer 1B
\r
125 DCD IntDefaultHandler ; Timer 2A
\r
126 DCD IntDefaultHandler ; Timer 2B
\r
127 DCD IntDefaultHandler ; Comp 0
\r
128 DCD IntDefaultHandler ; Comp 1
\r
129 DCD IntDefaultHandler ; Comp 2
\r
130 DCD IntDefaultHandler ; System Control
\r
131 DCD IntDefaultHandler ; Flash Control
\r
133 ;******************************************************************************
\r
135 ; This is the code that gets called when the processor first starts execution
\r
136 ; following a reset event.
\r
138 ;******************************************************************************
\r
139 EXPORT Reset_Handler
\r
142 ; Call __main() in the C library, which will call the application
\r
148 IMPORT xPortPendSVHandler
\r
149 IMPORT xPortSysTickHandler
\r
154 ;******************************************************************************
\r
156 ; This is the code that gets called when the processor receives a NMI. This
\r
157 ; simply enters an infinite loop, preserving the system state for examination
\r
160 ;******************************************************************************
\r
164 ;******************************************************************************
\r
166 ; This is the code that gets called when the processor receives a fault
\r
167 ; interrupt. This simply enters an infinite loop, preserving the system state
\r
168 ; for examination by a debugger.
\r
170 ;******************************************************************************
\r
174 ;******************************************************************************
\r
176 ; This is the code that gets called when the processor receives an unexpected
\r
177 ; interrupt. This simply enters an infinite loop, preserving the system state
\r
178 ; for examination by a debugger.
\r
180 ;******************************************************************************
\r
182 B IntDefaultHandler
\r
184 ;******************************************************************************
\r
186 ; Make sure the end of this section is aligned.
\r
188 ;******************************************************************************
\r
191 ;******************************************************************************
\r
193 ; Some code in the normal code section for initializing the heap and stack.
\r
195 ;******************************************************************************
\r
196 AREA |.text|, CODE, READONLY
\r
198 ;******************************************************************************
\r
200 ; The function expected of the C library startup code for defining the stack
\r
201 ; and heap memory locations.
\r
203 ;******************************************************************************
\r
204 IMPORT __use_two_region_memory
\r
205 EXPORT __user_initial_stackheap
\r
206 __user_initial_stackheap
\r
208 LDR R1, =(StackMem + Stack)
\r
209 LDR R2, =(HeapMem + Heap)
\r
213 ;******************************************************************************
\r
215 ; Make sure the end of this section is aligned.
\r
217 ;******************************************************************************
\r
221 ; Using READWRITE places Section .RTOSHeap in Region ER_RW.
\r
222 ; Using NOINIT places Section .RTOSHeap in Region ER_ZI,which means
\r
223 ; "ZEROINITIALIZE" (sic), and which is the last region in memory. Then
\r
224 ; we need to make this section the last section, which is somewhat tricky,
\r
225 ; because we cannot use the sectionname, but need to use a defined symbol:
\r
226 ; Linker option: "--last xHeap"
\r
230 AREA RTOSHeap, DATA, NOINIT
\r
233 ;******************************************************************************
\r
235 ; Tell the assembler that we're done.
\r
237 ;******************************************************************************
\r