/boards/dk-lm3s9d96/usb_dev_mouse/startup_rvmdk.S

https://github.com/hrshygoodness/Luminary-Micro-Library · Assembly · 260 lines · 119 code · 17 blank · 124 comment · 0 complexity · e22f7ad34ee99a159ad9d5591dd709c7 MD5 · raw file

  1. ; <<< Use Configuration Wizard in Context Menu >>>
  2. ;******************************************************************************
  3. ;
  4. ; startup_rvmdk.S - Startup code for use with Keil's uVision.
  5. ;
  6. ; Copyright (c) 2009-2013 Texas Instruments Incorporated. All rights reserved.
  7. ; Software License Agreement
  8. ;
  9. ; Texas Instruments (TI) is supplying this software for use solely and
  10. ; exclusively on TI's microcontroller products. The software is owned by
  11. ; TI and/or its suppliers, and is protected under applicable copyright
  12. ; laws. You may not combine this software with "viral" open-source
  13. ; software in order to form a larger program.
  14. ;
  15. ; THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  16. ; NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  17. ; NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. ; A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  19. ; CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  20. ; DAMAGES, FOR ANY REASON WHATSOEVER.
  21. ;
  22. ; This is part of revision 10636 of the DK-LM3S9D96 Firmware Package.
  23. ;
  24. ;******************************************************************************
  25. ;******************************************************************************
  26. ;
  27. ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
  28. ;
  29. ;******************************************************************************
  30. Stack EQU 0x00000400
  31. ;******************************************************************************
  32. ;
  33. ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
  34. ;
  35. ;******************************************************************************
  36. Heap EQU 0x00000000
  37. ;******************************************************************************
  38. ;
  39. ; Allocate space for the stack.
  40. ;
  41. ;******************************************************************************
  42. AREA STACK, NOINIT, READWRITE, ALIGN=3
  43. StackMem
  44. SPACE Stack
  45. __initial_sp
  46. ;******************************************************************************
  47. ;
  48. ; Allocate space for the heap.
  49. ;
  50. ;******************************************************************************
  51. AREA HEAP, NOINIT, READWRITE, ALIGN=3
  52. __heap_base
  53. HeapMem
  54. SPACE Heap
  55. __heap_limit
  56. ;******************************************************************************
  57. ;
  58. ; Indicate that the code in this file preserves 8-byte alignment of the stack.
  59. ;
  60. ;******************************************************************************
  61. PRESERVE8
  62. ;******************************************************************************
  63. ;
  64. ; Place code into the reset code section.
  65. ;
  66. ;******************************************************************************
  67. AREA RESET, CODE, READONLY
  68. THUMB
  69. ;******************************************************************************
  70. ;
  71. ; External declarations for the interrupt handlers used by the application.
  72. ;
  73. ;******************************************************************************
  74. EXTERN TouchScreenIntHandler
  75. EXTERN SysTickHandler
  76. EXTERN UARTStdioIntHandler
  77. EXTERN USB0DeviceIntHandler
  78. ;******************************************************************************
  79. ;
  80. ; The vector table.
  81. ;
  82. ;******************************************************************************
  83. EXPORT __Vectors
  84. __Vectors
  85. DCD StackMem + Stack ; Top of Stack
  86. DCD Reset_Handler ; Reset Handler
  87. DCD NmiSR ; NMI Handler
  88. DCD FaultISR ; Hard Fault Handler
  89. DCD IntDefaultHandler ; The MPU fault handler
  90. DCD IntDefaultHandler ; The bus fault handler
  91. DCD IntDefaultHandler ; The usage fault handler
  92. DCD 0 ; Reserved
  93. DCD 0 ; Reserved
  94. DCD 0 ; Reserved
  95. DCD 0 ; Reserved
  96. DCD IntDefaultHandler ; SVCall handler
  97. DCD IntDefaultHandler ; Debug monitor handler
  98. DCD 0 ; Reserved
  99. DCD IntDefaultHandler ; The PendSV handler
  100. DCD SysTickHandler ; The SysTick handler
  101. DCD IntDefaultHandler ; GPIO Port A
  102. DCD IntDefaultHandler ; GPIO Port B
  103. DCD IntDefaultHandler ; GPIO Port C
  104. DCD IntDefaultHandler ; GPIO Port D
  105. DCD IntDefaultHandler ; GPIO Port E
  106. DCD UARTStdioIntHandler ; UART0 Rx and Tx
  107. DCD IntDefaultHandler ; UART1 Rx and Tx
  108. DCD IntDefaultHandler ; SSI0 Rx and Tx
  109. DCD IntDefaultHandler ; I2C0 Master and Slave
  110. DCD IntDefaultHandler ; PWM Fault
  111. DCD IntDefaultHandler ; PWM Generator 0
  112. DCD IntDefaultHandler ; PWM Generator 1
  113. DCD IntDefaultHandler ; PWM Generator 2
  114. DCD IntDefaultHandler ; Quadrature Encoder 0
  115. DCD IntDefaultHandler ; ADC Sequence 0
  116. DCD IntDefaultHandler ; ADC Sequence 1
  117. DCD IntDefaultHandler ; ADC Sequence 2
  118. DCD TouchScreenIntHandler ; ADC Sequence 3
  119. DCD IntDefaultHandler ; Watchdog timer
  120. DCD IntDefaultHandler ; Timer 0 subtimer A
  121. DCD IntDefaultHandler ; Timer 0 subtimer B
  122. DCD IntDefaultHandler ; Timer 1 subtimer A
  123. DCD IntDefaultHandler ; Timer 1 subtimer B
  124. DCD IntDefaultHandler ; Timer 2 subtimer A
  125. DCD IntDefaultHandler ; Timer 2 subtimer B
  126. DCD IntDefaultHandler ; Analog Comparator 0
  127. DCD IntDefaultHandler ; Analog Comparator 1
  128. DCD IntDefaultHandler ; Analog Comparator 2
  129. DCD IntDefaultHandler ; System Control (PLL, OSC, BO)
  130. DCD IntDefaultHandler ; FLASH Control
  131. DCD IntDefaultHandler ; GPIO Port F
  132. DCD IntDefaultHandler ; GPIO Port G
  133. DCD IntDefaultHandler ; GPIO Port H
  134. DCD IntDefaultHandler ; UART2 Rx and Tx
  135. DCD IntDefaultHandler ; SSI1 Rx and Tx
  136. DCD IntDefaultHandler ; Timer 3 subtimer A
  137. DCD IntDefaultHandler ; Timer 3 subtimer B
  138. DCD IntDefaultHandler ; I2C1 Master and Slave
  139. DCD IntDefaultHandler ; Quadrature Encoder 1
  140. DCD IntDefaultHandler ; CAN0
  141. DCD IntDefaultHandler ; CAN1
  142. DCD IntDefaultHandler ; CAN2
  143. DCD IntDefaultHandler ; Ethernet
  144. DCD IntDefaultHandler ; Hibernate
  145. DCD USB0DeviceIntHandler ; USB0
  146. DCD IntDefaultHandler ; PWM Generator 3
  147. DCD IntDefaultHandler ; uDMA Software Transfer
  148. DCD IntDefaultHandler ; uDMA Error
  149. DCD IntDefaultHandler ; ADC1 Sequence 0
  150. DCD IntDefaultHandler ; ADC1 Sequence 1
  151. DCD IntDefaultHandler ; ADC1 Sequence 2
  152. DCD IntDefaultHandler ; ADC1 Sequence 3
  153. DCD IntDefaultHandler ; I2S0
  154. DCD IntDefaultHandler ; External Bus Interface 0
  155. DCD IntDefaultHandler ; GPIO Port J
  156. ;******************************************************************************
  157. ;
  158. ; This is the code that gets called when the processor first starts execution
  159. ; following a reset event.
  160. ;
  161. ;******************************************************************************
  162. EXPORT Reset_Handler
  163. Reset_Handler
  164. ;
  165. ; Call the C library enty point that handles startup. This will copy
  166. ; the .data section initializers from flash to SRAM and zero fill the
  167. ; .bss section.
  168. ;
  169. IMPORT __main
  170. B __main
  171. ;******************************************************************************
  172. ;
  173. ; This is the code that gets called when the processor receives a NMI. This
  174. ; simply enters an infinite loop, preserving the system state for examination
  175. ; by a debugger.
  176. ;
  177. ;******************************************************************************
  178. NmiSR
  179. B NmiSR
  180. ;******************************************************************************
  181. ;
  182. ; This is the code that gets called when the processor receives a fault
  183. ; interrupt. This simply enters an infinite loop, preserving the system state
  184. ; for examination by a debugger.
  185. ;
  186. ;******************************************************************************
  187. FaultISR
  188. B FaultISR
  189. ;******************************************************************************
  190. ;
  191. ; This is the code that gets called when the processor receives an unexpected
  192. ; interrupt. This simply enters an infinite loop, preserving the system state
  193. ; for examination by a debugger.
  194. ;
  195. ;******************************************************************************
  196. IntDefaultHandler
  197. B IntDefaultHandler
  198. ;******************************************************************************
  199. ;
  200. ; Make sure the end of this section is aligned.
  201. ;
  202. ;******************************************************************************
  203. ALIGN
  204. ;******************************************************************************
  205. ;
  206. ; Some code in the normal code section for initializing the heap and stack.
  207. ;
  208. ;******************************************************************************
  209. AREA |.text|, CODE, READONLY
  210. ;******************************************************************************
  211. ;
  212. ; The function expected of the C library startup code for defining the stack
  213. ; and heap memory locations. For the C library version of the startup code,
  214. ; provide this function so that the C library initialization code can find out
  215. ; the location of the stack and heap.
  216. ;
  217. ;******************************************************************************
  218. IF :DEF: __MICROLIB
  219. EXPORT __initial_sp
  220. EXPORT __heap_base
  221. EXPORT __heap_limit
  222. ELSE
  223. IMPORT __use_two_region_memory
  224. EXPORT __user_initial_stackheap
  225. __user_initial_stackheap
  226. LDR R0, =HeapMem
  227. LDR R1, =(StackMem + Stack)
  228. LDR R2, =(HeapMem + Heap)
  229. LDR R3, =StackMem
  230. BX LR
  231. ENDIF
  232. ;******************************************************************************
  233. ;
  234. ; Make sure the end of this section is aligned.
  235. ;
  236. ;******************************************************************************
  237. ALIGN
  238. ;******************************************************************************
  239. ;
  240. ; Tell the assembler that we're done.
  241. ;
  242. ;******************************************************************************
  243. END