startup_stm32f030x6.s 8.4 KB

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