startup_stm32f107xc.s 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. ;******************** (C) COPYRIGHT 2017 STMicroelectronics *******************
  2. ;* File Name : startup_stm32f107xc.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32F107xC Connectivity line devices vector table for
  5. ;* EWARM 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_2_IRQHandler ; ADC1 and ADC2
  85. DCD CAN1_TX_IRQHandler ; CAN1 TX
  86. DCD CAN1_RX0_IRQHandler ; CAN1 RX0
  87. DCD CAN1_RX1_IRQHandler ; CAN1 RX1
  88. DCD CAN1_SCE_IRQHandler ; CAN1 SCE
  89. DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
  90. DCD TIM1_BRK_IRQHandler ; TIM1 Break
  91. DCD TIM1_UP_IRQHandler ; TIM1 Update
  92. DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation
  93. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  94. DCD TIM2_IRQHandler ; TIM2
  95. DCD TIM3_IRQHandler ; TIM3
  96. DCD TIM4_IRQHandler ; TIM4
  97. DCD I2C1_EV_IRQHandler ; I2C1 Event
  98. DCD I2C1_ER_IRQHandler ; I2C1 Error
  99. DCD I2C2_EV_IRQHandler ; I2C2 Event
  100. DCD I2C2_ER_IRQHandler ; I2C1 Error
  101. DCD SPI1_IRQHandler ; SPI1
  102. DCD SPI2_IRQHandler ; SPI2
  103. DCD USART1_IRQHandler ; USART1
  104. DCD USART2_IRQHandler ; USART2
  105. DCD USART3_IRQHandler ; USART3
  106. DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
  107. DCD RTC_Alarm_IRQHandler ; RTC alarm through EXTI line
  108. DCD OTG_FS_WKUP_IRQHandler ; USB OTG FS Wakeup through EXTI line
  109. DCD 0 ; Reserved
  110. DCD 0 ; Reserved
  111. DCD 0 ; Reserved
  112. DCD 0 ; Reserved
  113. DCD 0 ; Reserved
  114. DCD 0 ; Reserved
  115. DCD 0 ; Reserved
  116. DCD TIM5_IRQHandler ; TIM5
  117. DCD SPI3_IRQHandler ; SPI3
  118. DCD UART4_IRQHandler ; UART4
  119. DCD UART5_IRQHandler ; UART5
  120. DCD TIM6_IRQHandler ; TIM6
  121. DCD TIM7_IRQHandler ; TIM7
  122. DCD DMA2_Channel1_IRQHandler ; DMA2 Channel1
  123. DCD DMA2_Channel2_IRQHandler ; DMA2 Channel2
  124. DCD DMA2_Channel3_IRQHandler ; DMA2 Channel3
  125. DCD DMA2_Channel4_IRQHandler ; DMA2 Channel4
  126. DCD DMA2_Channel5_IRQHandler ; DMA2 Channel5
  127. DCD ETH_IRQHandler ; Ethernet
  128. DCD ETH_WKUP_IRQHandler ; Ethernet Wakeup through EXTI line
  129. DCD CAN2_TX_IRQHandler ; CAN2 TX
  130. DCD CAN2_RX0_IRQHandler ; CAN2 RX0
  131. DCD CAN2_RX1_IRQHandler ; CAN2 RX1
  132. DCD CAN2_SCE_IRQHandler ; CAN2 SCE
  133. DCD OTG_FS_IRQHandler ; USB OTG FS
  134. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  135. ;;
  136. ;; Default interrupt handlers.
  137. ;;
  138. THUMB
  139. PUBWEAK Reset_Handler
  140. SECTION .text:CODE:REORDER:NOROOT(2)
  141. Reset_Handler
  142. LDR R0, =SystemInit
  143. BLX R0
  144. LDR R0, =__iar_program_start
  145. BX R0
  146. PUBWEAK NMI_Handler
  147. SECTION .text:CODE:REORDER:NOROOT(1)
  148. NMI_Handler
  149. B NMI_Handler
  150. PUBWEAK HardFault_Handler
  151. SECTION .text:CODE:REORDER:NOROOT(1)
  152. HardFault_Handler
  153. B HardFault_Handler
  154. PUBWEAK MemManage_Handler
  155. SECTION .text:CODE:REORDER:NOROOT(1)
  156. MemManage_Handler
  157. B MemManage_Handler
  158. PUBWEAK BusFault_Handler
  159. SECTION .text:CODE:REORDER:NOROOT(1)
  160. BusFault_Handler
  161. B BusFault_Handler
  162. PUBWEAK UsageFault_Handler
  163. SECTION .text:CODE:REORDER:NOROOT(1)
  164. UsageFault_Handler
  165. B UsageFault_Handler
  166. PUBWEAK SVC_Handler
  167. SECTION .text:CODE:REORDER:NOROOT(1)
  168. SVC_Handler
  169. B SVC_Handler
  170. PUBWEAK DebugMon_Handler
  171. SECTION .text:CODE:REORDER:NOROOT(1)
  172. DebugMon_Handler
  173. B DebugMon_Handler
  174. PUBWEAK PendSV_Handler
  175. SECTION .text:CODE:REORDER:NOROOT(1)
  176. PendSV_Handler
  177. B PendSV_Handler
  178. PUBWEAK SysTick_Handler
  179. SECTION .text:CODE:REORDER:NOROOT(1)
  180. SysTick_Handler
  181. B SysTick_Handler
  182. PUBWEAK WWDG_IRQHandler
  183. SECTION .text:CODE:REORDER:NOROOT(1)
  184. WWDG_IRQHandler
  185. B WWDG_IRQHandler
  186. PUBWEAK PVD_IRQHandler
  187. SECTION .text:CODE:REORDER:NOROOT(1)
  188. PVD_IRQHandler
  189. B PVD_IRQHandler
  190. PUBWEAK TAMPER_IRQHandler
  191. SECTION .text:CODE:REORDER:NOROOT(1)
  192. TAMPER_IRQHandler
  193. B TAMPER_IRQHandler
  194. PUBWEAK RTC_IRQHandler
  195. SECTION .text:CODE:REORDER:NOROOT(1)
  196. RTC_IRQHandler
  197. B RTC_IRQHandler
  198. PUBWEAK FLASH_IRQHandler
  199. SECTION .text:CODE:REORDER:NOROOT(1)
  200. FLASH_IRQHandler
  201. B FLASH_IRQHandler
  202. PUBWEAK RCC_IRQHandler
  203. SECTION .text:CODE:REORDER:NOROOT(1)
  204. RCC_IRQHandler
  205. B RCC_IRQHandler
  206. PUBWEAK EXTI0_IRQHandler
  207. SECTION .text:CODE:REORDER:NOROOT(1)
  208. EXTI0_IRQHandler
  209. B EXTI0_IRQHandler
  210. PUBWEAK EXTI1_IRQHandler
  211. SECTION .text:CODE:REORDER:NOROOT(1)
  212. EXTI1_IRQHandler
  213. B EXTI1_IRQHandler
  214. PUBWEAK EXTI2_IRQHandler
  215. SECTION .text:CODE:REORDER:NOROOT(1)
  216. EXTI2_IRQHandler
  217. B EXTI2_IRQHandler
  218. PUBWEAK EXTI3_IRQHandler
  219. SECTION .text:CODE:REORDER:NOROOT(1)
  220. EXTI3_IRQHandler
  221. B EXTI3_IRQHandler
  222. PUBWEAK EXTI4_IRQHandler
  223. SECTION .text:CODE:REORDER:NOROOT(1)
  224. EXTI4_IRQHandler
  225. B EXTI4_IRQHandler
  226. PUBWEAK DMA1_Channel1_IRQHandler
  227. SECTION .text:CODE:REORDER:NOROOT(1)
  228. DMA1_Channel1_IRQHandler
  229. B DMA1_Channel1_IRQHandler
  230. PUBWEAK DMA1_Channel2_IRQHandler
  231. SECTION .text:CODE:REORDER:NOROOT(1)
  232. DMA1_Channel2_IRQHandler
  233. B DMA1_Channel2_IRQHandler
  234. PUBWEAK DMA1_Channel3_IRQHandler
  235. SECTION .text:CODE:REORDER:NOROOT(1)
  236. DMA1_Channel3_IRQHandler
  237. B DMA1_Channel3_IRQHandler
  238. PUBWEAK DMA1_Channel4_IRQHandler
  239. SECTION .text:CODE:REORDER:NOROOT(1)
  240. DMA1_Channel4_IRQHandler
  241. B DMA1_Channel4_IRQHandler
  242. PUBWEAK DMA1_Channel5_IRQHandler
  243. SECTION .text:CODE:REORDER:NOROOT(1)
  244. DMA1_Channel5_IRQHandler
  245. B DMA1_Channel5_IRQHandler
  246. PUBWEAK DMA1_Channel6_IRQHandler
  247. SECTION .text:CODE:REORDER:NOROOT(1)
  248. DMA1_Channel6_IRQHandler
  249. B DMA1_Channel6_IRQHandler
  250. PUBWEAK DMA1_Channel7_IRQHandler
  251. SECTION .text:CODE:REORDER:NOROOT(1)
  252. DMA1_Channel7_IRQHandler
  253. B DMA1_Channel7_IRQHandler
  254. PUBWEAK ADC1_2_IRQHandler
  255. SECTION .text:CODE:REORDER:NOROOT(1)
  256. ADC1_2_IRQHandler
  257. B ADC1_2_IRQHandler
  258. PUBWEAK CAN1_TX_IRQHandler
  259. SECTION .text:CODE:REORDER:NOROOT(1)
  260. CAN1_TX_IRQHandler
  261. B CAN1_TX_IRQHandler
  262. PUBWEAK CAN1_RX0_IRQHandler
  263. SECTION .text:CODE:REORDER:NOROOT(1)
  264. CAN1_RX0_IRQHandler
  265. B CAN1_RX0_IRQHandler
  266. PUBWEAK CAN1_RX1_IRQHandler
  267. SECTION .text:CODE:REORDER:NOROOT(1)
  268. CAN1_RX1_IRQHandler
  269. B CAN1_RX1_IRQHandler
  270. PUBWEAK CAN1_SCE_IRQHandler
  271. SECTION .text:CODE:REORDER:NOROOT(1)
  272. CAN1_SCE_IRQHandler
  273. B CAN1_SCE_IRQHandler
  274. PUBWEAK EXTI9_5_IRQHandler
  275. SECTION .text:CODE:REORDER:NOROOT(1)
  276. EXTI9_5_IRQHandler
  277. B EXTI9_5_IRQHandler
  278. PUBWEAK TIM1_BRK_IRQHandler
  279. SECTION .text:CODE:REORDER:NOROOT(1)
  280. TIM1_BRK_IRQHandler
  281. B TIM1_BRK_IRQHandler
  282. PUBWEAK TIM1_UP_IRQHandler
  283. SECTION .text:CODE:REORDER:NOROOT(1)
  284. TIM1_UP_IRQHandler
  285. B TIM1_UP_IRQHandler
  286. PUBWEAK TIM1_TRG_COM_IRQHandler
  287. SECTION .text:CODE:REORDER:NOROOT(1)
  288. TIM1_TRG_COM_IRQHandler
  289. B TIM1_TRG_COM_IRQHandler
  290. PUBWEAK TIM1_CC_IRQHandler
  291. SECTION .text:CODE:REORDER:NOROOT(1)
  292. TIM1_CC_IRQHandler
  293. B TIM1_CC_IRQHandler
  294. PUBWEAK TIM2_IRQHandler
  295. SECTION .text:CODE:REORDER:NOROOT(1)
  296. TIM2_IRQHandler
  297. B TIM2_IRQHandler
  298. PUBWEAK TIM3_IRQHandler
  299. SECTION .text:CODE:REORDER:NOROOT(1)
  300. TIM3_IRQHandler
  301. B TIM3_IRQHandler
  302. PUBWEAK TIM4_IRQHandler
  303. SECTION .text:CODE:REORDER:NOROOT(1)
  304. TIM4_IRQHandler
  305. B TIM4_IRQHandler
  306. PUBWEAK I2C1_EV_IRQHandler
  307. SECTION .text:CODE:REORDER:NOROOT(1)
  308. I2C1_EV_IRQHandler
  309. B I2C1_EV_IRQHandler
  310. PUBWEAK I2C1_ER_IRQHandler
  311. SECTION .text:CODE:REORDER:NOROOT(1)
  312. I2C1_ER_IRQHandler
  313. B I2C1_ER_IRQHandler
  314. PUBWEAK I2C2_EV_IRQHandler
  315. SECTION .text:CODE:REORDER:NOROOT(1)
  316. I2C2_EV_IRQHandler
  317. B I2C2_EV_IRQHandler
  318. PUBWEAK I2C2_ER_IRQHandler
  319. SECTION .text:CODE:REORDER:NOROOT(1)
  320. I2C2_ER_IRQHandler
  321. B I2C2_ER_IRQHandler
  322. PUBWEAK SPI1_IRQHandler
  323. SECTION .text:CODE:REORDER:NOROOT(1)
  324. SPI1_IRQHandler
  325. B SPI1_IRQHandler
  326. PUBWEAK SPI2_IRQHandler
  327. SECTION .text:CODE:REORDER:NOROOT(1)
  328. SPI2_IRQHandler
  329. B SPI2_IRQHandler
  330. PUBWEAK USART1_IRQHandler
  331. SECTION .text:CODE:REORDER:NOROOT(1)
  332. USART1_IRQHandler
  333. B USART1_IRQHandler
  334. PUBWEAK USART2_IRQHandler
  335. SECTION .text:CODE:REORDER:NOROOT(1)
  336. USART2_IRQHandler
  337. B USART2_IRQHandler
  338. PUBWEAK USART3_IRQHandler
  339. SECTION .text:CODE:REORDER:NOROOT(1)
  340. USART3_IRQHandler
  341. B USART3_IRQHandler
  342. PUBWEAK EXTI15_10_IRQHandler
  343. SECTION .text:CODE:REORDER:NOROOT(1)
  344. EXTI15_10_IRQHandler
  345. B EXTI15_10_IRQHandler
  346. PUBWEAK RTC_Alarm_IRQHandler
  347. SECTION .text:CODE:REORDER:NOROOT(1)
  348. RTC_Alarm_IRQHandler
  349. B RTC_Alarm_IRQHandler
  350. PUBWEAK OTG_FS_WKUP_IRQHandler
  351. SECTION .text:CODE:REORDER:NOROOT(1)
  352. OTG_FS_WKUP_IRQHandler
  353. B OTG_FS_WKUP_IRQHandler
  354. PUBWEAK TIM5_IRQHandler
  355. SECTION .text:CODE:REORDER:NOROOT(1)
  356. TIM5_IRQHandler
  357. B TIM5_IRQHandler
  358. PUBWEAK SPI3_IRQHandler
  359. SECTION .text:CODE:REORDER:NOROOT(1)
  360. SPI3_IRQHandler
  361. B SPI3_IRQHandler
  362. PUBWEAK UART4_IRQHandler
  363. SECTION .text:CODE:REORDER:NOROOT(1)
  364. UART4_IRQHandler
  365. B UART4_IRQHandler
  366. PUBWEAK UART5_IRQHandler
  367. SECTION .text:CODE:REORDER:NOROOT(1)
  368. UART5_IRQHandler
  369. B UART5_IRQHandler
  370. PUBWEAK TIM6_IRQHandler
  371. SECTION .text:CODE:REORDER:NOROOT(1)
  372. TIM6_IRQHandler
  373. B TIM6_IRQHandler
  374. PUBWEAK TIM7_IRQHandler
  375. SECTION .text:CODE:REORDER:NOROOT(1)
  376. TIM7_IRQHandler
  377. B TIM7_IRQHandler
  378. PUBWEAK DMA2_Channel1_IRQHandler
  379. SECTION .text:CODE:REORDER:NOROOT(1)
  380. DMA2_Channel1_IRQHandler
  381. B DMA2_Channel1_IRQHandler
  382. PUBWEAK DMA2_Channel2_IRQHandler
  383. SECTION .text:CODE:REORDER:NOROOT(1)
  384. DMA2_Channel2_IRQHandler
  385. B DMA2_Channel2_IRQHandler
  386. PUBWEAK DMA2_Channel3_IRQHandler
  387. SECTION .text:CODE:REORDER:NOROOT(1)
  388. DMA2_Channel3_IRQHandler
  389. B DMA2_Channel3_IRQHandler
  390. PUBWEAK DMA2_Channel4_IRQHandler
  391. SECTION .text:CODE:REORDER:NOROOT(1)
  392. DMA2_Channel4_IRQHandler
  393. B DMA2_Channel4_IRQHandler
  394. PUBWEAK DMA2_Channel5_IRQHandler
  395. SECTION .text:CODE:REORDER:NOROOT(1)
  396. DMA2_Channel5_IRQHandler
  397. B DMA2_Channel5_IRQHandler
  398. PUBWEAK ETH_IRQHandler
  399. SECTION .text:CODE:REORDER:NOROOT(1)
  400. ETH_IRQHandler
  401. B ETH_IRQHandler
  402. PUBWEAK ETH_WKUP_IRQHandler
  403. SECTION .text:CODE:REORDER:NOROOT(1)
  404. ETH_WKUP_IRQHandler
  405. B ETH_WKUP_IRQHandler
  406. PUBWEAK CAN2_TX_IRQHandler
  407. SECTION .text:CODE:REORDER:NOROOT(1)
  408. CAN2_TX_IRQHandler
  409. B CAN2_TX_IRQHandler
  410. PUBWEAK CAN2_RX0_IRQHandler
  411. SECTION .text:CODE:REORDER:NOROOT(1)
  412. CAN2_RX0_IRQHandler
  413. B CAN2_RX0_IRQHandler
  414. PUBWEAK CAN2_RX1_IRQHandler
  415. SECTION .text:CODE:REORDER:NOROOT(1)
  416. CAN2_RX1_IRQHandler
  417. B CAN2_RX1_IRQHandler
  418. PUBWEAK CAN2_SCE_IRQHandler
  419. SECTION .text:CODE:REORDER:NOROOT(1)
  420. CAN2_SCE_IRQHandler
  421. B CAN2_SCE_IRQHandler
  422. PUBWEAK OTG_FS_IRQHandler
  423. SECTION .text:CODE:REORDER:NOROOT(1)
  424. OTG_FS_IRQHandler
  425. B OTG_FS_IRQHandler
  426. END