startup_stm32f411xe.s 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. ;/******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f411xe.s
  3. ;* Author : MCD Application Team
  4. ;* @version : V1.5.0
  5. ;* @date : 06-March-2015
  6. ;* Description : STM32F401xx devices vector table for EWARM toolchain.
  7. ;* This module performs:
  8. ;* - Set the initial SP
  9. ;* - Set the initial PC == _iar_program_start,
  10. ;* - Set the vector table entries with the exceptions ISR
  11. ;* address.
  12. ;* - Configure the system clock
  13. ;* - Branches to main in the C library (which eventually
  14. ;* calls main()).
  15. ;* After Reset the Cortex-M4 processor is in Thread mode,
  16. ;* priority is Privileged, and the Stack is set to Main.
  17. ;********************************************************************************
  18. ;*
  19. ;* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  20. ;* You may not use this file except in compliance with the License.
  21. ;* You may obtain a copy of the License at:
  22. ;*
  23. ;* http://www.st.com/software_license_agreement_liberty_v2
  24. ;*
  25. ;* Unless required by applicable law or agreed to in writing, software
  26. ;* distributed under the License is distributed on an "AS IS" BASIS,
  27. ;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  28. ;* See the License for the specific language governing permissions and
  29. ;* limitations under the License.
  30. ;*
  31. ;*******************************************************************************/
  32. ;
  33. ;
  34. ; The modules in this file are included in the libraries, and may be replaced
  35. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  36. ; a user defined start symbol.
  37. ; To override the cstartup defined in the library, simply add your modified
  38. ; version to the workbench project.
  39. ;
  40. ; The vector table is normally located at address 0.
  41. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  42. ; The name "__vector_table" has special meaning for C-SPY:
  43. ; it is where the SP start value is found, and the NVIC vector
  44. ; table register (VTOR) is initialized to this address if != 0.
  45. ;
  46. ; Cortex-M version
  47. ;
  48. MODULE ?cstartup
  49. ;; Forward declaration of sections.
  50. SECTION CSTACK:DATA:NOROOT(3)
  51. SECTION .intvec:CODE:NOROOT(2)
  52. EXTERN __iar_program_start
  53. EXTERN SystemInit
  54. PUBLIC __vector_table
  55. DATA
  56. __vector_table
  57. DCD sfe(CSTACK)
  58. DCD Reset_Handler ; Reset Handler
  59. DCD NMI_Handler ; NMI Handler
  60. DCD HardFault_Handler ; Hard Fault Handler
  61. DCD MemManage_Handler ; MPU Fault Handler
  62. DCD BusFault_Handler ; Bus Fault Handler
  63. DCD UsageFault_Handler ; Usage Fault Handler
  64. DCD 0 ; Reserved
  65. DCD 0 ; Reserved
  66. DCD 0 ; Reserved
  67. DCD 0 ; Reserved
  68. DCD SVC_Handler ; SVCall Handler
  69. DCD DebugMon_Handler ; Debug Monitor Handler
  70. DCD 0 ; Reserved
  71. DCD PendSV_Handler ; PendSV Handler
  72. DCD SysTick_Handler ; SysTick Handler
  73. ; External Interrupts
  74. DCD WWDG_IRQHandler ; Window WatchDog
  75. DCD PVD_IRQHandler ; PVD through EXTI Line detection
  76. DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
  77. DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
  78. DCD FLASH_IRQHandler ; FLASH
  79. DCD RCC_IRQHandler ; RCC
  80. DCD EXTI0_IRQHandler ; EXTI Line0
  81. DCD EXTI1_IRQHandler ; EXTI Line1
  82. DCD EXTI2_IRQHandler ; EXTI Line2
  83. DCD EXTI3_IRQHandler ; EXTI Line3
  84. DCD EXTI4_IRQHandler ; EXTI Line4
  85. DCD DMA1_Stream0_IRQHandler ; DMA1 Stream 0
  86. DCD DMA1_Stream1_IRQHandler ; DMA1 Stream 1
  87. DCD DMA1_Stream2_IRQHandler ; DMA1 Stream 2
  88. DCD DMA1_Stream3_IRQHandler ; DMA1 Stream 3
  89. DCD DMA1_Stream4_IRQHandler ; DMA1 Stream 4
  90. DCD DMA1_Stream5_IRQHandler ; DMA1 Stream 5
  91. DCD DMA1_Stream6_IRQHandler ; DMA1 Stream 6
  92. DCD ADC_IRQHandler ; ADC1
  93. DCD 0 ; Reserved
  94. DCD 0 ; Reserved
  95. DCD 0 ; Reserved
  96. DCD 0 ; Reserved
  97. DCD EXTI9_5_IRQHandler ; External Line[9:5]s
  98. DCD TIM1_BRK_TIM9_IRQHandler ; TIM1 Break and TIM9
  99. DCD TIM1_UP_TIM10_IRQHandler ; TIM1 Update and TIM10
  100. DCD TIM1_TRG_COM_TIM11_IRQHandler ; TIM1 Trigger and Commutation and TIM11
  101. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  102. DCD TIM2_IRQHandler ; TIM2
  103. DCD TIM3_IRQHandler ; TIM3
  104. DCD TIM4_IRQHandler ; TIM4
  105. DCD I2C1_EV_IRQHandler ; I2C1 Event
  106. DCD I2C1_ER_IRQHandler ; I2C1 Error
  107. DCD I2C2_EV_IRQHandler ; I2C2 Event
  108. DCD I2C2_ER_IRQHandler ; I2C2 Error
  109. DCD SPI1_IRQHandler ; SPI1
  110. DCD SPI2_IRQHandler ; SPI2
  111. DCD USART1_IRQHandler ; USART1
  112. DCD USART2_IRQHandler ; USART2
  113. DCD 0 ; Reserved
  114. DCD EXTI15_10_IRQHandler ; External Line[15:10]s
  115. DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
  116. DCD OTG_FS_WKUP_IRQHandler ; USB OTG FS Wakeup through EXTI line
  117. DCD 0 ; Reserved
  118. DCD 0 ; Reserved
  119. DCD 0 ; Reserved
  120. DCD 0 ; Reserved
  121. DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
  122. DCD 0 ; Reserved
  123. DCD SDIO_IRQHandler ; SDIO
  124. DCD TIM5_IRQHandler ; TIM5
  125. DCD SPI3_IRQHandler ; SPI3
  126. DCD 0 ; Reserved
  127. DCD 0 ; Reserved
  128. DCD 0 ; Reserved
  129. DCD 0 ; Reserved
  130. DCD DMA2_Stream0_IRQHandler ; DMA2 Stream 0
  131. DCD DMA2_Stream1_IRQHandler ; DMA2 Stream 1
  132. DCD DMA2_Stream2_IRQHandler ; DMA2 Stream 2
  133. DCD DMA2_Stream3_IRQHandler ; DMA2 Stream 3
  134. DCD DMA2_Stream4_IRQHandler ; DMA2 Stream 4
  135. DCD 0 ; Reserved
  136. DCD 0 ; Reserved
  137. DCD 0 ; Reserved
  138. DCD 0 ; Reserved
  139. DCD 0 ; Reserved
  140. DCD 0 ; Reserved
  141. DCD OTG_FS_IRQHandler ; USB OTG FS
  142. DCD DMA2_Stream5_IRQHandler ; DMA2 Stream 5
  143. DCD DMA2_Stream6_IRQHandler ; DMA2 Stream 6
  144. DCD DMA2_Stream7_IRQHandler ; DMA2 Stream 7
  145. DCD USART6_IRQHandler ; USART6
  146. DCD I2C3_EV_IRQHandler ; I2C3 event
  147. DCD I2C3_ER_IRQHandler ; I2C3 error
  148. DCD 0 ; Reserved
  149. DCD 0 ; Reserved
  150. DCD 0 ; Reserved
  151. DCD 0 ; Reserved
  152. DCD 0 ; Reserved
  153. DCD 0 ; Reserved
  154. DCD 0 ; Reserved
  155. DCD FPU_IRQHandler ; FPU
  156. DCD 0 ; Reserved
  157. DCD 0 ; Reserved
  158. DCD SPI4_IRQHandler ; SPI4
  159. DCD SPI5_IRQHandler ; SPI5
  160. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  161. ;;
  162. ;; Default interrupt handlers.
  163. ;;
  164. THUMB
  165. PUBWEAK Reset_Handler
  166. SECTION .text:CODE:REORDER:NOROOT(2)
  167. Reset_Handler
  168. LDR R0, =SystemInit
  169. BLX R0
  170. LDR R0, =__iar_program_start
  171. BX R0
  172. PUBWEAK NMI_Handler
  173. SECTION .text:CODE:REORDER:NOROOT(1)
  174. NMI_Handler
  175. B NMI_Handler
  176. PUBWEAK HardFault_Handler
  177. SECTION .text:CODE:REORDER:NOROOT(1)
  178. HardFault_Handler
  179. B HardFault_Handler
  180. PUBWEAK MemManage_Handler
  181. SECTION .text:CODE:REORDER:NOROOT(1)
  182. MemManage_Handler
  183. B MemManage_Handler
  184. PUBWEAK BusFault_Handler
  185. SECTION .text:CODE:REORDER:NOROOT(1)
  186. BusFault_Handler
  187. B BusFault_Handler
  188. PUBWEAK UsageFault_Handler
  189. SECTION .text:CODE:REORDER:NOROOT(1)
  190. UsageFault_Handler
  191. B UsageFault_Handler
  192. PUBWEAK SVC_Handler
  193. SECTION .text:CODE:REORDER:NOROOT(1)
  194. SVC_Handler
  195. B SVC_Handler
  196. PUBWEAK DebugMon_Handler
  197. SECTION .text:CODE:REORDER:NOROOT(1)
  198. DebugMon_Handler
  199. B DebugMon_Handler
  200. PUBWEAK PendSV_Handler
  201. SECTION .text:CODE:REORDER:NOROOT(1)
  202. PendSV_Handler
  203. B PendSV_Handler
  204. PUBWEAK SysTick_Handler
  205. SECTION .text:CODE:REORDER:NOROOT(1)
  206. SysTick_Handler
  207. B SysTick_Handler
  208. PUBWEAK WWDG_IRQHandler
  209. SECTION .text:CODE:REORDER:NOROOT(1)
  210. WWDG_IRQHandler
  211. B WWDG_IRQHandler
  212. PUBWEAK PVD_IRQHandler
  213. SECTION .text:CODE:REORDER:NOROOT(1)
  214. PVD_IRQHandler
  215. B PVD_IRQHandler
  216. PUBWEAK TAMP_STAMP_IRQHandler
  217. SECTION .text:CODE:REORDER:NOROOT(1)
  218. TAMP_STAMP_IRQHandler
  219. B TAMP_STAMP_IRQHandler
  220. PUBWEAK RTC_WKUP_IRQHandler
  221. SECTION .text:CODE:REORDER:NOROOT(1)
  222. RTC_WKUP_IRQHandler
  223. B RTC_WKUP_IRQHandler
  224. PUBWEAK FLASH_IRQHandler
  225. SECTION .text:CODE:REORDER:NOROOT(1)
  226. FLASH_IRQHandler
  227. B FLASH_IRQHandler
  228. PUBWEAK RCC_IRQHandler
  229. SECTION .text:CODE:REORDER:NOROOT(1)
  230. RCC_IRQHandler
  231. B RCC_IRQHandler
  232. PUBWEAK EXTI0_IRQHandler
  233. SECTION .text:CODE:REORDER:NOROOT(1)
  234. EXTI0_IRQHandler
  235. B EXTI0_IRQHandler
  236. PUBWEAK EXTI1_IRQHandler
  237. SECTION .text:CODE:REORDER:NOROOT(1)
  238. EXTI1_IRQHandler
  239. B EXTI1_IRQHandler
  240. PUBWEAK EXTI2_IRQHandler
  241. SECTION .text:CODE:REORDER:NOROOT(1)
  242. EXTI2_IRQHandler
  243. B EXTI2_IRQHandler
  244. PUBWEAK EXTI3_IRQHandler
  245. SECTION .text:CODE:REORDER:NOROOT(1)
  246. EXTI3_IRQHandler
  247. B EXTI3_IRQHandler
  248. PUBWEAK EXTI4_IRQHandler
  249. SECTION .text:CODE:REORDER:NOROOT(1)
  250. EXTI4_IRQHandler
  251. B EXTI4_IRQHandler
  252. PUBWEAK DMA1_Stream0_IRQHandler
  253. SECTION .text:CODE:REORDER:NOROOT(1)
  254. DMA1_Stream0_IRQHandler
  255. B DMA1_Stream0_IRQHandler
  256. PUBWEAK DMA1_Stream1_IRQHandler
  257. SECTION .text:CODE:REORDER:NOROOT(1)
  258. DMA1_Stream1_IRQHandler
  259. B DMA1_Stream1_IRQHandler
  260. PUBWEAK DMA1_Stream2_IRQHandler
  261. SECTION .text:CODE:REORDER:NOROOT(1)
  262. DMA1_Stream2_IRQHandler
  263. B DMA1_Stream2_IRQHandler
  264. PUBWEAK DMA1_Stream3_IRQHandler
  265. SECTION .text:CODE:REORDER:NOROOT(1)
  266. DMA1_Stream3_IRQHandler
  267. B DMA1_Stream3_IRQHandler
  268. PUBWEAK DMA1_Stream4_IRQHandler
  269. SECTION .text:CODE:REORDER:NOROOT(1)
  270. DMA1_Stream4_IRQHandler
  271. B DMA1_Stream4_IRQHandler
  272. PUBWEAK DMA1_Stream5_IRQHandler
  273. SECTION .text:CODE:REORDER:NOROOT(1)
  274. DMA1_Stream5_IRQHandler
  275. B DMA1_Stream5_IRQHandler
  276. PUBWEAK DMA1_Stream6_IRQHandler
  277. SECTION .text:CODE:REORDER:NOROOT(1)
  278. DMA1_Stream6_IRQHandler
  279. B DMA1_Stream6_IRQHandler
  280. PUBWEAK ADC_IRQHandler
  281. SECTION .text:CODE:REORDER:NOROOT(1)
  282. ADC_IRQHandler
  283. B ADC_IRQHandler
  284. PUBWEAK EXTI9_5_IRQHandler
  285. SECTION .text:CODE:REORDER:NOROOT(1)
  286. EXTI9_5_IRQHandler
  287. B EXTI9_5_IRQHandler
  288. PUBWEAK TIM1_BRK_TIM9_IRQHandler
  289. SECTION .text:CODE:REORDER:NOROOT(1)
  290. TIM1_BRK_TIM9_IRQHandler
  291. B TIM1_BRK_TIM9_IRQHandler
  292. PUBWEAK TIM1_UP_TIM10_IRQHandler
  293. SECTION .text:CODE:REORDER:NOROOT(1)
  294. TIM1_UP_TIM10_IRQHandler
  295. B TIM1_UP_TIM10_IRQHandler
  296. PUBWEAK TIM1_TRG_COM_TIM11_IRQHandler
  297. SECTION .text:CODE:REORDER:NOROOT(1)
  298. TIM1_TRG_COM_TIM11_IRQHandler
  299. B TIM1_TRG_COM_TIM11_IRQHandler
  300. PUBWEAK TIM1_CC_IRQHandler
  301. SECTION .text:CODE:REORDER:NOROOT(1)
  302. TIM1_CC_IRQHandler
  303. B TIM1_CC_IRQHandler
  304. PUBWEAK TIM2_IRQHandler
  305. SECTION .text:CODE:REORDER:NOROOT(1)
  306. TIM2_IRQHandler
  307. B TIM2_IRQHandler
  308. PUBWEAK TIM3_IRQHandler
  309. SECTION .text:CODE:REORDER:NOROOT(1)
  310. TIM3_IRQHandler
  311. B TIM3_IRQHandler
  312. PUBWEAK TIM4_IRQHandler
  313. SECTION .text:CODE:REORDER:NOROOT(1)
  314. TIM4_IRQHandler
  315. B TIM4_IRQHandler
  316. PUBWEAK I2C1_EV_IRQHandler
  317. SECTION .text:CODE:REORDER:NOROOT(1)
  318. I2C1_EV_IRQHandler
  319. B I2C1_EV_IRQHandler
  320. PUBWEAK I2C1_ER_IRQHandler
  321. SECTION .text:CODE:REORDER:NOROOT(1)
  322. I2C1_ER_IRQHandler
  323. B I2C1_ER_IRQHandler
  324. PUBWEAK I2C2_EV_IRQHandler
  325. SECTION .text:CODE:REORDER:NOROOT(1)
  326. I2C2_EV_IRQHandler
  327. B I2C2_EV_IRQHandler
  328. PUBWEAK I2C2_ER_IRQHandler
  329. SECTION .text:CODE:REORDER:NOROOT(1)
  330. I2C2_ER_IRQHandler
  331. B I2C2_ER_IRQHandler
  332. PUBWEAK SPI1_IRQHandler
  333. SECTION .text:CODE:REORDER:NOROOT(1)
  334. SPI1_IRQHandler
  335. B SPI1_IRQHandler
  336. PUBWEAK SPI2_IRQHandler
  337. SECTION .text:CODE:REORDER:NOROOT(1)
  338. SPI2_IRQHandler
  339. B SPI2_IRQHandler
  340. PUBWEAK USART1_IRQHandler
  341. SECTION .text:CODE:REORDER:NOROOT(1)
  342. USART1_IRQHandler
  343. B USART1_IRQHandler
  344. PUBWEAK USART2_IRQHandler
  345. SECTION .text:CODE:REORDER:NOROOT(1)
  346. USART2_IRQHandler
  347. B USART2_IRQHandler
  348. PUBWEAK EXTI15_10_IRQHandler
  349. SECTION .text:CODE:REORDER:NOROOT(1)
  350. EXTI15_10_IRQHandler
  351. B EXTI15_10_IRQHandler
  352. PUBWEAK RTC_Alarm_IRQHandler
  353. SECTION .text:CODE:REORDER:NOROOT(1)
  354. RTC_Alarm_IRQHandler
  355. B RTC_Alarm_IRQHandler
  356. PUBWEAK OTG_FS_WKUP_IRQHandler
  357. SECTION .text:CODE:REORDER:NOROOT(1)
  358. OTG_FS_WKUP_IRQHandler
  359. B OTG_FS_WKUP_IRQHandler
  360. PUBWEAK DMA1_Stream7_IRQHandler
  361. SECTION .text:CODE:REORDER:NOROOT(1)
  362. DMA1_Stream7_IRQHandler
  363. B DMA1_Stream7_IRQHandler
  364. PUBWEAK SDIO_IRQHandler
  365. SECTION .text:CODE:REORDER:NOROOT(1)
  366. SDIO_IRQHandler
  367. B SDIO_IRQHandler
  368. PUBWEAK TIM5_IRQHandler
  369. SECTION .text:CODE:REORDER:NOROOT(1)
  370. TIM5_IRQHandler
  371. B TIM5_IRQHandler
  372. PUBWEAK SPI3_IRQHandler
  373. SECTION .text:CODE:REORDER:NOROOT(1)
  374. SPI3_IRQHandler
  375. B SPI3_IRQHandler
  376. PUBWEAK DMA2_Stream0_IRQHandler
  377. SECTION .text:CODE:REORDER:NOROOT(1)
  378. DMA2_Stream0_IRQHandler
  379. B DMA2_Stream0_IRQHandler
  380. PUBWEAK DMA2_Stream1_IRQHandler
  381. SECTION .text:CODE:REORDER:NOROOT(1)
  382. DMA2_Stream1_IRQHandler
  383. B DMA2_Stream1_IRQHandler
  384. PUBWEAK DMA2_Stream2_IRQHandler
  385. SECTION .text:CODE:REORDER:NOROOT(1)
  386. DMA2_Stream2_IRQHandler
  387. B DMA2_Stream2_IRQHandler
  388. PUBWEAK DMA2_Stream3_IRQHandler
  389. SECTION .text:CODE:REORDER:NOROOT(1)
  390. DMA2_Stream3_IRQHandler
  391. B DMA2_Stream3_IRQHandler
  392. PUBWEAK DMA2_Stream4_IRQHandler
  393. SECTION .text:CODE:REORDER:NOROOT(1)
  394. DMA2_Stream4_IRQHandler
  395. B DMA2_Stream4_IRQHandler
  396. PUBWEAK OTG_FS_IRQHandler
  397. SECTION .text:CODE:REORDER:NOROOT(1)
  398. OTG_FS_IRQHandler
  399. B OTG_FS_IRQHandler
  400. PUBWEAK DMA2_Stream5_IRQHandler
  401. SECTION .text:CODE:REORDER:NOROOT(1)
  402. DMA2_Stream5_IRQHandler
  403. B DMA2_Stream5_IRQHandler
  404. PUBWEAK DMA2_Stream6_IRQHandler
  405. SECTION .text:CODE:REORDER:NOROOT(1)
  406. DMA2_Stream6_IRQHandler
  407. B DMA2_Stream6_IRQHandler
  408. PUBWEAK DMA2_Stream7_IRQHandler
  409. SECTION .text:CODE:REORDER:NOROOT(1)
  410. DMA2_Stream7_IRQHandler
  411. B DMA2_Stream7_IRQHandler
  412. PUBWEAK USART6_IRQHandler
  413. SECTION .text:CODE:REORDER:NOROOT(1)
  414. USART6_IRQHandler
  415. B USART6_IRQHandler
  416. PUBWEAK I2C3_EV_IRQHandler
  417. SECTION .text:CODE:REORDER:NOROOT(1)
  418. I2C3_EV_IRQHandler
  419. B I2C3_EV_IRQHandler
  420. PUBWEAK I2C3_ER_IRQHandler
  421. SECTION .text:CODE:REORDER:NOROOT(1)
  422. I2C3_ER_IRQHandler
  423. B I2C3_ER_IRQHandler
  424. PUBWEAK FPU_IRQHandler
  425. SECTION .text:CODE:REORDER:NOROOT(1)
  426. FPU_IRQHandler
  427. B FPU_IRQHandler
  428. PUBWEAK SPI4_IRQHandler
  429. SECTION .text:CODE:REORDER:NOROOT(1)
  430. SPI4_IRQHandler
  431. B SPI4_IRQHandler
  432. PUBWEAK SPI5_IRQHandler
  433. SECTION .text:CODE:REORDER:NOROOT(1)
  434. SPI5_IRQHandler
  435. B SPI5_IRQHandler
  436. END
  437. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/