startup_stm32f101xe.s 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. ;******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f101xe.s
  3. ;* Author : MCD Application Team
  4. ;* Description : STM32F101xE Access Line 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. ;* - Configure the system clock
  11. ;* - Branches to main in the C library (which eventually
  12. ;* calls main()).
  13. ;* After Reset the Cortex-M3 processor is in Thread mode,
  14. ;* priority is Privileged, and the Stack is set to Main.
  15. ;********************************************************************************
  16. ;*
  17. ;* Copyright (c) 2017-2021 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 MemManage_Handler ; MPU Fault Handler
  55. DCD BusFault_Handler ; Bus Fault Handler
  56. DCD UsageFault_Handler ; Usage Fault Handler
  57. DCD 0 ; Reserved
  58. DCD 0 ; Reserved
  59. DCD 0 ; Reserved
  60. DCD 0 ; Reserved
  61. DCD SVC_Handler ; SVCall Handler
  62. DCD DebugMon_Handler ; Debug Monitor Handler
  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 PVD_IRQHandler ; PVD through EXTI Line detect
  69. DCD TAMPER_IRQHandler ; Tamper
  70. DCD RTC_IRQHandler ; RTC
  71. DCD FLASH_IRQHandler ; Flash
  72. DCD RCC_IRQHandler ; RCC
  73. DCD EXTI0_IRQHandler ; EXTI Line 0
  74. DCD EXTI1_IRQHandler ; EXTI Line 1
  75. DCD EXTI2_IRQHandler ; EXTI Line 2
  76. DCD EXTI3_IRQHandler ; EXTI Line 3
  77. DCD EXTI4_IRQHandler ; EXTI Line 4
  78. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  79. DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
  80. DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
  81. DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
  82. DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
  83. DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
  84. DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
  85. DCD ADC1_IRQHandler ; ADC1
  86. DCD 0 ; Reserved
  87. DCD 0 ; Reserved
  88. DCD 0 ; Reserved
  89. DCD 0 ; Reserved
  90. DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
  91. DCD 0 ; Reserved
  92. DCD 0 ; Reserved
  93. DCD 0 ; Reserved
  94. DCD 0 ; Reserved
  95. DCD TIM2_IRQHandler ; TIM2
  96. DCD TIM3_IRQHandler ; TIM3
  97. DCD TIM4_IRQHandler ; TIM4
  98. DCD I2C1_EV_IRQHandler ; I2C1 Event
  99. DCD I2C1_ER_IRQHandler ; I2C1 Error
  100. DCD I2C2_EV_IRQHandler ; I2C2 Event
  101. DCD I2C2_ER_IRQHandler ; I2C2 Error
  102. DCD SPI1_IRQHandler ; SPI1
  103. DCD SPI2_IRQHandler ; SPI2
  104. DCD USART1_IRQHandler ; USART1
  105. DCD USART2_IRQHandler ; USART2
  106. DCD USART3_IRQHandler ; USART3
  107. DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
  108. DCD RTC_Alarm_IRQHandler ; RTC Alarm 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 FSMC_IRQHandler ; FSMC
  116. DCD 0 ; Reserved
  117. DCD TIM5_IRQHandler ; TIM5
  118. DCD SPI3_IRQHandler ; SPI3
  119. DCD UART4_IRQHandler ; UART4
  120. DCD UART5_IRQHandler ; UART5
  121. DCD TIM6_IRQHandler ; TIM6
  122. DCD TIM7_IRQHandler ; TIM7
  123. DCD DMA2_Channel1_IRQHandler ; DMA2 Channel1
  124. DCD DMA2_Channel2_IRQHandler ; DMA2 Channel2
  125. DCD DMA2_Channel3_IRQHandler ; DMA2 Channel3
  126. DCD DMA2_Channel4_5_IRQHandler ; DMA2 Channel4 & Channel5
  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 TIM2_IRQHandler
  256. SECTION .text:CODE:REORDER:NOROOT(1)
  257. TIM2_IRQHandler
  258. B TIM2_IRQHandler
  259. PUBWEAK TIM3_IRQHandler
  260. SECTION .text:CODE:REORDER:NOROOT(1)
  261. TIM3_IRQHandler
  262. B TIM3_IRQHandler
  263. PUBWEAK TIM4_IRQHandler
  264. SECTION .text:CODE:REORDER:NOROOT(1)
  265. TIM4_IRQHandler
  266. B TIM4_IRQHandler
  267. PUBWEAK I2C1_EV_IRQHandler
  268. SECTION .text:CODE:REORDER:NOROOT(1)
  269. I2C1_EV_IRQHandler
  270. B I2C1_EV_IRQHandler
  271. PUBWEAK I2C1_ER_IRQHandler
  272. SECTION .text:CODE:REORDER:NOROOT(1)
  273. I2C1_ER_IRQHandler
  274. B I2C1_ER_IRQHandler
  275. PUBWEAK I2C2_EV_IRQHandler
  276. SECTION .text:CODE:REORDER:NOROOT(1)
  277. I2C2_EV_IRQHandler
  278. B I2C2_EV_IRQHandler
  279. PUBWEAK I2C2_ER_IRQHandler
  280. SECTION .text:CODE:REORDER:NOROOT(1)
  281. I2C2_ER_IRQHandler
  282. B I2C2_ER_IRQHandler
  283. PUBWEAK SPI1_IRQHandler
  284. SECTION .text:CODE:REORDER:NOROOT(1)
  285. SPI1_IRQHandler
  286. B SPI1_IRQHandler
  287. PUBWEAK SPI2_IRQHandler
  288. SECTION .text:CODE:REORDER:NOROOT(1)
  289. SPI2_IRQHandler
  290. B SPI2_IRQHandler
  291. PUBWEAK USART1_IRQHandler
  292. SECTION .text:CODE:REORDER:NOROOT(1)
  293. USART1_IRQHandler
  294. B USART1_IRQHandler
  295. PUBWEAK USART2_IRQHandler
  296. SECTION .text:CODE:REORDER:NOROOT(1)
  297. USART2_IRQHandler
  298. B USART2_IRQHandler
  299. PUBWEAK USART3_IRQHandler
  300. SECTION .text:CODE:REORDER:NOROOT(1)
  301. USART3_IRQHandler
  302. B USART3_IRQHandler
  303. PUBWEAK EXTI15_10_IRQHandler
  304. SECTION .text:CODE:REORDER:NOROOT(1)
  305. EXTI15_10_IRQHandler
  306. B EXTI15_10_IRQHandler
  307. PUBWEAK RTC_Alarm_IRQHandler
  308. SECTION .text:CODE:REORDER:NOROOT(1)
  309. RTC_Alarm_IRQHandler
  310. B RTC_Alarm_IRQHandler
  311. PUBWEAK FSMC_IRQHandler
  312. SECTION .text:CODE:REORDER:NOROOT(1)
  313. FSMC_IRQHandler
  314. B FSMC_IRQHandler
  315. PUBWEAK SDIO_IRQHandler
  316. SECTION .text:CODE:REORDER:NOROOT(1)
  317. SDIO_IRQHandler
  318. B SDIO_IRQHandler
  319. PUBWEAK TIM5_IRQHandler
  320. SECTION .text:CODE:REORDER:NOROOT(1)
  321. TIM5_IRQHandler
  322. B TIM5_IRQHandler
  323. PUBWEAK SPI3_IRQHandler
  324. SECTION .text:CODE:REORDER:NOROOT(1)
  325. SPI3_IRQHandler
  326. B SPI3_IRQHandler
  327. PUBWEAK UART4_IRQHandler
  328. SECTION .text:CODE:REORDER:NOROOT(1)
  329. UART4_IRQHandler
  330. B UART4_IRQHandler
  331. PUBWEAK UART5_IRQHandler
  332. SECTION .text:CODE:REORDER:NOROOT(1)
  333. UART5_IRQHandler
  334. B UART5_IRQHandler
  335. PUBWEAK TIM6_IRQHandler
  336. SECTION .text:CODE:REORDER:NOROOT(1)
  337. TIM6_IRQHandler
  338. B TIM6_IRQHandler
  339. PUBWEAK TIM7_IRQHandler
  340. SECTION .text:CODE:REORDER:NOROOT(1)
  341. TIM7_IRQHandler
  342. B TIM7_IRQHandler
  343. PUBWEAK DMA2_Channel1_IRQHandler
  344. SECTION .text:CODE:REORDER:NOROOT(1)
  345. DMA2_Channel1_IRQHandler
  346. B DMA2_Channel1_IRQHandler
  347. PUBWEAK DMA2_Channel2_IRQHandler
  348. SECTION .text:CODE:REORDER:NOROOT(1)
  349. DMA2_Channel2_IRQHandler
  350. B DMA2_Channel2_IRQHandler
  351. PUBWEAK DMA2_Channel3_IRQHandler
  352. SECTION .text:CODE:REORDER:NOROOT(1)
  353. DMA2_Channel3_IRQHandler
  354. B DMA2_Channel3_IRQHandler
  355. PUBWEAK DMA2_Channel4_5_IRQHandler
  356. SECTION .text:CODE:REORDER:NOROOT(1)
  357. DMA2_Channel4_5_IRQHandler
  358. B DMA2_Channel4_5_IRQHandler
  359. END