startup_stm32g030xx.s 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. ;******************************************************************************
  2. ;* File Name : startup_stm32g030xx.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32G030xx devices vector table for EWARM toolchain.
  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. ;* - Branches to main in the C library (which eventually
  11. ;* calls main()).
  12. ;* After Reset the Cortex-M0+ processor is in Thread mode,
  13. ;* priority is Privileged, and the Stack is set to Main.
  14. ;********************************************************************************
  15. ;*
  16. ;* Copyright (c) 2018-2021 STMicroelectronics.
  17. ;* All rights reserved.
  18. ;*
  19. ;* This software is licensed under terms that can be found in the LICENSE file
  20. ;* in the root directory of this software component.
  21. ;* If no LICENSE file comes with this software, it is provided AS-IS.
  22. ;
  23. ;*******************************************************************************
  24. ;
  25. ; The modules in this file are included in the libraries, and may be replaced
  26. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  27. ; a user defined start symbol.
  28. ; To override the cstartup defined in the library, simply add your modified
  29. ; version to the workbench project.
  30. ;
  31. ; The vector table is normally located at address 0.
  32. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  33. ; The name "__vector_table" has special meaning for C-SPY:
  34. ; it is where the SP start value is found, and the NVIC vector
  35. ; table register (VTOR) is initialized to this address if != 0.
  36. ;
  37. ; Cortex-M version
  38. ;
  39. MODULE ?cstartup
  40. ;; Forward declaration of sections.
  41. SECTION CSTACK:DATA:NOROOT(3)
  42. SECTION .intvec:CODE:NOROOT(2)
  43. EXTERN __iar_program_start
  44. EXTERN SystemInit
  45. PUBLIC __vector_table
  46. DATA
  47. __vector_table
  48. DCD sfe(CSTACK)
  49. DCD Reset_Handler ; Reset Handler
  50. DCD NMI_Handler ; NMI Handler
  51. DCD HardFault_Handler ; Hard Fault Handler
  52. DCD 0 ; Reserved
  53. DCD 0 ; Reserved
  54. DCD 0 ; Reserved
  55. DCD 0 ; Reserved
  56. DCD 0 ; Reserved
  57. DCD 0 ; Reserved
  58. DCD 0 ; Reserved
  59. DCD SVC_Handler ; SVCall Handler
  60. DCD 0 ; Reserved
  61. DCD 0 ; Reserved
  62. DCD PendSV_Handler ; PendSV Handler
  63. DCD SysTick_Handler ; SysTick Handler
  64. ; External Interrupts
  65. DCD WWDG_IRQHandler ; Window Watchdog
  66. DCD 0 ; Reserved
  67. DCD RTC_TAMP_IRQHandler ; RTC through EXTI Line
  68. DCD FLASH_IRQHandler ; FLASH
  69. DCD RCC_IRQHandler ; RCC
  70. DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
  71. DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
  72. DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
  73. DCD 0 ; Reserved
  74. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  75. DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
  76. DCD DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler ; DMA1 Channel 4 and Channel 5 DMAMUX1 overrun
  77. DCD ADC1_IRQHandler ; ADC1
  78. DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
  79. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  80. DCD 0 ; Reserved
  81. DCD TIM3_IRQHandler ; TIM3
  82. DCD 0 ; Reserved
  83. DCD 0 ; Reserved
  84. DCD TIM14_IRQHandler ; TIM14
  85. DCD 0 ; Reserved
  86. DCD TIM16_IRQHandler ; TIM16
  87. DCD TIM17_IRQHandler ; TIM17
  88. DCD I2C1_IRQHandler ; I2C1
  89. DCD I2C2_IRQHandler ; I2C2
  90. DCD SPI1_IRQHandler ; SPI1
  91. DCD SPI2_IRQHandler ; SPI2
  92. DCD USART1_IRQHandler ; USART1
  93. DCD USART2_IRQHandler ; USART2
  94. DCD 0 ; Reserved
  95. DCD 0 ; Reserved
  96. DCD 0 ; Reserved
  97. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  98. ;;
  99. ;; Default interrupt handlers.
  100. ;;
  101. THUMB
  102. PUBWEAK Reset_Handler
  103. SECTION .text:CODE:NOROOT:REORDER(2)
  104. Reset_Handler
  105. LDR R0, =SystemInit
  106. BLX R0
  107. LDR R0, =__iar_program_start
  108. BX R0
  109. PUBWEAK NMI_Handler
  110. SECTION .text:CODE:NOROOT:REORDER(1)
  111. NMI_Handler
  112. B NMI_Handler
  113. PUBWEAK HardFault_Handler
  114. SECTION .text:CODE:NOROOT:REORDER(1)
  115. HardFault_Handler
  116. B HardFault_Handler
  117. PUBWEAK SVC_Handler
  118. SECTION .text:CODE:NOROOT:REORDER(1)
  119. SVC_Handler
  120. B SVC_Handler
  121. PUBWEAK PendSV_Handler
  122. SECTION .text:CODE:NOROOT:REORDER(1)
  123. PendSV_Handler
  124. B PendSV_Handler
  125. PUBWEAK SysTick_Handler
  126. SECTION .text:CODE:NOROOT:REORDER(1)
  127. SysTick_Handler
  128. B SysTick_Handler
  129. PUBWEAK WWDG_IRQHandler
  130. SECTION .text:CODE:NOROOT:REORDER(1)
  131. WWDG_IRQHandler
  132. B WWDG_IRQHandler
  133. PUBWEAK RTC_TAMP_IRQHandler
  134. SECTION .text:CODE:NOROOT:REORDER(1)
  135. RTC_TAMP_IRQHandler
  136. B RTC_TAMP_IRQHandler
  137. PUBWEAK FLASH_IRQHandler
  138. SECTION .text:CODE:NOROOT:REORDER(1)
  139. FLASH_IRQHandler
  140. B FLASH_IRQHandler
  141. PUBWEAK RCC_IRQHandler
  142. SECTION .text:CODE:NOROOT:REORDER(1)
  143. RCC_IRQHandler
  144. B RCC_IRQHandler
  145. PUBWEAK EXTI0_1_IRQHandler
  146. SECTION .text:CODE:NOROOT:REORDER(1)
  147. EXTI0_1_IRQHandler
  148. B EXTI0_1_IRQHandler
  149. PUBWEAK EXTI2_3_IRQHandler
  150. SECTION .text:CODE:NOROOT:REORDER(1)
  151. EXTI2_3_IRQHandler
  152. B EXTI2_3_IRQHandler
  153. PUBWEAK EXTI4_15_IRQHandler
  154. SECTION .text:CODE:NOROOT:REORDER(1)
  155. EXTI4_15_IRQHandler
  156. B EXTI4_15_IRQHandler
  157. PUBWEAK DMA1_Channel1_IRQHandler
  158. SECTION .text:CODE:NOROOT:REORDER(1)
  159. DMA1_Channel1_IRQHandler
  160. B DMA1_Channel1_IRQHandler
  161. PUBWEAK DMA1_Channel2_3_IRQHandler
  162. SECTION .text:CODE:NOROOT:REORDER(1)
  163. DMA1_Channel2_3_IRQHandler
  164. B DMA1_Channel2_3_IRQHandler
  165. PUBWEAK DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler
  166. SECTION .text:CODE:NOROOT:REORDER(1)
  167. DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler
  168. B DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler
  169. PUBWEAK ADC1_IRQHandler
  170. SECTION .text:CODE:NOROOT:REORDER(1)
  171. ADC1_IRQHandler
  172. B ADC1_IRQHandler
  173. PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler
  174. SECTION .text:CODE:NOROOT:REORDER(1)
  175. TIM1_BRK_UP_TRG_COM_IRQHandler
  176. B TIM1_BRK_UP_TRG_COM_IRQHandler
  177. PUBWEAK TIM1_CC_IRQHandler
  178. SECTION .text:CODE:NOROOT:REORDER(1)
  179. TIM1_CC_IRQHandler
  180. B TIM1_CC_IRQHandler
  181. PUBWEAK TIM3_IRQHandler
  182. SECTION .text:CODE:NOROOT:REORDER(1)
  183. TIM3_IRQHandler
  184. B TIM3_IRQHandler
  185. PUBWEAK TIM14_IRQHandler
  186. SECTION .text:CODE:NOROOT:REORDER(1)
  187. TIM14_IRQHandler
  188. B TIM14_IRQHandler
  189. PUBWEAK TIM16_IRQHandler
  190. SECTION .text:CODE:NOROOT:REORDER(1)
  191. TIM16_IRQHandler
  192. B TIM16_IRQHandler
  193. PUBWEAK TIM17_IRQHandler
  194. SECTION .text:CODE:NOROOT:REORDER(1)
  195. TIM17_IRQHandler
  196. B TIM17_IRQHandler
  197. PUBWEAK I2C1_IRQHandler
  198. SECTION .text:CODE:NOROOT:REORDER(1)
  199. I2C1_IRQHandler
  200. B I2C1_IRQHandler
  201. PUBWEAK I2C2_IRQHandler
  202. SECTION .text:CODE:NOROOT:REORDER(1)
  203. I2C2_IRQHandler
  204. B I2C2_IRQHandler
  205. PUBWEAK SPI1_IRQHandler
  206. SECTION .text:CODE:NOROOT:REORDER(1)
  207. SPI1_IRQHandler
  208. B SPI1_IRQHandler
  209. PUBWEAK SPI2_IRQHandler
  210. SECTION .text:CODE:NOROOT:REORDER(1)
  211. SPI2_IRQHandler
  212. B SPI2_IRQHandler
  213. PUBWEAK USART1_IRQHandler
  214. SECTION .text:CODE:NOROOT:REORDER(1)
  215. USART1_IRQHandler
  216. B USART1_IRQHandler
  217. PUBWEAK USART2_IRQHandler
  218. SECTION .text:CODE:NOROOT:REORDER(1)
  219. USART2_IRQHandler
  220. B USART2_IRQHandler
  221. END