You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

342 lines
11 KiB

  1. ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
  2. ;* File Name : startup_stm32l072xx.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32L072xx 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. ;*
  17. ;* Redistribution and use in source and binary forms, with or without modification,
  18. ;* are permitted provided that the following conditions are met:
  19. ;* 1. Redistributions of source code must retain the above copyright notice,
  20. ;* this list of conditions and the following disclaimer.
  21. ;* 2. Redistributions in binary form must reproduce the above copyright notice,
  22. ;* this list of conditions and the following disclaimer in the documentation
  23. ;* and/or other materials provided with the distribution.
  24. ;* 3. Neither the name of STMicroelectronics nor the names of its contributors
  25. ;* may be used to endorse or promote products derived from this software
  26. ;* without specific prior written permission.
  27. ;*
  28. ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  32. ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  34. ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  35. ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  36. ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. ;*
  39. ;*******************************************************************************/
  40. ;
  41. ;
  42. ; The modules in this file are included in the libraries, and may be replaced
  43. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  44. ; a user defined start symbol.
  45. ; To override the cstartup defined in the library, simply add your modified
  46. ; version to the workbench project.
  47. ;
  48. ; The vector table is normally located at address 0.
  49. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  50. ; The name "__vector_table" has special meaning for C-SPY:
  51. ; it is where the SP start value is found, and the NVIC vector
  52. ; table register (VTOR) is initialized to this address if != 0.
  53. ;
  54. ; Cortex-M version
  55. ;
  56. MODULE ?cstartup
  57. ;; Forward declaration of sections.
  58. SECTION CSTACK:DATA:NOROOT(3)
  59. SECTION .intvec:CODE:NOROOT(2)
  60. EXTERN __iar_program_start
  61. EXTERN SystemInit
  62. PUBLIC __vector_table
  63. DATA
  64. __vector_table
  65. DCD sfe(CSTACK)
  66. DCD Reset_Handler ; Reset Handler
  67. DCD NMI_Handler ; NMI Handler
  68. DCD HardFault_Handler ; Hard Fault Handler
  69. DCD 0 ; Reserved
  70. DCD 0 ; Reserved
  71. DCD 0 ; Reserved
  72. DCD 0 ; Reserved
  73. DCD 0 ; Reserved
  74. DCD 0 ; Reserved
  75. DCD 0 ; Reserved
  76. DCD SVC_Handler ; SVCall Handler
  77. DCD 0 ; Reserved
  78. DCD 0 ; Reserved
  79. DCD PendSV_Handler ; PendSV Handler
  80. DCD SysTick_Handler ; SysTick Handler
  81. ; External Interrupts
  82. DCD WWDG_IRQHandler ; Window Watchdog
  83. DCD PVD_IRQHandler ; PVD through EXTI Line detect
  84. DCD RTC_IRQHandler ; RTC through EXTI Line
  85. DCD FLASH_IRQHandler ; FLASH
  86. DCD RCC_CRS_IRQHandler ; RCC_CRS
  87. DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
  88. DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
  89. DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
  90. DCD TSC_IRQHandler ; TSC
  91. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  92. DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
  93. DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7
  94. DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2
  95. DCD LPTIM1_IRQHandler ; LPTIM1
  96. DCD USART4_5_IRQHandler ; USART4 and USART5
  97. DCD TIM2_IRQHandler ; TIM2
  98. DCD TIM3_IRQHandler ; TIM3
  99. DCD TIM6_DAC_IRQHandler ; TIM6 and DAC
  100. DCD TIM7_IRQHandler ; TIM7
  101. DCD 0 ; Reserved
  102. DCD TIM21_IRQHandler ; TIM21
  103. DCD I2C3_IRQHandler ; I2C3
  104. DCD TIM22_IRQHandler ; TIM22
  105. DCD I2C1_IRQHandler ; I2C1
  106. DCD I2C2_IRQHandler ; I2C2
  107. DCD SPI1_IRQHandler ; SPI1
  108. DCD SPI2_IRQHandler ; SPI2
  109. DCD USART1_IRQHandler ; USART1
  110. DCD USART2_IRQHandler ; USART2
  111. DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1
  112. DCD 0 ; Reserved
  113. DCD USB_IRQHandler ; USB
  114. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  115. ;;
  116. ;; Default interrupt handlers.
  117. ;;
  118. THUMB
  119. PUBWEAK Reset_Handler
  120. SECTION .text:CODE:NOROOT:REORDER(2)
  121. Reset_Handler
  122. LDR R0, =SystemInit
  123. BLX R0
  124. LDR R0, =__iar_program_start
  125. BX R0
  126. PUBWEAK NMI_Handler
  127. SECTION .text:CODE:NOROOT:REORDER(1)
  128. NMI_Handler
  129. B NMI_Handler
  130. PUBWEAK HardFault_Handler
  131. SECTION .text:CODE:NOROOT:REORDER(1)
  132. HardFault_Handler
  133. B HardFault_Handler
  134. PUBWEAK SVC_Handler
  135. SECTION .text:CODE:NOROOT:REORDER(1)
  136. SVC_Handler
  137. B SVC_Handler
  138. PUBWEAK PendSV_Handler
  139. SECTION .text:CODE:NOROOT:REORDER(1)
  140. PendSV_Handler
  141. B PendSV_Handler
  142. PUBWEAK SysTick_Handler
  143. SECTION .text:CODE:NOROOT:REORDER(1)
  144. SysTick_Handler
  145. B SysTick_Handler
  146. PUBWEAK WWDG_IRQHandler
  147. SECTION .text:CODE:NOROOT:REORDER(1)
  148. WWDG_IRQHandler
  149. B WWDG_IRQHandler
  150. PUBWEAK PVD_IRQHandler
  151. SECTION .text:CODE:NOROOT:REORDER(1)
  152. PVD_IRQHandler
  153. B PVD_IRQHandler
  154. PUBWEAK RTC_IRQHandler
  155. SECTION .text:CODE:NOROOT:REORDER(1)
  156. RTC_IRQHandler
  157. B RTC_IRQHandler
  158. PUBWEAK FLASH_IRQHandler
  159. SECTION .text:CODE:NOROOT:REORDER(1)
  160. FLASH_IRQHandler
  161. B FLASH_IRQHandler
  162. PUBWEAK RCC_CRS_IRQHandler
  163. SECTION .text:CODE:NOROOT:REORDER(1)
  164. RCC_CRS_IRQHandler
  165. B RCC_CRS_IRQHandler
  166. PUBWEAK EXTI0_1_IRQHandler
  167. SECTION .text:CODE:NOROOT:REORDER(1)
  168. EXTI0_1_IRQHandler
  169. B EXTI0_1_IRQHandler
  170. PUBWEAK EXTI2_3_IRQHandler
  171. SECTION .text:CODE:NOROOT:REORDER(1)
  172. EXTI2_3_IRQHandler
  173. B EXTI2_3_IRQHandler
  174. PUBWEAK EXTI4_15_IRQHandler
  175. SECTION .text:CODE:NOROOT:REORDER(1)
  176. EXTI4_15_IRQHandler
  177. B EXTI4_15_IRQHandler
  178. PUBWEAK TSC_IRQHandler
  179. SECTION .text:CODE:NOROOT:REORDER(1)
  180. TSC_IRQHandler
  181. B TSC_IRQHandler
  182. PUBWEAK DMA1_Channel1_IRQHandler
  183. SECTION .text:CODE:NOROOT:REORDER(1)
  184. DMA1_Channel1_IRQHandler
  185. B DMA1_Channel1_IRQHandler
  186. PUBWEAK DMA1_Channel2_3_IRQHandler
  187. SECTION .text:CODE:NOROOT:REORDER(1)
  188. DMA1_Channel2_3_IRQHandler
  189. B DMA1_Channel2_3_IRQHandler
  190. PUBWEAK DMA1_Channel4_5_6_7_IRQHandler
  191. SECTION .text:CODE:NOROOT:REORDER(1)
  192. DMA1_Channel4_5_6_7_IRQHandler
  193. B DMA1_Channel4_5_6_7_IRQHandler
  194. PUBWEAK ADC1_COMP_IRQHandler
  195. SECTION .text:CODE:NOROOT:REORDER(1)
  196. ADC1_COMP_IRQHandler
  197. B ADC1_COMP_IRQHandler
  198. PUBWEAK LPTIM1_IRQHandler
  199. SECTION .text:CODE:NOROOT:REORDER(1)
  200. LPTIM1_IRQHandler
  201. B LPTIM1_IRQHandler
  202. PUBWEAK USART4_5_IRQHandler
  203. SECTION .text:CODE:NOROOT:REORDER(1)
  204. USART4_5_IRQHandler
  205. B USART4_5_IRQHandler
  206. PUBWEAK TIM2_IRQHandler
  207. SECTION .text:CODE:NOROOT:REORDER(1)
  208. TIM2_IRQHandler
  209. B TIM2_IRQHandler
  210. PUBWEAK TIM3_IRQHandler
  211. SECTION .text:CODE:NOROOT:REORDER(1)
  212. TIM3_IRQHandler
  213. B TIM3_IRQHandler
  214. PUBWEAK TIM6_DAC_IRQHandler
  215. SECTION .text:CODE:NOROOT:REORDER(1)
  216. TIM6_DAC_IRQHandler
  217. B TIM6_DAC_IRQHandler
  218. PUBWEAK TIM7_IRQHandler
  219. SECTION .text:CODE:NOROOT:REORDER(1)
  220. TIM7_IRQHandler
  221. B TIM7_IRQHandler
  222. PUBWEAK TIM21_IRQHandler
  223. SECTION .text:CODE:NOROOT:REORDER(1)
  224. TIM21_IRQHandler
  225. B TIM21_IRQHandler
  226. PUBWEAK I2C3_IRQHandler
  227. SECTION .text:CODE:NOROOT:REORDER(1)
  228. I2C3_IRQHandler
  229. B I2C3_IRQHandler
  230. PUBWEAK TIM22_IRQHandler
  231. SECTION .text:CODE:NOROOT:REORDER(1)
  232. TIM22_IRQHandler
  233. B TIM22_IRQHandler
  234. PUBWEAK I2C1_IRQHandler
  235. SECTION .text:CODE:NOROOT:REORDER(1)
  236. I2C1_IRQHandler
  237. B I2C1_IRQHandler
  238. PUBWEAK I2C2_IRQHandler
  239. SECTION .text:CODE:NOROOT:REORDER(1)
  240. I2C2_IRQHandler
  241. B I2C2_IRQHandler
  242. PUBWEAK SPI1_IRQHandler
  243. SECTION .text:CODE:NOROOT:REORDER(1)
  244. SPI1_IRQHandler
  245. B SPI1_IRQHandler
  246. PUBWEAK SPI2_IRQHandler
  247. SECTION .text:CODE:NOROOT:REORDER(1)
  248. SPI2_IRQHandler
  249. B SPI2_IRQHandler
  250. PUBWEAK USART1_IRQHandler
  251. SECTION .text:CODE:NOROOT:REORDER(1)
  252. USART1_IRQHandler
  253. B USART1_IRQHandler
  254. PUBWEAK USART2_IRQHandler
  255. SECTION .text:CODE:NOROOT:REORDER(1)
  256. USART2_IRQHandler
  257. B USART2_IRQHandler
  258. PUBWEAK RNG_LPUART1_IRQHandler
  259. SECTION .text:CODE:NOROOT:REORDER(1)
  260. RNG_LPUART1_IRQHandler
  261. B RNG_LPUART1_IRQHandler
  262. PUBWEAK USB_IRQHandler
  263. SECTION .text:CODE:NOROOT:REORDER(1)
  264. USB_IRQHandler
  265. B USB_IRQHandler
  266. END
  267. ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****