startup_stm32f100xe.s 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  1. ;******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f100xe.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32F100xE Value Line Devices vector table
  5. ;* for EWARM toolchain.
  6. ;* This module performs:
  7. ;* - Set the initial SP
  8. ;* - Set the initial PC == __iar_program_start,
  9. ;* - Set the vector table entries with the exceptions ISR
  10. ;* address.
  11. ;* After Reset the Cortex-M3 processor is in Thread mode,
  12. ;* priority is Privileged, and the Stack is set to Main.
  13. ;********************************************************************************
  14. ;*
  15. ;* Copyright (c) 2017-2021 STMicroelectronics.
  16. ;* All rights reserved.
  17. ;*
  18. ;* This software is licensed under terms that can be found in the LICENSE file
  19. ;* in the root directory of this software component.
  20. ;* If no LICENSE file comes with this software, it is provided AS-IS.
  21. ;
  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 MemManage_Handler ; MPU Fault Handler
  53. DCD BusFault_Handler ; Bus Fault Handler
  54. DCD UsageFault_Handler ; Usage Fault Handler
  55. DCD 0 ; Reserved
  56. DCD 0 ; Reserved
  57. DCD 0 ; Reserved
  58. DCD 0 ; Reserved
  59. DCD SVC_Handler ; SVCall Handler
  60. DCD DebugMon_Handler ; Debug Monitor Handler
  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 PVD_IRQHandler ; PVD through EXTI Line detect
  67. DCD TAMPER_IRQHandler ; Tamper
  68. DCD RTC_IRQHandler ; RTC
  69. DCD FLASH_IRQHandler ; Flash
  70. DCD RCC_IRQHandler ; RCC
  71. DCD EXTI0_IRQHandler ; EXTI Line 0
  72. DCD EXTI1_IRQHandler ; EXTI Line 1
  73. DCD EXTI2_IRQHandler ; EXTI Line 2
  74. DCD EXTI3_IRQHandler ; EXTI Line 3
  75. DCD EXTI4_IRQHandler ; EXTI Line 4
  76. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  77. DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
  78. DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
  79. DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
  80. DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
  81. DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
  82. DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
  83. DCD ADC1_IRQHandler ; ADC1
  84. DCD 0 ; Reserved
  85. DCD 0 ; Reserved
  86. DCD 0 ; Reserved
  87. DCD 0 ; Reserved
  88. DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
  89. DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15
  90. DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16
  91. DCD TIM1_TRG_COM_TIM17_IRQHandler ; TIM1 Trigger and Commutation and TIM17
  92. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  93. DCD TIM2_IRQHandler ; TIM2
  94. DCD TIM3_IRQHandler ; TIM3
  95. DCD TIM4_IRQHandler ; TIM4
  96. DCD I2C1_EV_IRQHandler ; I2C1 Event
  97. DCD I2C1_ER_IRQHandler ; I2C1 Error
  98. DCD I2C2_EV_IRQHandler ; I2C2 Event
  99. DCD I2C2_ER_IRQHandler ; I2C2 Error
  100. DCD SPI1_IRQHandler ; SPI1
  101. DCD SPI2_IRQHandler ; SPI2
  102. DCD USART1_IRQHandler ; USART1
  103. DCD USART2_IRQHandler ; USART2
  104. DCD USART3_IRQHandler ; USART3
  105. DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
  106. DCD RTC_Alarm_IRQHandler ; RTC Alarm through EXTI Line
  107. DCD CEC_IRQHandler ; HDMI CEC
  108. DCD TIM12_IRQHandler ; TIM12
  109. DCD TIM13_IRQHandler ; TIM13
  110. DCD TIM14_IRQHandler ; TIM14
  111. DCD 0 ; Reserved
  112. DCD 0 ; Reserved
  113. DCD 0 ; Reserved
  114. DCD 0 ; Reserved
  115. DCD TIM5_IRQHandler ; TIM5
  116. DCD SPI3_IRQHandler ; SPI3
  117. DCD UART4_IRQHandler ; UART4
  118. DCD UART5_IRQHandler ; UART5
  119. DCD TIM6_DAC_IRQHandler ; TIM6 and DAC underrun
  120. DCD TIM7_IRQHandler ; TIM7
  121. DCD DMA2_Channel1_IRQHandler ; DMA2 Channel1
  122. DCD DMA2_Channel2_IRQHandler ; DMA2 Channel2
  123. DCD DMA2_Channel3_IRQHandler ; DMA2 Channel3
  124. DCD DMA2_Channel4_5_IRQHandler ; DMA2 Channel4 & Channel5 if MISC_REMAP is not set
  125. ; or DMA2 Channel4 if MISC_REMAP is set
  126. DCD DMA2_Channel5_IRQHandler ; DMA2 Channel5 if MISC_REMAP is set
  127. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  128. ;;
  129. ;; Default interrupt handlers.
  130. ;;
  131. THUMB
  132. PUBWEAK Reset_Handler
  133. SECTION .text:CODE:REORDER:NOROOT(2)
  134. Reset_Handler
  135. LDR R0, =SystemInit
  136. BLX R0
  137. LDR R0, =__iar_program_start
  138. BX R0
  139. PUBWEAK NMI_Handler
  140. SECTION .text:CODE:REORDER:NOROOT(1)
  141. NMI_Handler
  142. B NMI_Handler
  143. PUBWEAK HardFault_Handler
  144. SECTION .text:CODE:REORDER:NOROOT(1)
  145. HardFault_Handler
  146. B HardFault_Handler
  147. PUBWEAK MemManage_Handler
  148. SECTION .text:CODE:REORDER:NOROOT(1)
  149. MemManage_Handler
  150. B MemManage_Handler
  151. PUBWEAK BusFault_Handler
  152. SECTION .text:CODE:REORDER:NOROOT(1)
  153. BusFault_Handler
  154. B BusFault_Handler
  155. PUBWEAK UsageFault_Handler
  156. SECTION .text:CODE:REORDER:NOROOT(1)
  157. UsageFault_Handler
  158. B UsageFault_Handler
  159. PUBWEAK SVC_Handler
  160. SECTION .text:CODE:REORDER:NOROOT(1)
  161. SVC_Handler
  162. B SVC_Handler
  163. PUBWEAK DebugMon_Handler
  164. SECTION .text:CODE:REORDER:NOROOT(1)
  165. DebugMon_Handler
  166. B DebugMon_Handler
  167. PUBWEAK PendSV_Handler
  168. SECTION .text:CODE:REORDER:NOROOT(1)
  169. PendSV_Handler
  170. B PendSV_Handler
  171. PUBWEAK SysTick_Handler
  172. SECTION .text:CODE:REORDER:NOROOT(1)
  173. SysTick_Handler
  174. B SysTick_Handler
  175. PUBWEAK WWDG_IRQHandler
  176. SECTION .text:CODE:REORDER:NOROOT(1)
  177. WWDG_IRQHandler
  178. B WWDG_IRQHandler
  179. PUBWEAK PVD_IRQHandler
  180. SECTION .text:CODE:REORDER:NOROOT(1)
  181. PVD_IRQHandler
  182. B PVD_IRQHandler
  183. PUBWEAK TAMPER_IRQHandler
  184. SECTION .text:CODE:REORDER:NOROOT(1)
  185. TAMPER_IRQHandler
  186. B TAMPER_IRQHandler
  187. PUBWEAK RTC_IRQHandler
  188. SECTION .text:CODE:REORDER:NOROOT(1)
  189. RTC_IRQHandler
  190. B RTC_IRQHandler
  191. PUBWEAK FLASH_IRQHandler
  192. SECTION .text:CODE:REORDER:NOROOT(1)
  193. FLASH_IRQHandler
  194. B FLASH_IRQHandler
  195. PUBWEAK RCC_IRQHandler
  196. SECTION .text:CODE:REORDER:NOROOT(1)
  197. RCC_IRQHandler
  198. B RCC_IRQHandler
  199. PUBWEAK EXTI0_IRQHandler
  200. SECTION .text:CODE:REORDER:NOROOT(1)
  201. EXTI0_IRQHandler
  202. B EXTI0_IRQHandler
  203. PUBWEAK EXTI1_IRQHandler
  204. SECTION .text:CODE:REORDER:NOROOT(1)
  205. EXTI1_IRQHandler
  206. B EXTI1_IRQHandler
  207. PUBWEAK EXTI2_IRQHandler
  208. SECTION .text:CODE:REORDER:NOROOT(1)
  209. EXTI2_IRQHandler
  210. B EXTI2_IRQHandler
  211. PUBWEAK EXTI3_IRQHandler
  212. SECTION .text:CODE:REORDER:NOROOT(1)
  213. EXTI3_IRQHandler
  214. B EXTI3_IRQHandler
  215. PUBWEAK EXTI4_IRQHandler
  216. SECTION .text:CODE:REORDER:NOROOT(1)
  217. EXTI4_IRQHandler
  218. B EXTI4_IRQHandler
  219. PUBWEAK DMA1_Channel1_IRQHandler
  220. SECTION .text:CODE:REORDER:NOROOT(1)
  221. DMA1_Channel1_IRQHandler
  222. B DMA1_Channel1_IRQHandler
  223. PUBWEAK DMA1_Channel2_IRQHandler
  224. SECTION .text:CODE:REORDER:NOROOT(1)
  225. DMA1_Channel2_IRQHandler
  226. B DMA1_Channel2_IRQHandler
  227. PUBWEAK DMA1_Channel3_IRQHandler
  228. SECTION .text:CODE:REORDER:NOROOT(1)
  229. DMA1_Channel3_IRQHandler
  230. B DMA1_Channel3_IRQHandler
  231. PUBWEAK DMA1_Channel4_IRQHandler
  232. SECTION .text:CODE:REORDER:NOROOT(1)
  233. DMA1_Channel4_IRQHandler
  234. B DMA1_Channel4_IRQHandler
  235. PUBWEAK DMA1_Channel5_IRQHandler
  236. SECTION .text:CODE:REORDER:NOROOT(1)
  237. DMA1_Channel5_IRQHandler
  238. B DMA1_Channel5_IRQHandler
  239. PUBWEAK DMA1_Channel6_IRQHandler
  240. SECTION .text:CODE:REORDER:NOROOT(1)
  241. DMA1_Channel6_IRQHandler
  242. B DMA1_Channel6_IRQHandler
  243. PUBWEAK DMA1_Channel7_IRQHandler
  244. SECTION .text:CODE:REORDER:NOROOT(1)
  245. DMA1_Channel7_IRQHandler
  246. B DMA1_Channel7_IRQHandler
  247. PUBWEAK ADC1_IRQHandler
  248. SECTION .text:CODE:REORDER:NOROOT(1)
  249. ADC1_IRQHandler
  250. B ADC1_IRQHandler
  251. PUBWEAK EXTI9_5_IRQHandler
  252. SECTION .text:CODE:REORDER:NOROOT(1)
  253. EXTI9_5_IRQHandler
  254. B EXTI9_5_IRQHandler
  255. PUBWEAK TIM1_BRK_TIM15_IRQHandler
  256. SECTION .text:CODE:REORDER:NOROOT(1)
  257. TIM1_BRK_TIM15_IRQHandler
  258. B TIM1_BRK_TIM15_IRQHandler
  259. PUBWEAK TIM1_UP_TIM16_IRQHandler
  260. SECTION .text:CODE:REORDER:NOROOT(1)
  261. TIM1_UP_TIM16_IRQHandler
  262. B TIM1_UP_TIM16_IRQHandler
  263. PUBWEAK TIM1_TRG_COM_TIM17_IRQHandler
  264. SECTION .text:CODE:REORDER:NOROOT(1)
  265. TIM1_TRG_COM_TIM17_IRQHandler
  266. B TIM1_TRG_COM_TIM17_IRQHandler
  267. PUBWEAK TIM1_CC_IRQHandler
  268. SECTION .text:CODE:REORDER:NOROOT(1)
  269. TIM1_CC_IRQHandler
  270. B TIM1_CC_IRQHandler
  271. PUBWEAK TIM2_IRQHandler
  272. SECTION .text:CODE:REORDER:NOROOT(1)
  273. TIM2_IRQHandler
  274. B TIM2_IRQHandler
  275. PUBWEAK TIM3_IRQHandler
  276. SECTION .text:CODE:REORDER:NOROOT(1)
  277. TIM3_IRQHandler
  278. B TIM3_IRQHandler
  279. PUBWEAK TIM4_IRQHandler
  280. SECTION .text:CODE:REORDER:NOROOT(1)
  281. TIM4_IRQHandler
  282. B TIM4_IRQHandler
  283. PUBWEAK I2C1_EV_IRQHandler
  284. SECTION .text:CODE:REORDER:NOROOT(1)
  285. I2C1_EV_IRQHandler
  286. B I2C1_EV_IRQHandler
  287. PUBWEAK I2C1_ER_IRQHandler
  288. SECTION .text:CODE:REORDER:NOROOT(1)
  289. I2C1_ER_IRQHandler
  290. B I2C1_ER_IRQHandler
  291. PUBWEAK I2C2_EV_IRQHandler
  292. SECTION .text:CODE:REORDER:NOROOT(1)
  293. I2C2_EV_IRQHandler
  294. B I2C2_EV_IRQHandler
  295. PUBWEAK I2C2_ER_IRQHandler
  296. SECTION .text:CODE:REORDER:NOROOT(1)
  297. I2C2_ER_IRQHandler
  298. B I2C2_ER_IRQHandler
  299. PUBWEAK SPI1_IRQHandler
  300. SECTION .text:CODE:REORDER:NOROOT(1)
  301. SPI1_IRQHandler
  302. B SPI1_IRQHandler
  303. PUBWEAK SPI2_IRQHandler
  304. SECTION .text:CODE:REORDER:NOROOT(1)
  305. SPI2_IRQHandler
  306. B SPI2_IRQHandler
  307. PUBWEAK USART1_IRQHandler
  308. SECTION .text:CODE:REORDER:NOROOT(1)
  309. USART1_IRQHandler
  310. B USART1_IRQHandler
  311. PUBWEAK USART2_IRQHandler
  312. SECTION .text:CODE:REORDER:NOROOT(1)
  313. USART2_IRQHandler
  314. B USART2_IRQHandler
  315. PUBWEAK USART3_IRQHandler
  316. SECTION .text:CODE:REORDER:NOROOT(1)
  317. USART3_IRQHandler
  318. B USART3_IRQHandler
  319. PUBWEAK EXTI15_10_IRQHandler
  320. SECTION .text:CODE:REORDER:NOROOT(1)
  321. EXTI15_10_IRQHandler
  322. B EXTI15_10_IRQHandler
  323. PUBWEAK RTC_Alarm_IRQHandler
  324. SECTION .text:CODE:REORDER:NOROOT(1)
  325. RTC_Alarm_IRQHandler
  326. B RTC_Alarm_IRQHandler
  327. PUBWEAK CEC_IRQHandler
  328. SECTION .text:CODE:REORDER:NOROOT(1)
  329. CEC_IRQHandler
  330. B CEC_IRQHandler
  331. PUBWEAK TIM12_IRQHandler
  332. SECTION .text:CODE:REORDER:NOROOT(1)
  333. TIM12_IRQHandler
  334. B TIM12_IRQHandler
  335. PUBWEAK TIM13_IRQHandler
  336. SECTION .text:CODE:REORDER:NOROOT(1)
  337. TIM13_IRQHandler
  338. B TIM13_IRQHandler
  339. PUBWEAK TIM14_IRQHandler
  340. SECTION .text:CODE:REORDER:NOROOT(1)
  341. TIM14_IRQHandler
  342. B TIM14_IRQHandler
  343. PUBWEAK TIM5_IRQHandler
  344. SECTION .text:CODE:REORDER:NOROOT(1)
  345. TIM5_IRQHandler
  346. B TIM5_IRQHandler
  347. PUBWEAK SPI3_IRQHandler
  348. SECTION .text:CODE:REORDER:NOROOT(1)
  349. SPI3_IRQHandler
  350. B SPI3_IRQHandler
  351. PUBWEAK UART4_IRQHandler
  352. SECTION .text:CODE:REORDER:NOROOT(1)
  353. UART4_IRQHandler
  354. B UART4_IRQHandler
  355. PUBWEAK UART5_IRQHandler
  356. SECTION .text:CODE:REORDER:NOROOT(1)
  357. UART5_IRQHandler
  358. B UART5_IRQHandler
  359. PUBWEAK TIM6_DAC_IRQHandler
  360. SECTION .text:CODE:REORDER:NOROOT(1)
  361. TIM6_DAC_IRQHandler
  362. B TIM6_DAC_IRQHandler
  363. PUBWEAK TIM7_IRQHandler
  364. SECTION .text:CODE:REORDER:NOROOT(1)
  365. TIM7_IRQHandler
  366. B TIM7_IRQHandler
  367. PUBWEAK DMA2_Channel1_IRQHandler
  368. SECTION .text:CODE:REORDER:NOROOT(1)
  369. DMA2_Channel1_IRQHandler
  370. B DMA2_Channel1_IRQHandler
  371. PUBWEAK DMA2_Channel2_IRQHandler
  372. SECTION .text:CODE:REORDER:NOROOT(1)
  373. DMA2_Channel2_IRQHandler
  374. B DMA2_Channel2_IRQHandler
  375. PUBWEAK DMA2_Channel3_IRQHandler
  376. SECTION .text:CODE:REORDER:NOROOT(1)
  377. DMA2_Channel3_IRQHandler
  378. B DMA2_Channel3_IRQHandler
  379. PUBWEAK DMA2_Channel4_5_IRQHandler
  380. SECTION .text:CODE:REORDER:NOROOT(1)
  381. DMA2_Channel4_5_IRQHandler
  382. B DMA2_Channel4_5_IRQHandler
  383. PUBWEAK DMA2_Channel5_IRQHandler
  384. SECTION .text:CODE:REORDER:NOROOT(1)
  385. DMA2_Channel5_IRQHandler
  386. B DMA2_Channel5_IRQHandler
  387. END