startup_stm32f102x6.s 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. ;******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f102x6.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32F102x6 USB Line Devices vector table for EWARM
  5. ;* toolchain.
  6. ;* This module performs:
  7. ;* - Set the initial SP
  8. ;* - Configure the clock system
  9. ;* - Set the initial PC == __iar_program_start,
  10. ;* - Set the vector table entries with the exceptions ISR
  11. ;* address.
  12. ;* After Reset the Cortex-M3 processor is in Thread mode,
  13. ;* priority is Privileged, and the Stack is set to Main.
  14. ;********************************************************************************
  15. ;*
  16. ;* Copyright (c) 2017-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. ;
  26. ; The modules in this file are included in the libraries, and may be replaced
  27. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  28. ; a user defined start symbol.
  29. ; To override the cstartup defined in the library, simply add your modified
  30. ; version to the workbench project.
  31. ;
  32. ; The vector table is normally located at address 0.
  33. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  34. ; The name "__vector_table" has special meaning for C-SPY:
  35. ; it is where the SP start value is found, and the NVIC vector
  36. ; table register (VTOR) is initialized to this address if != 0.
  37. ;
  38. ; Cortex-M version
  39. ;
  40. MODULE ?cstartup
  41. ;; Forward declaration of sections.
  42. SECTION CSTACK:DATA:NOROOT(3)
  43. SECTION .intvec:CODE:NOROOT(2)
  44. EXTERN __iar_program_start
  45. EXTERN SystemInit
  46. PUBLIC __vector_table
  47. DATA
  48. __vector_table
  49. DCD sfe(CSTACK)
  50. DCD Reset_Handler ; Reset Handler
  51. DCD NMI_Handler ; NMI Handler
  52. DCD HardFault_Handler ; Hard Fault Handler
  53. DCD MemManage_Handler ; MPU Fault Handler
  54. DCD BusFault_Handler ; Bus Fault Handler
  55. DCD UsageFault_Handler ; Usage Fault Handler
  56. DCD 0 ; Reserved
  57. DCD 0 ; Reserved
  58. DCD 0 ; Reserved
  59. DCD 0 ; Reserved
  60. DCD SVC_Handler ; SVCall Handler
  61. DCD DebugMon_Handler ; Debug Monitor Handler
  62. DCD 0 ; Reserved
  63. DCD PendSV_Handler ; PendSV Handler
  64. DCD SysTick_Handler ; SysTick Handler
  65. ; External Interrupts
  66. DCD WWDG_IRQHandler ; Window Watchdog
  67. DCD PVD_IRQHandler ; PVD through EXTI Line detect
  68. DCD TAMPER_IRQHandler ; Tamper
  69. DCD RTC_IRQHandler ; RTC
  70. DCD FLASH_IRQHandler ; Flash
  71. DCD RCC_IRQHandler ; RCC
  72. DCD EXTI0_IRQHandler ; EXTI Line 0
  73. DCD EXTI1_IRQHandler ; EXTI Line 1
  74. DCD EXTI2_IRQHandler ; EXTI Line 2
  75. DCD EXTI3_IRQHandler ; EXTI Line 3
  76. DCD EXTI4_IRQHandler ; EXTI Line 4
  77. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  78. DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
  79. DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
  80. DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
  81. DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
  82. DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
  83. DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
  84. DCD ADC1_IRQHandler ; ADC1
  85. DCD USB_HP_IRQHandler ; USB High Priority
  86. DCD USB_LP_IRQHandler ; USB Low Priority
  87. DCD 0 ; Reserved
  88. DCD 0 ; Reserved
  89. DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
  90. DCD 0 ; Reserved
  91. DCD 0 ; Reserved
  92. DCD 0 ; Reserved
  93. DCD 0 ; Reserved
  94. DCD TIM2_IRQHandler ; TIM2
  95. DCD TIM3_IRQHandler ; TIM3
  96. DCD 0 ; Reserved
  97. DCD I2C1_EV_IRQHandler ; I2C1 Event
  98. DCD I2C1_ER_IRQHandler ; I2C1 Error
  99. DCD 0 ; Reserved
  100. DCD 0 ; Reserved
  101. DCD SPI1_IRQHandler ; SPI1
  102. DCD 0 ; Reserved
  103. DCD USART1_IRQHandler ; USART1
  104. DCD USART2_IRQHandler ; USART2
  105. DCD 0 ; Reserved
  106. DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
  107. DCD RTC_Alarm_IRQHandler ; RTC Alarm through EXTI Line
  108. DCD USBWakeUp_IRQHandler ; USB Wakeup from suspend
  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 MemManage_Handler
  130. SECTION .text:CODE:REORDER:NOROOT(1)
  131. MemManage_Handler
  132. B MemManage_Handler
  133. PUBWEAK BusFault_Handler
  134. SECTION .text:CODE:REORDER:NOROOT(1)
  135. BusFault_Handler
  136. B BusFault_Handler
  137. PUBWEAK UsageFault_Handler
  138. SECTION .text:CODE:REORDER:NOROOT(1)
  139. UsageFault_Handler
  140. B UsageFault_Handler
  141. PUBWEAK SVC_Handler
  142. SECTION .text:CODE:REORDER:NOROOT(1)
  143. SVC_Handler
  144. B SVC_Handler
  145. PUBWEAK DebugMon_Handler
  146. SECTION .text:CODE:REORDER:NOROOT(1)
  147. DebugMon_Handler
  148. B DebugMon_Handler
  149. PUBWEAK PendSV_Handler
  150. SECTION .text:CODE:REORDER:NOROOT(1)
  151. PendSV_Handler
  152. B PendSV_Handler
  153. PUBWEAK SysTick_Handler
  154. SECTION .text:CODE:REORDER:NOROOT(1)
  155. SysTick_Handler
  156. B SysTick_Handler
  157. PUBWEAK WWDG_IRQHandler
  158. SECTION .text:CODE:REORDER:NOROOT(1)
  159. WWDG_IRQHandler
  160. B WWDG_IRQHandler
  161. PUBWEAK PVD_IRQHandler
  162. SECTION .text:CODE:REORDER:NOROOT(1)
  163. PVD_IRQHandler
  164. B PVD_IRQHandler
  165. PUBWEAK TAMPER_IRQHandler
  166. SECTION .text:CODE:REORDER:NOROOT(1)
  167. TAMPER_IRQHandler
  168. B TAMPER_IRQHandler
  169. PUBWEAK RTC_IRQHandler
  170. SECTION .text:CODE:REORDER:NOROOT(1)
  171. RTC_IRQHandler
  172. B RTC_IRQHandler
  173. PUBWEAK FLASH_IRQHandler
  174. SECTION .text:CODE:REORDER:NOROOT(1)
  175. FLASH_IRQHandler
  176. B FLASH_IRQHandler
  177. PUBWEAK RCC_IRQHandler
  178. SECTION .text:CODE:REORDER:NOROOT(1)
  179. RCC_IRQHandler
  180. B RCC_IRQHandler
  181. PUBWEAK EXTI0_IRQHandler
  182. SECTION .text:CODE:REORDER:NOROOT(1)
  183. EXTI0_IRQHandler
  184. B EXTI0_IRQHandler
  185. PUBWEAK EXTI1_IRQHandler
  186. SECTION .text:CODE:REORDER:NOROOT(1)
  187. EXTI1_IRQHandler
  188. B EXTI1_IRQHandler
  189. PUBWEAK EXTI2_IRQHandler
  190. SECTION .text:CODE:REORDER:NOROOT(1)
  191. EXTI2_IRQHandler
  192. B EXTI2_IRQHandler
  193. PUBWEAK EXTI3_IRQHandler
  194. SECTION .text:CODE:REORDER:NOROOT(1)
  195. EXTI3_IRQHandler
  196. B EXTI3_IRQHandler
  197. PUBWEAK EXTI4_IRQHandler
  198. SECTION .text:CODE:REORDER:NOROOT(1)
  199. EXTI4_IRQHandler
  200. B EXTI4_IRQHandler
  201. PUBWEAK DMA1_Channel1_IRQHandler
  202. SECTION .text:CODE:REORDER:NOROOT(1)
  203. DMA1_Channel1_IRQHandler
  204. B DMA1_Channel1_IRQHandler
  205. PUBWEAK DMA1_Channel2_IRQHandler
  206. SECTION .text:CODE:REORDER:NOROOT(1)
  207. DMA1_Channel2_IRQHandler
  208. B DMA1_Channel2_IRQHandler
  209. PUBWEAK DMA1_Channel3_IRQHandler
  210. SECTION .text:CODE:REORDER:NOROOT(1)
  211. DMA1_Channel3_IRQHandler
  212. B DMA1_Channel3_IRQHandler
  213. PUBWEAK DMA1_Channel4_IRQHandler
  214. SECTION .text:CODE:REORDER:NOROOT(1)
  215. DMA1_Channel4_IRQHandler
  216. B DMA1_Channel4_IRQHandler
  217. PUBWEAK DMA1_Channel5_IRQHandler
  218. SECTION .text:CODE:REORDER:NOROOT(1)
  219. DMA1_Channel5_IRQHandler
  220. B DMA1_Channel5_IRQHandler
  221. PUBWEAK DMA1_Channel6_IRQHandler
  222. SECTION .text:CODE:REORDER:NOROOT(1)
  223. DMA1_Channel6_IRQHandler
  224. B DMA1_Channel6_IRQHandler
  225. PUBWEAK DMA1_Channel7_IRQHandler
  226. SECTION .text:CODE:REORDER:NOROOT(1)
  227. DMA1_Channel7_IRQHandler
  228. B DMA1_Channel7_IRQHandler
  229. PUBWEAK ADC1_IRQHandler
  230. SECTION .text:CODE:REORDER:NOROOT(1)
  231. ADC1_IRQHandler
  232. B ADC1_IRQHandler
  233. PUBWEAK USB_HP_IRQHandler
  234. SECTION .text:CODE:REORDER:NOROOT(1)
  235. USB_HP_IRQHandler
  236. B USB_HP_IRQHandler
  237. PUBWEAK USB_LP_IRQHandler
  238. SECTION .text:CODE:REORDER:NOROOT(1)
  239. USB_LP_IRQHandler
  240. B USB_LP_IRQHandler
  241. PUBWEAK EXTI9_5_IRQHandler
  242. SECTION .text:CODE:REORDER:NOROOT(1)
  243. EXTI9_5_IRQHandler
  244. B EXTI9_5_IRQHandler
  245. PUBWEAK TIM2_IRQHandler
  246. SECTION .text:CODE:REORDER:NOROOT(1)
  247. TIM2_IRQHandler
  248. B TIM2_IRQHandler
  249. PUBWEAK TIM3_IRQHandler
  250. SECTION .text:CODE:REORDER:NOROOT(1)
  251. TIM3_IRQHandler
  252. B TIM3_IRQHandler
  253. PUBWEAK I2C1_EV_IRQHandler
  254. SECTION .text:CODE:REORDER:NOROOT(1)
  255. I2C1_EV_IRQHandler
  256. B I2C1_EV_IRQHandler
  257. PUBWEAK I2C1_ER_IRQHandler
  258. SECTION .text:CODE:REORDER:NOROOT(1)
  259. I2C1_ER_IRQHandler
  260. B I2C1_ER_IRQHandler
  261. PUBWEAK SPI1_IRQHandler
  262. SECTION .text:CODE:REORDER:NOROOT(1)
  263. SPI1_IRQHandler
  264. B SPI1_IRQHandler
  265. PUBWEAK USART1_IRQHandler
  266. SECTION .text:CODE:REORDER:NOROOT(1)
  267. USART1_IRQHandler
  268. B USART1_IRQHandler
  269. PUBWEAK USART2_IRQHandler
  270. SECTION .text:CODE:REORDER:NOROOT(1)
  271. USART2_IRQHandler
  272. B USART2_IRQHandler
  273. PUBWEAK EXTI15_10_IRQHandler
  274. SECTION .text:CODE:REORDER:NOROOT(1)
  275. EXTI15_10_IRQHandler
  276. B EXTI15_10_IRQHandler
  277. PUBWEAK RTC_Alarm_IRQHandler
  278. SECTION .text:CODE:REORDER:NOROOT(1)
  279. RTC_Alarm_IRQHandler
  280. B RTC_Alarm_IRQHandler
  281. PUBWEAK USBWakeUp_IRQHandler
  282. SECTION .text:CODE:REORDER:NOROOT(1)
  283. USBWakeUp_IRQHandler
  284. B USBWakeUp_IRQHandler
  285. END