startup_stm32f10x_hd.s 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  1. ;******************** (C) COPYRIGHT 2011 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f10x_hd.s
  3. ;* Author : MCD Application Team
  4. ;* Version : V3.5.1
  5. ;* Date : 08-September-2021
  6. ;* Description : STM32F10x High Density Devices vector table for EWARM
  7. ;* toolchain.
  8. ;* This module performs:
  9. ;* - Set the initial SP
  10. ;* - Configure the clock system and the external SRAM
  11. ;* mounted on STM3210E-EVAL board to be used as data
  12. ;* memory (optional, to be enabled by user)
  13. ;* - Set the initial PC == __iar_program_start,
  14. ;* - Set the vector table entries with the exceptions ISR address,
  15. ;* After Reset the Cortex-M3 processor is in Thread mode,
  16. ;* priority is Privileged, and the Stack is set to Main.
  17. ;********************************************************************************
  18. ;*
  19. ;* Copyright (c) 2011 STMicroelectronics.
  20. ;* All rights reserved.
  21. ;*
  22. ;* This software is licensed under terms that can be found in the LICENSE file
  23. ;* in the root directory of this software component.
  24. ;* If no LICENSE file comes with this software, it is provided AS-IS.
  25. ;
  26. ;*******************************************************************************
  27. ;
  28. ;
  29. ; The modules in this file are included in the libraries, and may be replaced
  30. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  31. ; a user defined start symbol.
  32. ; To override the cstartup defined in the library, simply add your modified
  33. ; version to the workbench project.
  34. ;
  35. ; The vector table is normally located at address 0.
  36. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  37. ; The name "__vector_table" has special meaning for C-SPY:
  38. ; it is where the SP start value is found, and the NVIC vector
  39. ; table register (VTOR) is initialized to this address if != 0.
  40. ;
  41. ; Cortex-M version
  42. ;
  43. MODULE ?cstartup
  44. ;; Forward declaration of sections.
  45. SECTION CSTACK:DATA:NOROOT(3)
  46. SECTION .intvec:CODE:NOROOT(2)
  47. EXTERN __iar_program_start
  48. EXTERN SystemInit
  49. PUBLIC __vector_table
  50. DATA
  51. __vector_table
  52. DCD sfe(CSTACK)
  53. DCD Reset_Handler ; Reset Handler
  54. DCD NMI_Handler ; NMI Handler
  55. DCD HardFault_Handler ; Hard Fault Handler
  56. DCD MemManage_Handler ; MPU Fault Handler
  57. DCD BusFault_Handler ; Bus Fault Handler
  58. DCD UsageFault_Handler ; Usage Fault Handler
  59. DCD 0 ; Reserved
  60. DCD 0 ; Reserved
  61. DCD 0 ; Reserved
  62. DCD 0 ; Reserved
  63. DCD SVC_Handler ; SVCall Handler
  64. DCD DebugMon_Handler ; Debug Monitor Handler
  65. DCD 0 ; Reserved
  66. DCD PendSV_Handler ; PendSV Handler
  67. DCD SysTick_Handler ; SysTick Handler
  68. ; External Interrupts
  69. DCD WWDG_IRQHandler ; Window Watchdog
  70. DCD PVD_IRQHandler ; PVD through EXTI Line detect
  71. DCD TAMPER_IRQHandler ; Tamper
  72. DCD RTC_IRQHandler ; RTC
  73. DCD FLASH_IRQHandler ; Flash
  74. DCD RCC_IRQHandler ; RCC
  75. DCD EXTI0_IRQHandler ; EXTI Line 0
  76. DCD EXTI1_IRQHandler ; EXTI Line 1
  77. DCD EXTI2_IRQHandler ; EXTI Line 2
  78. DCD EXTI3_IRQHandler ; EXTI Line 3
  79. DCD EXTI4_IRQHandler ; EXTI Line 4
  80. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  81. DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
  82. DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
  83. DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
  84. DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
  85. DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
  86. DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
  87. DCD ADC1_2_IRQHandler ; ADC1 & ADC2
  88. DCD USB_HP_CAN1_TX_IRQHandler ; USB High Priority or CAN1 TX
  89. DCD USB_LP_CAN1_RX0_IRQHandler ; USB Low Priority or CAN1 RX0
  90. DCD CAN1_RX1_IRQHandler ; CAN1 RX1
  91. DCD CAN1_SCE_IRQHandler ; CAN1 SCE
  92. DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
  93. DCD TIM1_BRK_IRQHandler ; TIM1 Break
  94. DCD TIM1_UP_IRQHandler ; TIM1 Update
  95. DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation
  96. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  97. DCD TIM2_IRQHandler ; TIM2
  98. DCD TIM3_IRQHandler ; TIM3
  99. DCD TIM4_IRQHandler ; TIM4
  100. DCD I2C1_EV_IRQHandler ; I2C1 Event
  101. DCD I2C1_ER_IRQHandler ; I2C1 Error
  102. DCD I2C2_EV_IRQHandler ; I2C2 Event
  103. DCD I2C2_ER_IRQHandler ; I2C2 Error
  104. DCD SPI1_IRQHandler ; SPI1
  105. DCD SPI2_IRQHandler ; SPI2
  106. DCD USART1_IRQHandler ; USART1
  107. DCD USART2_IRQHandler ; USART2
  108. DCD USART3_IRQHandler ; USART3
  109. DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
  110. DCD RTCAlarm_IRQHandler ; RTC Alarm through EXTI Line
  111. DCD USBWakeUp_IRQHandler ; USB Wakeup from suspend
  112. DCD TIM8_BRK_IRQHandler ; TIM8 Break
  113. DCD TIM8_UP_IRQHandler ; TIM8 Update
  114. DCD TIM8_TRG_COM_IRQHandler ; TIM8 Trigger and Commutation
  115. DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
  116. DCD ADC3_IRQHandler ; ADC3
  117. DCD FSMC_IRQHandler ; FSMC
  118. DCD SDIO_IRQHandler ; SDIO
  119. DCD TIM5_IRQHandler ; TIM5
  120. DCD SPI3_IRQHandler ; SPI3
  121. DCD UART4_IRQHandler ; UART4
  122. DCD UART5_IRQHandler ; UART5
  123. DCD TIM6_IRQHandler ; TIM6
  124. DCD TIM7_IRQHandler ; TIM7
  125. DCD DMA2_Channel1_IRQHandler ; DMA2 Channel1
  126. DCD DMA2_Channel2_IRQHandler ; DMA2 Channel2
  127. DCD DMA2_Channel3_IRQHandler ; DMA2 Channel3
  128. DCD DMA2_Channel4_5_IRQHandler ; DMA2 Channel4 & Channel5
  129. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  130. ;;
  131. ;; Default interrupt handlers.
  132. ;;
  133. THUMB
  134. PUBWEAK Reset_Handler
  135. SECTION .text:CODE:REORDER:NOROOT(2)
  136. Reset_Handler
  137. ;LDR R0, =SystemInit
  138. ;BLX R0
  139. LDR R0, =__iar_program_start
  140. BX R0
  141. PUBWEAK NMI_Handler
  142. SECTION .text:CODE:REORDER:NOROOT(1)
  143. NMI_Handler
  144. B NMI_Handler
  145. PUBWEAK HardFault_Handler
  146. SECTION .text:CODE:REORDER:NOROOT(1)
  147. HardFault_Handler
  148. B HardFault_Handler
  149. PUBWEAK MemManage_Handler
  150. SECTION .text:CODE:REORDER:NOROOT(1)
  151. MemManage_Handler
  152. B MemManage_Handler
  153. PUBWEAK BusFault_Handler
  154. SECTION .text:CODE:REORDER:NOROOT(1)
  155. BusFault_Handler
  156. B BusFault_Handler
  157. PUBWEAK UsageFault_Handler
  158. SECTION .text:CODE:REORDER:NOROOT(1)
  159. UsageFault_Handler
  160. B UsageFault_Handler
  161. PUBWEAK SVC_Handler
  162. SECTION .text:CODE:REORDER:NOROOT(1)
  163. SVC_Handler
  164. B SVC_Handler
  165. PUBWEAK DebugMon_Handler
  166. SECTION .text:CODE:REORDER:NOROOT(1)
  167. DebugMon_Handler
  168. B DebugMon_Handler
  169. PUBWEAK PendSV_Handler
  170. SECTION .text:CODE:REORDER:NOROOT(1)
  171. PendSV_Handler
  172. B PendSV_Handler
  173. PUBWEAK SysTick_Handler
  174. SECTION .text:CODE:REORDER:NOROOT(1)
  175. SysTick_Handler
  176. B SysTick_Handler
  177. PUBWEAK WWDG_IRQHandler
  178. SECTION .text:CODE:REORDER:NOROOT(1)
  179. WWDG_IRQHandler
  180. B WWDG_IRQHandler
  181. PUBWEAK PVD_IRQHandler
  182. SECTION .text:CODE:REORDER:NOROOT(1)
  183. PVD_IRQHandler
  184. B PVD_IRQHandler
  185. PUBWEAK TAMPER_IRQHandler
  186. SECTION .text:CODE:REORDER:NOROOT(1)
  187. TAMPER_IRQHandler
  188. B TAMPER_IRQHandler
  189. PUBWEAK RTC_IRQHandler
  190. SECTION .text:CODE:REORDER:NOROOT(1)
  191. RTC_IRQHandler
  192. B RTC_IRQHandler
  193. PUBWEAK FLASH_IRQHandler
  194. SECTION .text:CODE:REORDER:NOROOT(1)
  195. FLASH_IRQHandler
  196. B FLASH_IRQHandler
  197. PUBWEAK RCC_IRQHandler
  198. SECTION .text:CODE:REORDER:NOROOT(1)
  199. RCC_IRQHandler
  200. B RCC_IRQHandler
  201. PUBWEAK EXTI0_IRQHandler
  202. SECTION .text:CODE:REORDER:NOROOT(1)
  203. EXTI0_IRQHandler
  204. B EXTI0_IRQHandler
  205. PUBWEAK EXTI1_IRQHandler
  206. SECTION .text:CODE:REORDER:NOROOT(1)
  207. EXTI1_IRQHandler
  208. B EXTI1_IRQHandler
  209. PUBWEAK EXTI2_IRQHandler
  210. SECTION .text:CODE:REORDER:NOROOT(1)
  211. EXTI2_IRQHandler
  212. B EXTI2_IRQHandler
  213. PUBWEAK EXTI3_IRQHandler
  214. SECTION .text:CODE:REORDER:NOROOT(1)
  215. EXTI3_IRQHandler
  216. B EXTI3_IRQHandler
  217. PUBWEAK EXTI4_IRQHandler
  218. SECTION .text:CODE:REORDER:NOROOT(1)
  219. EXTI4_IRQHandler
  220. B EXTI4_IRQHandler
  221. PUBWEAK DMA1_Channel1_IRQHandler
  222. SECTION .text:CODE:REORDER:NOROOT(1)
  223. DMA1_Channel1_IRQHandler
  224. B DMA1_Channel1_IRQHandler
  225. PUBWEAK DMA1_Channel2_IRQHandler
  226. SECTION .text:CODE:REORDER:NOROOT(1)
  227. DMA1_Channel2_IRQHandler
  228. B DMA1_Channel2_IRQHandler
  229. PUBWEAK DMA1_Channel3_IRQHandler
  230. SECTION .text:CODE:REORDER:NOROOT(1)
  231. DMA1_Channel3_IRQHandler
  232. B DMA1_Channel3_IRQHandler
  233. PUBWEAK DMA1_Channel4_IRQHandler
  234. SECTION .text:CODE:REORDER:NOROOT(1)
  235. DMA1_Channel4_IRQHandler
  236. B DMA1_Channel4_IRQHandler
  237. PUBWEAK DMA1_Channel5_IRQHandler
  238. SECTION .text:CODE:REORDER:NOROOT(1)
  239. DMA1_Channel5_IRQHandler
  240. B DMA1_Channel5_IRQHandler
  241. PUBWEAK DMA1_Channel6_IRQHandler
  242. SECTION .text:CODE:REORDER:NOROOT(1)
  243. DMA1_Channel6_IRQHandler
  244. B DMA1_Channel6_IRQHandler
  245. PUBWEAK DMA1_Channel7_IRQHandler
  246. SECTION .text:CODE:REORDER:NOROOT(1)
  247. DMA1_Channel7_IRQHandler
  248. B DMA1_Channel7_IRQHandler
  249. PUBWEAK ADC1_2_IRQHandler
  250. SECTION .text:CODE:REORDER:NOROOT(1)
  251. ADC1_2_IRQHandler
  252. B ADC1_2_IRQHandler
  253. PUBWEAK USB_HP_CAN1_TX_IRQHandler
  254. SECTION .text:CODE:REORDER:NOROOT(1)
  255. USB_HP_CAN1_TX_IRQHandler
  256. B USB_HP_CAN1_TX_IRQHandler
  257. PUBWEAK USB_LP_CAN1_RX0_IRQHandler
  258. SECTION .text:CODE:REORDER:NOROOT(1)
  259. USB_LP_CAN1_RX0_IRQHandler
  260. B USB_LP_CAN1_RX0_IRQHandler
  261. PUBWEAK CAN1_RX1_IRQHandler
  262. SECTION .text:CODE:REORDER:NOROOT(1)
  263. CAN1_RX1_IRQHandler
  264. B CAN1_RX1_IRQHandler
  265. PUBWEAK CAN1_SCE_IRQHandler
  266. SECTION .text:CODE:REORDER:NOROOT(1)
  267. CAN1_SCE_IRQHandler
  268. B CAN1_SCE_IRQHandler
  269. PUBWEAK EXTI9_5_IRQHandler
  270. SECTION .text:CODE:REORDER:NOROOT(1)
  271. EXTI9_5_IRQHandler
  272. B EXTI9_5_IRQHandler
  273. PUBWEAK TIM1_BRK_IRQHandler
  274. SECTION .text:CODE:REORDER:NOROOT(1)
  275. TIM1_BRK_IRQHandler
  276. B TIM1_BRK_IRQHandler
  277. PUBWEAK TIM1_UP_IRQHandler
  278. SECTION .text:CODE:REORDER:NOROOT(1)
  279. TIM1_UP_IRQHandler
  280. B TIM1_UP_IRQHandler
  281. PUBWEAK TIM1_TRG_COM_IRQHandler
  282. SECTION .text:CODE:REORDER:NOROOT(1)
  283. TIM1_TRG_COM_IRQHandler
  284. B TIM1_TRG_COM_IRQHandler
  285. PUBWEAK TIM1_CC_IRQHandler
  286. SECTION .text:CODE:REORDER:NOROOT(1)
  287. TIM1_CC_IRQHandler
  288. B TIM1_CC_IRQHandler
  289. PUBWEAK TIM2_IRQHandler
  290. SECTION .text:CODE:REORDER:NOROOT(1)
  291. TIM2_IRQHandler
  292. B TIM2_IRQHandler
  293. PUBWEAK TIM3_IRQHandler
  294. SECTION .text:CODE:REORDER:NOROOT(1)
  295. TIM3_IRQHandler
  296. B TIM3_IRQHandler
  297. PUBWEAK TIM4_IRQHandler
  298. SECTION .text:CODE:REORDER:NOROOT(1)
  299. TIM4_IRQHandler
  300. B TIM4_IRQHandler
  301. PUBWEAK I2C1_EV_IRQHandler
  302. SECTION .text:CODE:REORDER:NOROOT(1)
  303. I2C1_EV_IRQHandler
  304. B I2C1_EV_IRQHandler
  305. PUBWEAK I2C1_ER_IRQHandler
  306. SECTION .text:CODE:REORDER:NOROOT(1)
  307. I2C1_ER_IRQHandler
  308. B I2C1_ER_IRQHandler
  309. PUBWEAK I2C2_EV_IRQHandler
  310. SECTION .text:CODE:REORDER:NOROOT(1)
  311. I2C2_EV_IRQHandler
  312. B I2C2_EV_IRQHandler
  313. PUBWEAK I2C2_ER_IRQHandler
  314. SECTION .text:CODE:REORDER:NOROOT(1)
  315. I2C2_ER_IRQHandler
  316. B I2C2_ER_IRQHandler
  317. PUBWEAK SPI1_IRQHandler
  318. SECTION .text:CODE:REORDER:NOROOT(1)
  319. SPI1_IRQHandler
  320. B SPI1_IRQHandler
  321. PUBWEAK SPI2_IRQHandler
  322. SECTION .text:CODE:REORDER:NOROOT(1)
  323. SPI2_IRQHandler
  324. B SPI2_IRQHandler
  325. PUBWEAK USART1_IRQHandler
  326. SECTION .text:CODE:REORDER:NOROOT(1)
  327. USART1_IRQHandler
  328. B USART1_IRQHandler
  329. PUBWEAK USART2_IRQHandler
  330. SECTION .text:CODE:REORDER:NOROOT(1)
  331. USART2_IRQHandler
  332. B USART2_IRQHandler
  333. PUBWEAK USART3_IRQHandler
  334. SECTION .text:CODE:REORDER:NOROOT(1)
  335. USART3_IRQHandler
  336. B USART3_IRQHandler
  337. PUBWEAK EXTI15_10_IRQHandler
  338. SECTION .text:CODE:REORDER:NOROOT(1)
  339. EXTI15_10_IRQHandler
  340. B EXTI15_10_IRQHandler
  341. PUBWEAK RTCAlarm_IRQHandler
  342. SECTION .text:CODE:REORDER:NOROOT(1)
  343. RTCAlarm_IRQHandler
  344. B RTCAlarm_IRQHandler
  345. PUBWEAK USBWakeUp_IRQHandler
  346. SECTION .text:CODE:REORDER:NOROOT(1)
  347. USBWakeUp_IRQHandler
  348. B USBWakeUp_IRQHandler
  349. PUBWEAK TIM8_BRK_IRQHandler
  350. SECTION .text:CODE:REORDER:NOROOT(1)
  351. TIM8_BRK_IRQHandler
  352. B TIM8_BRK_IRQHandler
  353. PUBWEAK TIM8_UP_IRQHandler
  354. SECTION .text:CODE:REORDER:NOROOT(1)
  355. TIM8_UP_IRQHandler
  356. B TIM8_UP_IRQHandler
  357. PUBWEAK TIM8_TRG_COM_IRQHandler
  358. SECTION .text:CODE:REORDER:NOROOT(1)
  359. TIM8_TRG_COM_IRQHandler
  360. B TIM8_TRG_COM_IRQHandler
  361. PUBWEAK TIM8_CC_IRQHandler
  362. SECTION .text:CODE:REORDER:NOROOT(1)
  363. TIM8_CC_IRQHandler
  364. B TIM8_CC_IRQHandler
  365. PUBWEAK ADC3_IRQHandler
  366. SECTION .text:CODE:REORDER:NOROOT(1)
  367. ADC3_IRQHandler
  368. B ADC3_IRQHandler
  369. PUBWEAK FSMC_IRQHandler
  370. SECTION .text:CODE:REORDER:NOROOT(1)
  371. FSMC_IRQHandler
  372. B FSMC_IRQHandler
  373. PUBWEAK SDIO_IRQHandler
  374. SECTION .text:CODE:REORDER:NOROOT(1)
  375. SDIO_IRQHandler
  376. B SDIO_IRQHandler
  377. PUBWEAK TIM5_IRQHandler
  378. SECTION .text:CODE:REORDER:NOROOT(1)
  379. TIM5_IRQHandler
  380. B TIM5_IRQHandler
  381. PUBWEAK SPI3_IRQHandler
  382. SECTION .text:CODE:REORDER:NOROOT(1)
  383. SPI3_IRQHandler
  384. B SPI3_IRQHandler
  385. PUBWEAK UART4_IRQHandler
  386. SECTION .text:CODE:REORDER:NOROOT(1)
  387. UART4_IRQHandler
  388. B UART4_IRQHandler
  389. PUBWEAK UART5_IRQHandler
  390. SECTION .text:CODE:REORDER:NOROOT(1)
  391. UART5_IRQHandler
  392. B UART5_IRQHandler
  393. PUBWEAK TIM6_IRQHandler
  394. SECTION .text:CODE:REORDER:NOROOT(1)
  395. TIM6_IRQHandler
  396. B TIM6_IRQHandler
  397. PUBWEAK TIM7_IRQHandler
  398. SECTION .text:CODE:REORDER:NOROOT(1)
  399. TIM7_IRQHandler
  400. B TIM7_IRQHandler
  401. PUBWEAK DMA2_Channel1_IRQHandler
  402. SECTION .text:CODE:REORDER:NOROOT(1)
  403. DMA2_Channel1_IRQHandler
  404. B DMA2_Channel1_IRQHandler
  405. PUBWEAK DMA2_Channel2_IRQHandler
  406. SECTION .text:CODE:REORDER:NOROOT(1)
  407. DMA2_Channel2_IRQHandler
  408. B DMA2_Channel2_IRQHandler
  409. PUBWEAK DMA2_Channel3_IRQHandler
  410. SECTION .text:CODE:REORDER:NOROOT(1)
  411. DMA2_Channel3_IRQHandler
  412. B DMA2_Channel3_IRQHandler
  413. PUBWEAK DMA2_Channel4_5_IRQHandler
  414. SECTION .text:CODE:REORDER:NOROOT(1)
  415. DMA2_Channel4_5_IRQHandler
  416. B DMA2_Channel4_5_IRQHandler
  417. END