startup_stm32f10x_md_iar.s 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. ;******************** (C) COPYRIGHT 2011 STMicroelectronics ********************
  2. ;* File Name : startup_stm32f10x_md.s
  3. ;* Author : MCD Application Team
  4. ;* Version : V3.5.0
  5. ;* Date : 11-March-2011
  6. ;* Description : STM32F10x Medium Density Devices vector table for
  7. ;* EWARM toolchain.
  8. ;* This module performs:
  9. ;* - Set the initial SP
  10. ;* - Configure the clock system
  11. ;* - Set the initial PC == __iar_program_start,
  12. ;* - Set the vector table entries with the exceptions ISR
  13. ;* address.
  14. ;* After Reset the Cortex-M3 processor is in Thread mode,
  15. ;* priority is Privileged, and the Stack is set to Main.
  16. ;********************************************************************************
  17. ;* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  18. ;* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  19. ;* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  20. ;* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  21. ;* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  22. ;* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  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. EXTERN enter_user_app
  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_2_IRQHandler ; ADC1 & ADC2
  86. DCD USB_HP_CAN1_TX_IRQHandler ; USB High Priority or CAN1 TX
  87. DCD USB_LP_CAN1_RX0_IRQHandler ; USB Low Priority or CAN1 RX0
  88. DCD CAN1_RX1_IRQHandler ; CAN1 RX1
  89. DCD CAN1_SCE_IRQHandler ; CAN1 SCE
  90. DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
  91. DCD TIM1_BRK_IRQHandler ; TIM1 Break
  92. DCD TIM1_UP_IRQHandler ; TIM1 Update
  93. DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation
  94. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  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 RTCAlarm_IRQHandler ; RTC Alarm through EXTI Line
  109. DCD USBWakeUp_IRQHandler ; USB Wakeup from suspend
  110. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  111. ;;
  112. ;; Default interrupt handlers.
  113. ;;
  114. THUMB
  115. PUBWEAK Reset_Handler
  116. SECTION .text:CODE:REORDER(2)
  117. Reset_Handler
  118. ;LDR R0, =SystemInit
  119. ;BLX R0
  120. ;LDR R0, =enter_user_app
  121. ;BLX R0
  122. LDR R0, =__iar_program_start
  123. BX R0
  124. PUBWEAK NMI_Handler
  125. SECTION .text:CODE:REORDER(1)
  126. NMI_Handler
  127. B NMI_Handler
  128. PUBWEAK HardFault_Handler
  129. SECTION .text:CODE:REORDER(1)
  130. HardFault_Handler
  131. B HardFault_Handler
  132. PUBWEAK MemManage_Handler
  133. SECTION .text:CODE:REORDER(1)
  134. MemManage_Handler
  135. B MemManage_Handler
  136. PUBWEAK BusFault_Handler
  137. SECTION .text:CODE:REORDER(1)
  138. BusFault_Handler
  139. B BusFault_Handler
  140. PUBWEAK UsageFault_Handler
  141. SECTION .text:CODE:REORDER(1)
  142. UsageFault_Handler
  143. B UsageFault_Handler
  144. PUBWEAK SVC_Handler
  145. SECTION .text:CODE:REORDER(1)
  146. SVC_Handler
  147. B SVC_Handler
  148. PUBWEAK DebugMon_Handler
  149. SECTION .text:CODE:REORDER(1)
  150. DebugMon_Handler
  151. B DebugMon_Handler
  152. PUBWEAK PendSV_Handler
  153. SECTION .text:CODE:REORDER(1)
  154. PendSV_Handler
  155. B PendSV_Handler
  156. PUBWEAK SysTick_Handler
  157. SECTION .text:CODE:REORDER(1)
  158. SysTick_Handler
  159. B SysTick_Handler
  160. PUBWEAK WWDG_IRQHandler
  161. SECTION .text:CODE:REORDER(1)
  162. WWDG_IRQHandler
  163. B WWDG_IRQHandler
  164. PUBWEAK PVD_IRQHandler
  165. SECTION .text:CODE:REORDER(1)
  166. PVD_IRQHandler
  167. B PVD_IRQHandler
  168. PUBWEAK TAMPER_IRQHandler
  169. SECTION .text:CODE:REORDER(1)
  170. TAMPER_IRQHandler
  171. B TAMPER_IRQHandler
  172. PUBWEAK RTC_IRQHandler
  173. SECTION .text:CODE:REORDER(1)
  174. RTC_IRQHandler
  175. B RTC_IRQHandler
  176. PUBWEAK FLASH_IRQHandler
  177. SECTION .text:CODE:REORDER(1)
  178. FLASH_IRQHandler
  179. B FLASH_IRQHandler
  180. PUBWEAK RCC_IRQHandler
  181. SECTION .text:CODE:REORDER(1)
  182. RCC_IRQHandler
  183. B RCC_IRQHandler
  184. PUBWEAK EXTI0_IRQHandler
  185. SECTION .text:CODE:REORDER(1)
  186. EXTI0_IRQHandler
  187. B EXTI0_IRQHandler
  188. PUBWEAK EXTI1_IRQHandler
  189. SECTION .text:CODE:REORDER(1)
  190. EXTI1_IRQHandler
  191. B EXTI1_IRQHandler
  192. PUBWEAK EXTI2_IRQHandler
  193. SECTION .text:CODE:REORDER(1)
  194. EXTI2_IRQHandler
  195. B EXTI2_IRQHandler
  196. PUBWEAK EXTI3_IRQHandler
  197. SECTION .text:CODE:REORDER(1)
  198. EXTI3_IRQHandler
  199. B EXTI3_IRQHandler
  200. PUBWEAK EXTI4_IRQHandler
  201. SECTION .text:CODE:REORDER(1)
  202. EXTI4_IRQHandler
  203. B EXTI4_IRQHandler
  204. PUBWEAK DMA1_Channel1_IRQHandler
  205. SECTION .text:CODE:REORDER(1)
  206. DMA1_Channel1_IRQHandler
  207. B DMA1_Channel1_IRQHandler
  208. PUBWEAK DMA1_Channel2_IRQHandler
  209. SECTION .text:CODE:REORDER(1)
  210. DMA1_Channel2_IRQHandler
  211. B DMA1_Channel2_IRQHandler
  212. PUBWEAK DMA1_Channel3_IRQHandler
  213. SECTION .text:CODE:REORDER(1)
  214. DMA1_Channel3_IRQHandler
  215. B DMA1_Channel3_IRQHandler
  216. PUBWEAK DMA1_Channel4_IRQHandler
  217. SECTION .text:CODE:REORDER(1)
  218. DMA1_Channel4_IRQHandler
  219. B DMA1_Channel4_IRQHandler
  220. PUBWEAK DMA1_Channel5_IRQHandler
  221. SECTION .text:CODE:REORDER(1)
  222. DMA1_Channel5_IRQHandler
  223. B DMA1_Channel5_IRQHandler
  224. PUBWEAK DMA1_Channel6_IRQHandler
  225. SECTION .text:CODE:REORDER(1)
  226. DMA1_Channel6_IRQHandler
  227. B DMA1_Channel6_IRQHandler
  228. PUBWEAK DMA1_Channel7_IRQHandler
  229. SECTION .text:CODE:REORDER(1)
  230. DMA1_Channel7_IRQHandler
  231. B DMA1_Channel7_IRQHandler
  232. PUBWEAK ADC1_2_IRQHandler
  233. SECTION .text:CODE:REORDER(1)
  234. ADC1_2_IRQHandler
  235. B ADC1_2_IRQHandler
  236. PUBWEAK USB_HP_CAN1_TX_IRQHandler
  237. SECTION .text:CODE:REORDER(1)
  238. USB_HP_CAN1_TX_IRQHandler
  239. B USB_HP_CAN1_TX_IRQHandler
  240. PUBWEAK USB_LP_CAN1_RX0_IRQHandler
  241. SECTION .text:CODE:REORDER(1)
  242. USB_LP_CAN1_RX0_IRQHandler
  243. B USB_LP_CAN1_RX0_IRQHandler
  244. PUBWEAK CAN1_RX1_IRQHandler
  245. SECTION .text:CODE:REORDER(1)
  246. CAN1_RX1_IRQHandler
  247. B CAN1_RX1_IRQHandler
  248. PUBWEAK CAN1_SCE_IRQHandler
  249. SECTION .text:CODE:REORDER(1)
  250. CAN1_SCE_IRQHandler
  251. B CAN1_SCE_IRQHandler
  252. PUBWEAK EXTI9_5_IRQHandler
  253. SECTION .text:CODE:REORDER(1)
  254. EXTI9_5_IRQHandler
  255. B EXTI9_5_IRQHandler
  256. PUBWEAK TIM1_BRK_IRQHandler
  257. SECTION .text:CODE:REORDER(1)
  258. TIM1_BRK_IRQHandler
  259. B TIM1_BRK_IRQHandler
  260. PUBWEAK TIM1_UP_IRQHandler
  261. SECTION .text:CODE:REORDER(1)
  262. TIM1_UP_IRQHandler
  263. B TIM1_UP_IRQHandler
  264. PUBWEAK TIM1_TRG_COM_IRQHandler
  265. SECTION .text:CODE:REORDER(1)
  266. TIM1_TRG_COM_IRQHandler
  267. B TIM1_TRG_COM_IRQHandler
  268. PUBWEAK TIM1_CC_IRQHandler
  269. SECTION .text:CODE:REORDER(1)
  270. TIM1_CC_IRQHandler
  271. B TIM1_CC_IRQHandler
  272. PUBWEAK TIM2_IRQHandler
  273. SECTION .text:CODE:REORDER(1)
  274. TIM2_IRQHandler
  275. B TIM2_IRQHandler
  276. PUBWEAK TIM3_IRQHandler
  277. SECTION .text:CODE:REORDER(1)
  278. TIM3_IRQHandler
  279. B TIM3_IRQHandler
  280. PUBWEAK TIM4_IRQHandler
  281. SECTION .text:CODE:REORDER(1)
  282. TIM4_IRQHandler
  283. B TIM4_IRQHandler
  284. PUBWEAK I2C1_EV_IRQHandler
  285. SECTION .text:CODE:REORDER(1)
  286. I2C1_EV_IRQHandler
  287. B I2C1_EV_IRQHandler
  288. PUBWEAK I2C1_ER_IRQHandler
  289. SECTION .text:CODE:REORDER(1)
  290. I2C1_ER_IRQHandler
  291. B I2C1_ER_IRQHandler
  292. PUBWEAK I2C2_EV_IRQHandler
  293. SECTION .text:CODE:REORDER(1)
  294. I2C2_EV_IRQHandler
  295. B I2C2_EV_IRQHandler
  296. PUBWEAK I2C2_ER_IRQHandler
  297. SECTION .text:CODE:REORDER(1)
  298. I2C2_ER_IRQHandler
  299. B I2C2_ER_IRQHandler
  300. PUBWEAK SPI1_IRQHandler
  301. SECTION .text:CODE:REORDER(1)
  302. SPI1_IRQHandler
  303. B SPI1_IRQHandler
  304. PUBWEAK SPI2_IRQHandler
  305. SECTION .text:CODE:REORDER(1)
  306. SPI2_IRQHandler
  307. B SPI2_IRQHandler
  308. PUBWEAK USART1_IRQHandler
  309. SECTION .text:CODE:REORDER(1)
  310. USART1_IRQHandler
  311. B USART1_IRQHandler
  312. PUBWEAK USART2_IRQHandler
  313. SECTION .text:CODE:REORDER(1)
  314. USART2_IRQHandler
  315. B USART2_IRQHandler
  316. PUBWEAK USART3_IRQHandler
  317. SECTION .text:CODE:REORDER(1)
  318. USART3_IRQHandler
  319. B USART3_IRQHandler
  320. PUBWEAK EXTI15_10_IRQHandler
  321. SECTION .text:CODE:REORDER(1)
  322. EXTI15_10_IRQHandler
  323. B EXTI15_10_IRQHandler
  324. PUBWEAK RTCAlarm_IRQHandler
  325. SECTION .text:CODE:REORDER(1)
  326. RTCAlarm_IRQHandler
  327. B RTCAlarm_IRQHandler
  328. PUBWEAK USBWakeUp_IRQHandler
  329. SECTION .text:CODE:REORDER(1)
  330. USBWakeUp_IRQHandler
  331. B USBWakeUp_IRQHandler
  332. END
  333. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/