startup_MM32L0xx.s 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. ;******************** (C) COPYRIGHT 2017 MindMotion ********************
  2. ;* File Name : startup_mm32L0xx.s
  3. ;* Author : AE Team
  4. ;* Version : V2.0.0
  5. ;* Date : 22/08/2017
  6. ;* Description : MM32L0xx Medium-density 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-M0 processor is in Thread mode,
  16. ;* priority is Privileged, and the Stack is set to Main.
  17. ;*******************************************************************************
  18. ;
  19. ;
  20. ; The modules in this file are included in the libraries, and may be replaced
  21. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  22. ; a user defined start symbol.
  23. ; To override the cstartup defined in the library, simply add your modified
  24. ; version to the workbench project.
  25. ;
  26. ; The vector table is normally located at address 0.
  27. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  28. ; The name "__vector_table" has special meaning for C-SPY:
  29. ; it is where the SP start value is found, and the NVIC vector
  30. ; table register (VTOR) is initialized to this address if != 0.
  31. ;
  32. ; Cortex-M version
  33. ;
  34. MODULE ?cstartup
  35. ;; Forward declaration of sections.
  36. SECTION CSTACK:DATA:NOROOT(3)
  37. SECTION .intvec:CODE:NOROOT(2)
  38. EXTERN __iar_program_start
  39. EXTERN SystemInit
  40. PUBLIC __vector_table
  41. DATA
  42. __vector_table
  43. DCD sfe(CSTACK)
  44. DCD Reset_Handler ; Reset Handler
  45. DCD NMI_Handler ; NMI Handler
  46. DCD HardFault_Handler ; Hard Fault Handler
  47. DCD 0 ; Reserved
  48. DCD 0 ; Reserved
  49. DCD 0 ; Reserved
  50. DCD 0 ; Reserved
  51. DCD 0 ; Reserved
  52. DCD 0 ; Reserved
  53. DCD 0 ; Reserved
  54. DCD SVC_Handler ; SVCall Handler
  55. DCD 0 ; Reserved
  56. DCD 0 ; Reserved
  57. DCD PendSV_Handler ; PendSV Handler
  58. DCD SysTick_Handler ; SysTick Handler
  59. ; External Interrupts
  60. DCD WWDG_IRQHandler ; Window Watchdog
  61. DCD PVD_IRQHandler ; PVD through EXTI Line detect
  62. DCD RTC_IRQHandler ; RTC through EXTI Line & Tamper
  63. DCD FLASH_IRQHandler ; FLASH
  64. DCD RCC_CRS_IRQHandler ; RCC & CRS
  65. DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
  66. DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
  67. DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
  68. DCD 0 ; Reserved
  69. DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
  70. DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
  71. DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5
  72. DCD ADC_COMP_IRQHandler ; ADC1 & COMP
  73. DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
  74. DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
  75. DCD TIM2_IRQHandler ; TIM2
  76. DCD TIM3_IRQHandler ; TIM3
  77. DCD 0 ; Reserved
  78. DCD 0 ; Reserved
  79. DCD TIM14_IRQHandler ; TIM14
  80. DCD 0 ; Reserved
  81. DCD TIM16_IRQHandler ; TIM16
  82. DCD TIM17_IRQHandler ; TIM17
  83. DCD I2C1_IRQHandler ; I2C1
  84. DCD 0 ; Reserved
  85. DCD SPI1_IRQHandler ; SPI1
  86. DCD SPI2_IRQHandler ; SPI2
  87. DCD UART1_IRQHandler ; UART1
  88. DCD UART2_IRQHandler ; UART2
  89. DCD AES_IRQHandler ; AES
  90. DCD CAN_IRQHandler ; CAN
  91. DCD USB_IRQHandler ; USB
  92. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  93. ;;
  94. ;; Default interrupt handlers.
  95. ;;
  96. THUMB
  97. PUBWEAK Reset_Handler
  98. SECTION .text:CODE:NOROOT:REORDER(2)
  99. Reset_Handler
  100. LDR R0, =SystemInit
  101. BLX R0
  102. LDR R0, =__iar_program_start
  103. BX R0
  104. PUBWEAK NMI_Handler
  105. SECTION .text:CODE:NOROOT:REORDER(1)
  106. NMI_Handler
  107. B NMI_Handler
  108. PUBWEAK HardFault_Handler
  109. SECTION .text:CODE:NOROOT:REORDER(1)
  110. HardFault_Handler
  111. B HardFault_Handler
  112. PUBWEAK SVC_Handler
  113. SECTION .text:CODE:NOROOT:REORDER(1)
  114. SVC_Handler
  115. B SVC_Handler
  116. PUBWEAK PendSV_Handler
  117. SECTION .text:CODE:NOROOT:REORDER(1)
  118. PendSV_Handler
  119. B PendSV_Handler
  120. PUBWEAK SysTick_Handler
  121. SECTION .text:CODE:NOROOT:REORDER(1)
  122. SysTick_Handler
  123. B SysTick_Handler
  124. PUBWEAK WWDG_IRQHandler
  125. SECTION .text:CODE:NOROOT:REORDER(1)
  126. WWDG_IRQHandler
  127. B WWDG_IRQHandler
  128. PUBWEAK PVD_IRQHandler
  129. SECTION .text:CODE:NOROOT:REORDER(1)
  130. PVD_IRQHandler
  131. B PVD_IRQHandler
  132. PUBWEAK RTC_IRQHandler
  133. SECTION .text:CODE:NOROOT:REORDER(1)
  134. RTC_IRQHandler
  135. B RTC_IRQHandler
  136. PUBWEAK FLASH_IRQHandler
  137. SECTION .text:CODE:NOROOT:REORDER(1)
  138. FLASH_IRQHandler
  139. B FLASH_IRQHandler
  140. PUBWEAK RCC_CRS_IRQHandler
  141. SECTION .text:CODE:NOROOT:REORDER(1)
  142. RCC_CRS_IRQHandler
  143. B RCC_CRS_IRQHandler
  144. PUBWEAK EXTI0_1_IRQHandler
  145. SECTION .text:CODE:NOROOT:REORDER(1)
  146. EXTI0_1_IRQHandler
  147. B EXTI0_1_IRQHandler
  148. PUBWEAK EXTI2_3_IRQHandler
  149. SECTION .text:CODE:NOROOT:REORDER(1)
  150. EXTI2_3_IRQHandler
  151. B EXTI2_3_IRQHandler
  152. PUBWEAK EXTI4_15_IRQHandler
  153. SECTION .text:CODE:NOROOT:REORDER(1)
  154. EXTI4_15_IRQHandler
  155. B EXTI4_15_IRQHandler
  156. PUBWEAK DMA1_Channel1_IRQHandler
  157. SECTION .text:CODE:NOROOT:REORDER(1)
  158. DMA1_Channel1_IRQHandler
  159. B DMA1_Channel1_IRQHandler
  160. PUBWEAK DMA1_Channel2_3_IRQHandler
  161. SECTION .text:CODE:NOROOT:REORDER(1)
  162. DMA1_Channel2_3_IRQHandler
  163. B DMA1_Channel2_3_IRQHandler
  164. PUBWEAK DMA1_Channel4_5_IRQHandler
  165. SECTION .text:CODE:NOROOT:REORDER(1)
  166. DMA1_Channel4_5_IRQHandler
  167. B DMA1_Channel4_5_IRQHandler
  168. PUBWEAK ADC_COMP_IRQHandler
  169. SECTION .text:CODE:NOROOT:REORDER(1)
  170. ADC_COMP_IRQHandler
  171. B ADC_COMP_IRQHandler
  172. PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler
  173. SECTION .text:CODE:NOROOT:REORDER(1)
  174. TIM1_BRK_UP_TRG_COM_IRQHandler
  175. B TIM1_BRK_UP_TRG_COM_IRQHandler
  176. PUBWEAK TIM1_CC_IRQHandler
  177. SECTION .text:CODE:NOROOT:REORDER(1)
  178. TIM1_CC_IRQHandler
  179. B TIM1_CC_IRQHandler
  180. PUBWEAK TIM2_IRQHandler
  181. SECTION .text:CODE:NOROOT:REORDER(1)
  182. TIM2_IRQHandler
  183. B TIM2_IRQHandler
  184. PUBWEAK TIM3_IRQHandler
  185. SECTION .text:CODE:NOROOT:REORDER(1)
  186. TIM3_IRQHandler
  187. B TIM3_IRQHandler
  188. PUBWEAK TIM14_IRQHandler
  189. SECTION .text:CODE:NOROOT:REORDER(1)
  190. TIM14_IRQHandler
  191. B TIM14_IRQHandler
  192. PUBWEAK TIM16_IRQHandler
  193. SECTION .text:CODE:NOROOT:REORDER(1)
  194. TIM16_IRQHandler
  195. B TIM16_IRQHandler
  196. PUBWEAK TIM17_IRQHandler
  197. SECTION .text:CODE:NOROOT:REORDER(1)
  198. TIM17_IRQHandler
  199. B TIM17_IRQHandler
  200. PUBWEAK I2C1_IRQHandler
  201. SECTION .text:CODE:NOROOT:REORDER(1)
  202. I2C1_IRQHandler
  203. B I2C1_IRQHandler
  204. PUBWEAK SPI1_IRQHandler
  205. SECTION .text:CODE:NOROOT:REORDER(1)
  206. SPI1_IRQHandler
  207. B SPI1_IRQHandler
  208. PUBWEAK SPI2_IRQHandler
  209. SECTION .text:CODE:NOROOT:REORDER(1)
  210. SPI2_IRQHandler
  211. B SPI2_IRQHandler
  212. PUBWEAK UART1_IRQHandler
  213. SECTION .text:CODE:NOROOT:REORDER(1)
  214. UART1_IRQHandler
  215. B UART1_IRQHandler
  216. PUBWEAK UART2_IRQHandler
  217. SECTION .text:CODE:NOROOT:REORDER(1)
  218. UART2_IRQHandler
  219. B UART2_IRQHandler
  220. PUBWEAK AES_IRQHandler
  221. SECTION .text:CODE:NOROOT:REORDER(1)
  222. AES_IRQHandler
  223. B AES_IRQHandler
  224. PUBWEAK CAN_IRQHandler
  225. SECTION .text:CODE:NOROOT:REORDER(1)
  226. CAN_IRQHandler
  227. B CAN_IRQHandler
  228. PUBWEAK USB_IRQHandler
  229. SECTION .text:CODE:NOROOT:REORDER(1)
  230. USB_IRQHandler
  231. B USB_IRQHandler
  232. END
  233. ;******************** (C) COPYRIGHT 2017 MindMotion ********************