startup_stm32f10x_md_vl.S 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. /**
  2. ******************************************************************************
  3. * @file startup_stm32f10x_md_vl.s
  4. * @author MCD Application Team
  5. * @version V3.4.0
  6. * @date 10/15/2010
  7. * @brief STM32F10x Meduim Density Value Line Devices vector table for RIDE7
  8. * toolchain.
  9. * This module performs:
  10. * - Set the initial SP
  11. * - Set the initial PC == Reset_Handler,
  12. * - Set the vector table entries with the exceptions ISR address
  13. * - Configure the clock system
  14. * - Branches to main in the C library (which eventually
  15. * calls main()).
  16. * After Reset the Cortex-M3 processor is in Thread mode,
  17. * priority is Privileged, and the Stack is set to Main.
  18. *******************************************************************************
  19. * @copy
  20. *
  21. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  22. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  23. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  24. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  25. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  26. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  27. *
  28. * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
  29. */
  30. .syntax unified
  31. .cpu cortex-m3
  32. .fpu softvfp
  33. .thumb
  34. .global g_pfnVectors
  35. .global Default_Handler
  36. /* start address for the initialization values of the .data section.
  37. defined in linker script */
  38. .word _sidata
  39. /* start address for the .data section. defined in linker script */
  40. .word _sdata
  41. /* end address for the .data section. defined in linker script */
  42. .word _edata
  43. /* start address for the .bss section. defined in linker script */
  44. .word _sbss
  45. /* end address for the .bss section. defined in linker script */
  46. .word _ebss
  47. .equ BootRAM, 0xF108F85F
  48. /**
  49. * @brief This is the code that gets called when the processor first
  50. * starts execution following a reset event. Only the absolutely
  51. * necessary set is performed, after which the application
  52. * supplied main() routine is called.
  53. * @param None
  54. * @retval None
  55. */
  56. .section .text.Reset_Handler
  57. .weak Reset_Handler
  58. .type Reset_Handler, %function
  59. Reset_Handler:
  60. /* Copy the data segment initializers from flash to SRAM */
  61. movs r1, #0
  62. b LoopCopyDataInit
  63. CopyDataInit:
  64. ldr r3, =_sidata
  65. ldr r3, [r3, r1]
  66. str r3, [r0, r1]
  67. adds r1, r1, #4
  68. LoopCopyDataInit:
  69. ldr r0, =_sdata
  70. ldr r3, =_edata
  71. adds r2, r0, r1
  72. cmp r2, r3
  73. bcc CopyDataInit
  74. ldr r2, =_sbss
  75. b LoopFillZerobss
  76. /* Zero fill the bss segment. */
  77. FillZerobss:
  78. movs r3, #0
  79. str r3, [r2], #4
  80. LoopFillZerobss:
  81. ldr r3, = _ebss
  82. cmp r2, r3
  83. bcc FillZerobss
  84. /* Call the clock system intitialization function.*/
  85. bl SystemInit
  86. /* Call the application's entry point.*/
  87. bl main
  88. bx lr
  89. .size Reset_Handler, .-Reset_Handler
  90. /**
  91. * @brief This is the code that gets called when the processor receives an
  92. * unexpected interrupt. This simply enters an infinite loop, preserving
  93. * the system state for examination by a debugger.
  94. * @param None
  95. * @retval None
  96. */
  97. .section .text.Default_Handler,"ax",%progbits
  98. Default_Handler:
  99. Infinite_Loop:
  100. b Infinite_Loop
  101. .size Default_Handler, .-Default_Handler
  102. /******************************************************************************
  103. * The minimal vector table for a Cortex M3. Note that the proper constructs
  104. * must be placed on this to ensure that it ends up at physical address
  105. * 0x0000.0000.
  106. *
  107. ******************************************************************************/
  108. .section .isr_vector,"a",%progbits
  109. .type g_pfnVectors, %object
  110. .size g_pfnVectors, .-g_pfnVectors
  111. g_pfnVectors:
  112. .word _estack
  113. .word Reset_Handler
  114. .word NMI_Handler
  115. .word HardFault_Handler
  116. .word MemManage_Handler
  117. .word BusFault_Handler
  118. .word UsageFault_Handler
  119. .word 0
  120. .word 0
  121. .word 0
  122. .word 0
  123. .word SVC_Handler
  124. .word DebugMon_Handler
  125. .word 0
  126. .word PendSV_Handler
  127. .word SysTick_Handler
  128. .word WWDG_IRQHandler
  129. .word PVD_IRQHandler
  130. .word TAMPER_IRQHandler
  131. .word RTC_IRQHandler
  132. .word FLASH_IRQHandler
  133. .word RCC_IRQHandler
  134. .word EXTI0_IRQHandler
  135. .word EXTI1_IRQHandler
  136. .word EXTI2_IRQHandler
  137. .word EXTI3_IRQHandler
  138. .word EXTI4_IRQHandler
  139. .word DMA1_Channel1_IRQHandler
  140. .word DMA1_Channel2_IRQHandler
  141. .word DMA1_Channel3_IRQHandler
  142. .word DMA1_Channel4_IRQHandler
  143. .word DMA1_Channel5_IRQHandler
  144. .word DMA1_Channel6_IRQHandler
  145. .word DMA1_Channel7_IRQHandler
  146. .word ADC1_IRQHandler
  147. .word 0
  148. .word 0
  149. .word 0
  150. .word 0
  151. .word EXTI9_5_IRQHandler
  152. .word TIM1_BRK_TIM15_IRQHandler
  153. .word TIM1_UP_TIM16_IRQHandler
  154. .word TIM1_TRG_COM_TIM17_IRQHandler
  155. .word TIM1_CC_IRQHandler
  156. .word TIM2_IRQHandler
  157. .word TIM3_IRQHandler
  158. .word 0
  159. .word I2C1_EV_IRQHandler
  160. .word I2C1_ER_IRQHandler
  161. .word 0
  162. .word 0
  163. .word SPI1_IRQHandler
  164. .word 0
  165. .word USART1_IRQHandler
  166. .word USART2_IRQHandler
  167. .word 0
  168. .word EXTI15_10_IRQHandler
  169. .word RTCAlarm_IRQHandler
  170. .word CEC_IRQHandler
  171. .word 0
  172. .word 0
  173. .word 0
  174. .word 0
  175. .word 0
  176. .word 0
  177. .word 0
  178. .word 0
  179. .word 0
  180. .word 0
  181. .word 0
  182. .word TIM6_DAC_IRQHandler
  183. .word TIM7_IRQHandler
  184. .word 0
  185. .word 0
  186. .word 0
  187. .word 0
  188. .word 0
  189. .word 0
  190. .word 0
  191. .word 0
  192. .word 0
  193. .word 0
  194. .word 0
  195. .word 0
  196. .word 0
  197. .word 0
  198. .word 0
  199. .word 0
  200. .word 0
  201. .word 0
  202. .word 0
  203. .word 0
  204. .word 0
  205. .word 0
  206. .word 0
  207. .word 0
  208. .word 0
  209. .word 0
  210. .word 0
  211. .word 0
  212. .word 0
  213. .word 0
  214. .word 0
  215. .word 0
  216. .word 0
  217. .word 0
  218. .word 0
  219. .word 0
  220. .word 0
  221. .word 0
  222. .word 0
  223. .word 0
  224. .word 0
  225. .word 0
  226. .word 0
  227. .word BootRAM /* @0x01CC. This is for boot in RAM mode for
  228. STM32F10x Low Density Value Line devices. */
  229. /*******************************************************************************
  230. * Provide weak aliases for each Exception handler to the Default_Handler.
  231. * As they are weak aliases, any function with the same name will override
  232. * this definition.
  233. *******************************************************************************/
  234. .weak NMI_Handler
  235. .thumb_set NMI_Handler,Default_Handler
  236. .weak HardFault_Handler
  237. .thumb_set HardFault_Handler,Default_Handler
  238. .weak MemManage_Handler
  239. .thumb_set MemManage_Handler,Default_Handler
  240. .weak BusFault_Handler
  241. .thumb_set BusFault_Handler,Default_Handler
  242. .weak UsageFault_Handler
  243. .thumb_set UsageFault_Handler,Default_Handler
  244. .weak SVC_Handler
  245. .thumb_set SVC_Handler,Default_Handler
  246. .weak DebugMon_Handler
  247. .thumb_set DebugMon_Handler,Default_Handler
  248. .weak PendSV_Handler
  249. .thumb_set PendSV_Handler,Default_Handler
  250. .weak SysTick_Handler
  251. .thumb_set SysTick_Handler,Default_Handler
  252. .weak WWDG_IRQHandler
  253. .thumb_set WWDG_IRQHandler,Default_Handler
  254. .weak PVD_IRQHandler
  255. .thumb_set PVD_IRQHandler,Default_Handler
  256. .weak TAMPER_IRQHandler
  257. .thumb_set TAMPER_IRQHandler,Default_Handler
  258. .weak RTC_IRQHandler
  259. .thumb_set RTC_IRQHandler,Default_Handler
  260. .weak FLASH_IRQHandler
  261. .thumb_set FLASH_IRQHandler,Default_Handler
  262. .weak RCC_IRQHandler
  263. .thumb_set RCC_IRQHandler,Default_Handler
  264. .weak EXTI0_IRQHandler
  265. .thumb_set EXTI0_IRQHandler,Default_Handler
  266. .weak EXTI1_IRQHandler
  267. .thumb_set EXTI1_IRQHandler,Default_Handler
  268. .weak EXTI2_IRQHandler
  269. .thumb_set EXTI2_IRQHandler,Default_Handler
  270. .weak EXTI3_IRQHandler
  271. .thumb_set EXTI3_IRQHandler,Default_Handler
  272. .weak EXTI4_IRQHandler
  273. .thumb_set EXTI4_IRQHandler,Default_Handler
  274. .weak DMA1_Channel1_IRQHandler
  275. .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
  276. .weak DMA1_Channel2_IRQHandler
  277. .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
  278. .weak DMA1_Channel3_IRQHandler
  279. .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
  280. .weak DMA1_Channel4_IRQHandler
  281. .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
  282. .weak DMA1_Channel5_IRQHandler
  283. .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
  284. .weak DMA1_Channel6_IRQHandler
  285. .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
  286. .weak DMA1_Channel7_IRQHandler
  287. .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
  288. .weak ADC1_IRQHandler
  289. .thumb_set ADC1_IRQHandler,Default_Handler
  290. .weak EXTI9_5_IRQHandler
  291. .thumb_set EXTI9_5_IRQHandler,Default_Handler
  292. .weak TIM1_BRK_TIM15_IRQHandler
  293. .thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler
  294. .weak TIM1_UP_TIM16_IRQHandler
  295. .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
  296. .weak TIM1_TRG_COM_TIM17_IRQHandler
  297. .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler
  298. .weak TIM1_CC_IRQHandler
  299. .thumb_set TIM1_CC_IRQHandler,Default_Handler
  300. .weak TIM2_IRQHandler
  301. .thumb_set TIM2_IRQHandler,Default_Handler
  302. .weak TIM3_IRQHandler
  303. .thumb_set TIM3_IRQHandler,Default_Handler
  304. .weak I2C1_EV_IRQHandler
  305. .thumb_set I2C1_EV_IRQHandler,Default_Handler
  306. .weak I2C1_ER_IRQHandler
  307. .thumb_set I2C1_ER_IRQHandler,Default_Handler
  308. .weak SPI1_IRQHandler
  309. .thumb_set SPI1_IRQHandler,Default_Handler
  310. .weak USART1_IRQHandler
  311. .thumb_set USART1_IRQHandler,Default_Handler
  312. .weak USART2_IRQHandler
  313. .thumb_set USART2_IRQHandler,Default_Handler
  314. .weak EXTI15_10_IRQHandler
  315. .thumb_set EXTI15_10_IRQHandler,Default_Handler
  316. .weak RTCAlarm_IRQHandler
  317. .thumb_set RTCAlarm_IRQHandler,Default_Handler
  318. .weak CEC_IRQHandler
  319. .thumb_set CEC_IRQHandler,Default_Handler
  320. .weak TIM6_DAC_IRQHandler
  321. .thumb_set TIM6_DAC_IRQHandler,Default_Handler
  322. .weak TIM7_IRQHandler
  323. .thumb_set TIM7_IRQHandler,Default_Handler
  324. /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/