startup_stm32l053xx.s 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. ;*******************************************************************************
  2. ;* File Name : startup_stm32l053xx.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32L053xx Ultra Low Power Devices vector
  5. ;* This module performs:
  6. ;* - Set the initial SP
  7. ;* - Set the initial PC == _iar_program_start,
  8. ;* - Set the vector table entries with the exceptions ISR
  9. ;* address.
  10. ;* - Configure the system clock
  11. ;* - Branches to main in the C library (which eventually
  12. ;* calls main()).
  13. ;* After Reset the Cortex-M0+ processor is in Thread mode,
  14. ;* priority is Privileged, and the Stack is set to Main.
  15. ;*******************************************************************************
  16. ;* @attention
  17. ;*
  18. ;* Copyright (c) 2016 STMicroelectronics.
  19. ;* All rights reserved.
  20. ;*
  21. ;* This software is licensed under terms that can be found in the LICENSE file
  22. ;* in the root directory of this software component.
  23. ;* If no LICENSE file comes with this software, it is provided AS-IS.
  24. ;*
  25. ;*******************************************************************************
  26. ;
  27. ;
  28. ; The modules in this file are included in the libraries, and may be replaced
  29. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  30. ; a user defined start symbol.
  31. ; To override the cstartup defined in the library, simply add your modified
  32. ; version to the workbench project.
  33. ;
  34. ; The vector table is normally located at address 0.
  35. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  36. ; The name "__vector_table" has special meaning for C-SPY:
  37. ; it is where the SP start value is found, and the NVIC vector
  38. ; table register (VTOR) is initialized to this address if != 0.
  39. ;
  40. ; Cortex-M version
  41. ;
  42. MODULE ?cstartup
  43. ;; Forward declaration of sections.
  44. SECTION CSTACK:DATA:NOROOT(3)
  45. SECTION .intvec:CODE:NOROOT(2)
  46. EXTERN __iar_program_start
  47. EXTERN SystemInit
  48. PUBLIC __vector_table
  49. DATA
  50. __vector_table
  51. DCD sfe(CSTACK)
  52. DCD Reset_Handler ; Reset Handler
  53. DCD NMI_Handler ; NMI Handler
  54. DCD HardFault_Handler ; Hard Fault Handler
  55. DCD 0 ; Reserved
  56. DCD 0 ; Reserved
  57. DCD 0 ; Reserved
  58. DCD 0 ; Reserved
  59. DCD 0 ; Reserved
  60. DCD 0 ; Reserved
  61. DCD 0 ; Reserved
  62. DCD SVC_Handler ; SVCall Handler
  63. DCD 0 ; Reserved
  64. DCD 0 ; Reserved
  65. DCD PendSV_Handler ; PendSV Handler
  66. DCD SysTick_Handler ; SysTick Handler
  67. ; External Interrupts
  68. DCD WWDG_IRQHandler ; Window Watchdog
  69. DCD PVD_IRQHandler ; PVD through EXTI Line detect
  70. DCD RTC_IRQHandler ; RTC through EXTI Line
  71. DCD FLASH_IRQHandler ; FLASH
  72. DCD RCC_CRS_IRQHandler ; RCC_CRS
  73. DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
  74. DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
  75. DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
  76. DCD TSC_IRQHandler ; TSC
  77. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  78. DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
  79. DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7
  80. DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2
  81. DCD LPTIM1_IRQHandler ; LPTIM1
  82. DCD 0 ; Reserved
  83. DCD TIM2_IRQHandler ; TIM2
  84. DCD 0 ; Reserved
  85. DCD TIM6_DAC_IRQHandler ; TIM6 and DAC
  86. DCD 0 ; Reserved
  87. DCD 0 ; Reserved
  88. DCD TIM21_IRQHandler ; TIM21
  89. DCD 0 ; Reserved
  90. DCD TIM22_IRQHandler ; TIM22
  91. DCD I2C1_IRQHandler ; I2C1
  92. DCD I2C2_IRQHandler ; I2C2
  93. DCD SPI1_IRQHandler ; SPI1
  94. DCD SPI2_IRQHandler ; SPI2
  95. DCD USART1_IRQHandler ; USART1
  96. DCD USART2_IRQHandler ; USART2
  97. DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1
  98. DCD LCD_IRQHandler ; LCD
  99. DCD USB_IRQHandler ; USB
  100. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  101. ;;
  102. ;; Default interrupt handlers.
  103. ;;
  104. THUMB
  105. PUBWEAK Reset_Handler
  106. SECTION .text:CODE:NOROOT:REORDER(2)
  107. Reset_Handler
  108. LDR R0, =SystemInit
  109. BLX R0
  110. LDR R0, =__iar_program_start
  111. BX R0
  112. PUBWEAK NMI_Handler
  113. SECTION .text:CODE:NOROOT:REORDER(1)
  114. NMI_Handler
  115. B NMI_Handler
  116. PUBWEAK HardFault_Handler
  117. SECTION .text:CODE:NOROOT:REORDER(1)
  118. HardFault_Handler
  119. B HardFault_Handler
  120. PUBWEAK SVC_Handler
  121. SECTION .text:CODE:NOROOT:REORDER(1)
  122. SVC_Handler
  123. B SVC_Handler
  124. PUBWEAK PendSV_Handler
  125. SECTION .text:CODE:NOROOT:REORDER(1)
  126. PendSV_Handler
  127. B PendSV_Handler
  128. PUBWEAK SysTick_Handler
  129. SECTION .text:CODE:NOROOT:REORDER(1)
  130. SysTick_Handler
  131. B SysTick_Handler
  132. PUBWEAK WWDG_IRQHandler
  133. SECTION .text:CODE:NOROOT:REORDER(1)
  134. WWDG_IRQHandler
  135. B WWDG_IRQHandler
  136. PUBWEAK PVD_IRQHandler
  137. SECTION .text:CODE:NOROOT:REORDER(1)
  138. PVD_IRQHandler
  139. B PVD_IRQHandler
  140. PUBWEAK RTC_IRQHandler
  141. SECTION .text:CODE:NOROOT:REORDER(1)
  142. RTC_IRQHandler
  143. B RTC_IRQHandler
  144. PUBWEAK FLASH_IRQHandler
  145. SECTION .text:CODE:NOROOT:REORDER(1)
  146. FLASH_IRQHandler
  147. B FLASH_IRQHandler
  148. PUBWEAK RCC_CRS_IRQHandler
  149. SECTION .text:CODE:NOROOT:REORDER(1)
  150. RCC_CRS_IRQHandler
  151. B RCC_CRS_IRQHandler
  152. PUBWEAK EXTI0_1_IRQHandler
  153. SECTION .text:CODE:NOROOT:REORDER(1)
  154. EXTI0_1_IRQHandler
  155. B EXTI0_1_IRQHandler
  156. PUBWEAK EXTI2_3_IRQHandler
  157. SECTION .text:CODE:NOROOT:REORDER(1)
  158. EXTI2_3_IRQHandler
  159. B EXTI2_3_IRQHandler
  160. PUBWEAK EXTI4_15_IRQHandler
  161. SECTION .text:CODE:NOROOT:REORDER(1)
  162. EXTI4_15_IRQHandler
  163. B EXTI4_15_IRQHandler
  164. PUBWEAK TSC_IRQHandler
  165. SECTION .text:CODE:NOROOT:REORDER(1)
  166. TSC_IRQHandler
  167. B TSC_IRQHandler
  168. PUBWEAK DMA1_Channel1_IRQHandler
  169. SECTION .text:CODE:NOROOT:REORDER(1)
  170. DMA1_Channel1_IRQHandler
  171. B DMA1_Channel1_IRQHandler
  172. PUBWEAK DMA1_Channel2_3_IRQHandler
  173. SECTION .text:CODE:NOROOT:REORDER(1)
  174. DMA1_Channel2_3_IRQHandler
  175. B DMA1_Channel2_3_IRQHandler
  176. PUBWEAK DMA1_Channel4_5_6_7_IRQHandler
  177. SECTION .text:CODE:NOROOT:REORDER(1)
  178. DMA1_Channel4_5_6_7_IRQHandler
  179. B DMA1_Channel4_5_6_7_IRQHandler
  180. PUBWEAK ADC1_COMP_IRQHandler
  181. SECTION .text:CODE:NOROOT:REORDER(1)
  182. ADC1_COMP_IRQHandler
  183. B ADC1_COMP_IRQHandler
  184. PUBWEAK LPTIM1_IRQHandler
  185. SECTION .text:CODE:NOROOT:REORDER(1)
  186. LPTIM1_IRQHandler
  187. B LPTIM1_IRQHandler
  188. PUBWEAK TIM2_IRQHandler
  189. SECTION .text:CODE:NOROOT:REORDER(1)
  190. TIM2_IRQHandler
  191. B TIM2_IRQHandler
  192. PUBWEAK TIM6_DAC_IRQHandler
  193. SECTION .text:CODE:NOROOT:REORDER(1)
  194. TIM6_DAC_IRQHandler
  195. B TIM6_DAC_IRQHandler
  196. PUBWEAK TIM21_IRQHandler
  197. SECTION .text:CODE:NOROOT:REORDER(1)
  198. TIM21_IRQHandler
  199. B TIM21_IRQHandler
  200. PUBWEAK TIM22_IRQHandler
  201. SECTION .text:CODE:NOROOT:REORDER(1)
  202. TIM22_IRQHandler
  203. B TIM22_IRQHandler
  204. PUBWEAK I2C1_IRQHandler
  205. SECTION .text:CODE:NOROOT:REORDER(1)
  206. I2C1_IRQHandler
  207. B I2C1_IRQHandler
  208. PUBWEAK I2C2_IRQHandler
  209. SECTION .text:CODE:NOROOT:REORDER(1)
  210. I2C2_IRQHandler
  211. B I2C2_IRQHandler
  212. PUBWEAK SPI1_IRQHandler
  213. SECTION .text:CODE:NOROOT:REORDER(1)
  214. SPI1_IRQHandler
  215. B SPI1_IRQHandler
  216. PUBWEAK SPI2_IRQHandler
  217. SECTION .text:CODE:NOROOT:REORDER(1)
  218. SPI2_IRQHandler
  219. B SPI2_IRQHandler
  220. PUBWEAK USART1_IRQHandler
  221. SECTION .text:CODE:NOROOT:REORDER(1)
  222. USART1_IRQHandler
  223. B USART1_IRQHandler
  224. PUBWEAK USART2_IRQHandler
  225. SECTION .text:CODE:NOROOT:REORDER(1)
  226. USART2_IRQHandler
  227. B USART2_IRQHandler
  228. PUBWEAK RNG_LPUART1_IRQHandler
  229. SECTION .text:CODE:NOROOT:REORDER(1)
  230. RNG_LPUART1_IRQHandler
  231. B RNG_LPUART1_IRQHandler
  232. PUBWEAK LCD_IRQHandler
  233. SECTION .text:CODE:NOROOT:REORDER(1)
  234. LCD_IRQHandler
  235. B LCD_IRQHandler
  236. PUBWEAK USB_IRQHandler
  237. SECTION .text:CODE:NOROOT:REORDER(1)
  238. USB_IRQHandler
  239. B USB_IRQHandler
  240. END