1 ; <<< Use Configuration Wizard in Context Menu >>>
2 ;******************************************************************************
4 ; startup_rvmdk.S - Startup code for Stellaris.
6 ; Copyright (c) 2006 Luminary Micro, Inc. All rights reserved.
8 ; Software License Agreement
10 ; Luminary Micro, Inc. (LMI) is supplying this software for use solely and
11 ; exclusively on LMI's Stellaris Family of microcontroller products.
13 ; The software is owned by LMI and/or its suppliers, and is protected under
14 ; applicable copyright laws. All rights are reserved. Any use in violation of
15 ; the foregoing restrictions may subject the user to criminal sanctions under
16 ; applicable laws, as well as to civil liability for the breach of the terms
17 ; and conditions of this license.
19 ; THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
20 ; OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
21 ; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
22 ; LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
23 ; CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
25 ; This is part of revision 816 of the Stellaris Driver Library.
27 ;******************************************************************************
29 ;******************************************************************************
31 ; <h> Stack Configuration
32 ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
35 ;******************************************************************************
38 ;******************************************************************************
40 ; <h> Heap Configuration
41 ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
44 ;******************************************************************************
47 ;******************************************************************************
49 ; Allocate space for the stack.
51 ;******************************************************************************
52 AREA STACK, NOINIT, READWRITE, ALIGN=3
56 ;******************************************************************************
58 ; Allocate space for the heap.
60 ;******************************************************************************
61 AREA HEAP, NOINIT, READWRITE, ALIGN=3
65 ;******************************************************************************
67 ; Indicate that the code in this file preserves 8-byte alignment of the stack.
69 ;******************************************************************************
72 ;******************************************************************************
74 ; Place code into the reset code section.
76 ;******************************************************************************
77 AREA RESET, CODE, READONLY
80 ;******************************************************************************
84 ;******************************************************************************
87 DCD StackMem + Stack ; Top of Stack
88 DCD Reset_Handler ; Reset Handler
89 DCD NmiSR ; NMI Handler
90 DCD FaultISR ; Hard Fault Handler
91 DCD IntDefaultHandler ; MPU Fault Handler
92 DCD IntDefaultHandler ; Bus Fault Handler
93 DCD IntDefaultHandler ; Usage Fault Handler
98 DCD vPortSVCHandler ; SVCall Handler
99 DCD IntDefaultHandler ; Debug Monitor Handler
101 DCD xPortPendSVHandler ; PendSV Handler
102 DCD xPortSysTickHandler ; SysTick Handler
103 DCD IntDefaultHandler ; GPIO Port A
104 DCD IntDefaultHandler ; GPIO Port B
105 DCD vGPIO_ISR ; GPIO Port C
106 DCD IntDefaultHandler ; GPIO Port D
107 DCD IntDefaultHandler ; GPIO Port E
108 DCD vUART_ISR ; UART0
109 DCD IntDefaultHandler ; UART1
110 DCD IntDefaultHandler ; SSI
111 DCD IntDefaultHandler ; I2C
112 DCD IntDefaultHandler ; PWM Fault
113 DCD IntDefaultHandler ; PWM Generator 0
114 DCD IntDefaultHandler ; PWM Generator 1
115 DCD IntDefaultHandler ; PWM Generator 2
116 DCD IntDefaultHandler ; Quadrature Encoder
117 DCD IntDefaultHandler ; ADC Sequence 0
118 DCD IntDefaultHandler ; ADC Sequence 1
119 DCD IntDefaultHandler ; ADC Sequence 2
120 DCD IntDefaultHandler ; ADC Sequence 3
121 DCD IntDefaultHandler ; Watchdog
122 DCD IntDefaultHandler ; Timer 0A
123 DCD IntDefaultHandler ; Timer 0B
124 DCD IntDefaultHandler ; Timer 1A
125 DCD IntDefaultHandler ; Timer 1B
126 DCD IntDefaultHandler ; Timer 2A
127 DCD IntDefaultHandler ; Timer 2B
128 DCD IntDefaultHandler ; Comp 0
129 DCD IntDefaultHandler ; Comp 1
130 DCD IntDefaultHandler ; Comp 2
131 DCD IntDefaultHandler ; System Control
132 DCD IntDefaultHandler ; Flash Control
134 ;******************************************************************************
136 ; This is the code that gets called when the processor first starts execution
137 ; following a reset event.
139 ;******************************************************************************
143 ; Call __main() in the C library, which will call the application
149 IMPORT xPortPendSVHandler
150 IMPORT xPortSysTickHandler
151 IMPORT vPortSVCHandler
156 ;******************************************************************************
158 ; This is the code that gets called when the processor receives a NMI. This
159 ; simply enters an infinite loop, preserving the system state for examination
162 ;******************************************************************************
166 ;******************************************************************************
168 ; This is the code that gets called when the processor receives a fault
169 ; interrupt. This simply enters an infinite loop, preserving the system state
170 ; for examination by a debugger.
172 ;******************************************************************************
176 ;******************************************************************************
178 ; This is the code that gets called when the processor receives an unexpected
179 ; interrupt. This simply enters an infinite loop, preserving the system state
180 ; for examination by a debugger.
182 ;******************************************************************************
186 ;******************************************************************************
188 ; Make sure the end of this section is aligned.
190 ;******************************************************************************
193 ;******************************************************************************
195 ; Some code in the normal code section for initializing the heap and stack.
197 ;******************************************************************************
198 AREA |.text|, CODE, READONLY
200 ;******************************************************************************
202 ; The function expected of the C library startup code for defining the stack
203 ; and heap memory locations.
205 ;******************************************************************************
206 IMPORT __use_two_region_memory
207 EXPORT __user_initial_stackheap
208 __user_initial_stackheap
210 LDR R1, =(StackMem + Stack)
211 LDR R2, =(HeapMem + Heap)
215 ;******************************************************************************
217 ; Make sure the end of this section is aligned.
219 ;******************************************************************************
223 ; Using READWRITE places Section .RTOSHeap in Region ER_RW.
224 ; Using NOINIT places Section .RTOSHeap in Region ER_ZI,which means
225 ; "ZEROINITIALIZE" (sic), and which is the last region in memory. Then
226 ; we need to make this section the last section, which is somewhat tricky,
227 ; because we cannot use the sectionname, but need to use a defined symbol:
228 ; Linker option: "--last xHeap"
232 AREA RTOSHeap, DATA, NOINIT
235 ;******************************************************************************
237 ; Tell the assembler that we're done.
239 ;******************************************************************************