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
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
98 DCD vPortSVCHandler ; SVCall Handler
\r
99 DCD IntDefaultHandler ; Debug Monitor Handler
\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
134 ;******************************************************************************
\r
136 ; This is the code that gets called when the processor first starts execution
\r
137 ; following a reset event.
\r
139 ;******************************************************************************
\r
140 EXPORT Reset_Handler
\r
143 ; Call __main() in the C library, which will call the application
\r
149 IMPORT xPortPendSVHandler
\r
150 IMPORT xPortSysTickHandler
\r
151 IMPORT vPortSVCHandler
\r
156 ;******************************************************************************
\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
162 ;******************************************************************************
\r
166 ;******************************************************************************
\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
172 ;******************************************************************************
\r
176 ;******************************************************************************
\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
182 ;******************************************************************************
\r
184 B IntDefaultHandler
\r
186 ;******************************************************************************
\r
188 ; Make sure the end of this section is aligned.
\r
190 ;******************************************************************************
\r
193 ;******************************************************************************
\r
195 ; Some code in the normal code section for initializing the heap and stack.
\r
197 ;******************************************************************************
\r
198 AREA |.text|, CODE, READONLY
\r
200 ;******************************************************************************
\r
202 ; The function expected of the C library startup code for defining the stack
\r
203 ; and heap memory locations.
\r
205 ;******************************************************************************
\r
206 IMPORT __use_two_region_memory
\r
207 EXPORT __user_initial_stackheap
\r
208 __user_initial_stackheap
\r
210 LDR R1, =(StackMem + Stack)
\r
211 LDR R2, =(HeapMem + Heap)
\r
215 ;******************************************************************************
\r
217 ; Make sure the end of this section is aligned.
\r
219 ;******************************************************************************
\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
232 AREA RTOSHeap, DATA, NOINIT
\r
235 ;******************************************************************************
\r
237 ; Tell the assembler that we're done.
\r
239 ;******************************************************************************
\r