startup_stm32f030x6.s 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. ;******************** (C) COPYRIGHT 2013 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f030x6.s
  3. ;* Author : MCD Application Team
  4. ;* Version : V1.2.0
  5. ;* Date : 01-August-2013
  6. ;* Description : STM32F030x6 devices vector table for MDK-ARM toolchain.
  7. ;* This module performs:
  8. ;* - Set the initial SP
  9. ;* - Set the initial PC == Reset_Handler
  10. ;* - Set the vector table entries with the exceptions ISR address
  11. ;* - Configure the system clock
  12. ;* - Branches to __main in the C library (which eventually
  13. ;* calls main()).
  14. ;* After Reset the CortexM0 processor is in Thread mode,
  15. ;* priority is Privileged, and the Stack is set to Main.
  16. ;* <<< Use Configuration Wizard in Context Menu >>>
  17. ;*******************************************************************************
  18. ; @attention
  19. ;
  20. ; Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  21. ; You may not use this file except in compliance with the License.
  22. ; You may obtain a copy of the License at:
  23. ;
  24. ; http://www.st.com/software_license_agreement_liberty_v2
  25. ;
  26. ; Unless required by applicable law or agreed to in writing, software
  27. ; distributed under the License is distributed on an "AS IS" BASIS,
  28. ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  29. ; See the License for the specific language governing permissions and
  30. ; limitations under the License.
  31. ;
  32. ;*******************************************************************************
  33. ;
  34. ; Amount of memory (in bytes) allocated for Stack
  35. ; Tailor this value to your application needs
  36. ; <h> Stack Configuration
  37. ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
  38. ; </h>
  39. Stack_Size EQU 0x00000400
  40. AREA STACK, NOINIT, READWRITE, ALIGN=3
  41. Stack_Mem SPACE Stack_Size
  42. __initial_sp
  43. ; <h> Heap Configuration
  44. ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
  45. ; </h>
  46. Heap_Size EQU 0x00000200
  47. AREA HEAP, NOINIT, READWRITE, ALIGN=3
  48. __heap_base
  49. Heap_Mem SPACE Heap_Size
  50. __heap_limit
  51. PRESERVE8
  52. THUMB
  53. ; Vector Table Mapped to Address 0 at Reset
  54. AREA RESET, DATA, READONLY
  55. EXPORT __Vectors
  56. EXPORT __Vectors_End
  57. EXPORT __Vectors_Size
  58. __Vectors DCD __initial_sp ; Top of Stack
  59. DCD Reset_Handler ; Reset Handler
  60. DCD NMI_Handler ; NMI Handler
  61. DCD HardFault_Handler ; Hard Fault Handler
  62. DCD 0 ; Reserved
  63. DCD 0 ; Reserved
  64. DCD 0 ; Reserved
  65. DCD 0 ; Reserved
  66. DCD 0 ; Reserved
  67. DCD 0 ; Reserved
  68. DCD 0 ; Reserved
  69. DCD SVC_Handler ; SVCall Handler
  70. DCD 0 ; Reserved
  71. DCD 0 ; Reserved
  72. DCD PendSV_Handler ; PendSV Handler
  73. DCD SysTick_Handler ; SysTick Handler
  74. ; External Interrupts
  75. DCD WWDG_IRQHandler ; Window Watchdog
  76. DCD PVD_IRQHandler ; PVD through EXTI Line detect
  77. DCD RTC_IRQHandler ; RTC through EXTI Line
  78. DCD FLASH_IRQHandler ; FLASH
  79. DCD RCC_IRQHandler ; RCC
  80. DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
  81. DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
  82. DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
  83. DCD 0 ; Reserved
  84. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  85. DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
  86. DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5
  87. DCD ADC1_IRQHandler ; ADC1
  88. DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
  89. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  90. DCD TIM2_IRQHandler ; TIM2
  91. DCD TIM3_IRQHandler ; TIM3
  92. DCD 0 ; Reserved
  93. DCD 0 ; Reserved
  94. DCD TIM14_IRQHandler ; TIM14
  95. DCD 0 ; Reserved
  96. DCD TIM16_IRQHandler ; TIM16
  97. DCD TIM17_IRQHandler ; TIM17
  98. DCD I2C1_IRQHandler ; I2C1
  99. DCD 0 ; Reserved
  100. DCD SPI1_IRQHandler ; SPI1
  101. DCD 0 ; Reserved
  102. DCD USART1_IRQHandler ; USART1
  103. __Vectors_End
  104. __Vectors_Size EQU __Vectors_End - __Vectors
  105. AREA |.text|, CODE, READONLY
  106. ; Reset handler routine
  107. Reset_Handler PROC
  108. EXPORT Reset_Handler [WEAK]
  109. IMPORT __main
  110. IMPORT SystemInit
  111. LDR R0, =SystemInit
  112. BLX R0
  113. LDR R0, =__main
  114. BX R0
  115. ENDP
  116. ; Dummy Exception Handlers (infinite loops which can be modified)
  117. NMI_Handler PROC
  118. EXPORT NMI_Handler [WEAK]
  119. B .
  120. ENDP
  121. HardFault_Handler\
  122. PROC
  123. EXPORT HardFault_Handler [WEAK]
  124. B .
  125. ENDP
  126. SVC_Handler PROC
  127. EXPORT SVC_Handler [WEAK]
  128. B .
  129. ENDP
  130. PendSV_Handler PROC
  131. EXPORT PendSV_Handler [WEAK]
  132. B .
  133. ENDP
  134. SysTick_Handler PROC
  135. EXPORT SysTick_Handler [WEAK]
  136. B .
  137. ENDP
  138. Default_Handler PROC
  139. EXPORT WWDG_IRQHandler [WEAK]
  140. EXPORT PVD_IRQHandler [WEAK]
  141. EXPORT RTC_IRQHandler [WEAK]
  142. EXPORT FLASH_IRQHandler [WEAK]
  143. EXPORT RCC_IRQHandler [WEAK]
  144. EXPORT EXTI0_1_IRQHandler [WEAK]
  145. EXPORT EXTI2_3_IRQHandler [WEAK]
  146. EXPORT EXTI4_15_IRQHandler [WEAK]
  147. EXPORT DMA1_Channel1_IRQHandler [WEAK]
  148. EXPORT DMA1_Channel2_3_IRQHandler [WEAK]
  149. EXPORT DMA1_Channel4_5_IRQHandler [WEAK]
  150. EXPORT ADC1_IRQHandler [WEAK]
  151. EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK]
  152. EXPORT TIM1_CC_IRQHandler [WEAK]
  153. EXPORT TIM2_IRQHandler [WEAK]
  154. EXPORT TIM3_IRQHandler [WEAK]
  155. EXPORT TIM14_IRQHandler [WEAK]
  156. EXPORT TIM16_IRQHandler [WEAK]
  157. EXPORT TIM17_IRQHandler [WEAK]
  158. EXPORT I2C1_IRQHandler [WEAK]
  159. EXPORT SPI1_IRQHandler [WEAK]
  160. EXPORT USART1_IRQHandler [WEAK]
  161. WWDG_IRQHandler
  162. PVD_IRQHandler
  163. RTC_IRQHandler
  164. FLASH_IRQHandler
  165. RCC_IRQHandler
  166. EXTI0_1_IRQHandler
  167. EXTI2_3_IRQHandler
  168. EXTI4_15_IRQHandler
  169. DMA1_Channel1_IRQHandler
  170. DMA1_Channel2_3_IRQHandler
  171. DMA1_Channel4_5_IRQHandler
  172. ADC1_IRQHandler
  173. TIM1_BRK_UP_TRG_COM_IRQHandler
  174. TIM1_CC_IRQHandler
  175. TIM2_IRQHandler
  176. TIM3_IRQHandler
  177. TIM14_IRQHandler
  178. TIM16_IRQHandler
  179. TIM17_IRQHandler
  180. I2C1_IRQHandler
  181. SPI1_IRQHandler
  182. USART1_IRQHandler
  183. B .
  184. ENDP
  185. ALIGN
  186. ;*******************************************************************************
  187. ; User Stack and Heap initialization
  188. ;*******************************************************************************
  189. IF :DEF:__MICROLIB
  190. EXPORT __initial_sp
  191. EXPORT __heap_base
  192. EXPORT __heap_limit
  193. ELSE
  194. IMPORT __use_two_region_memory
  195. EXPORT __user_initial_stackheap
  196. __user_initial_stackheap
  197. LDR R0, = Heap_Mem
  198. LDR R1, =(Stack_Mem + Stack_Size)
  199. LDR R2, = (Heap_Mem + Heap_Size)
  200. LDR R3, = Stack_Mem
  201. BX LR
  202. ALIGN
  203. ENDIF
  204. END
  205. ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****