startup_py32f030xx.s 9.5 KB

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