You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

434 lines
12 KiB

  1. /**
  2. ******************************************************************************
  3. * @file startup_stm32wb35xx_cm4.s
  4. * @author MCD Application Team
  5. * @brief STM32WB35xx devices vector table GCC toolchain.
  6. * This module performs:
  7. * - Set the initial SP
  8. * - Set the initial PC == Reset_Handler,
  9. * - Set the vector table entries with the exceptions ISR address
  10. * - Branches to main in the C library (which eventually
  11. * calls main()).
  12. * After Reset the Cortex-M4 processor is in Thread mode,
  13. * priority is Privileged, and the Stack is set to Main.
  14. ******************************************************************************
  15. * @attention
  16. *
  17. * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
  18. * All rights reserved.</center></h2>
  19. *
  20. * This software component is licensed by ST under BSD 3-Clause license,
  21. * the "License"; You may not use this file except in compliance with the
  22. * License. You may obtain a copy of the License at:
  23. * opensource.org/licenses/BSD-3-Clause
  24. *
  25. ******************************************************************************
  26. */
  27. .syntax unified
  28. .cpu cortex-m4
  29. .fpu softvfp
  30. .thumb
  31. .global g_pfnVectors
  32. .global Default_Handler
  33. /* start address for the initialization values of the .data section.
  34. defined in linker script */
  35. .word _sidata
  36. /* start address for the .data section. defined in linker script */
  37. .word _sdata
  38. /* end address for the .data section. defined in linker script */
  39. .word _edata
  40. /* start address for the .bss section. defined in linker script */
  41. .word _sbss
  42. /* end address for the .bss section. defined in linker script */
  43. .word _ebss
  44. /* start address for the .MB_MEM2 section. defined in linker script */
  45. .word _sMB_MEM2
  46. /* end address for the .MB_MEM2 section. defined in linker script */
  47. .word _eMB_MEM2
  48. /* INIT_BSS macro is used to fill the specified region [start : end] with zeros */
  49. .macro INIT_BSS start, end
  50. ldr r0, =\start
  51. ldr r1, =\end
  52. movs r3, #0
  53. bl LoopFillZerobss
  54. .endm
  55. /* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */
  56. .macro INIT_DATA start, end, src
  57. ldr r0, =\start
  58. ldr r1, =\end
  59. ldr r2, =\src
  60. movs r3, #0
  61. bl LoopCopyDataInit
  62. .endm
  63. .section .text.data_initializers
  64. CopyDataInit:
  65. ldr r4, [r2, r3]
  66. str r4, [r0, r3]
  67. adds r3, r3, #4
  68. LoopCopyDataInit:
  69. adds r4, r0, r3
  70. cmp r4, r1
  71. bcc CopyDataInit
  72. bx lr
  73. FillZerobss:
  74. str r3, [r0]
  75. adds r0, r0, #4
  76. LoopFillZerobss:
  77. cmp r0, r1
  78. bcc FillZerobss
  79. bx lr
  80. .section .text.Reset_Handler
  81. .weak Reset_Handler
  82. .type Reset_Handler, %function
  83. Reset_Handler:
  84. ldr r0, =_estack
  85. mov sp, r0 /* set stack pointer */
  86. /* Call the clock system intitialization function.*/
  87. bl SystemInit
  88. /* Copy the data segment initializers from flash to SRAM */
  89. INIT_DATA _sdata, _edata, _sidata
  90. /* Zero fill the bss segments. */
  91. INIT_BSS _sbss, _ebss
  92. INIT_BSS _sMB_MEM2, _eMB_MEM2
  93. /* Call static constructors */
  94. bl __libc_init_array
  95. /* Call the application s entry point.*/
  96. bl main
  97. LoopForever:
  98. b LoopForever
  99. .size Reset_Handler, .-Reset_Handler
  100. /**
  101. * @brief This is the code that gets called when the processor receives an
  102. * unexpected interrupt. This simply enters an infinite loop, preserving
  103. * the system state for examination by a debugger.
  104. *
  105. * @param None
  106. * @retval None
  107. */
  108. .section .text.Default_Handler,"ax",%progbits
  109. Default_Handler:
  110. Infinite_Loop:
  111. b Infinite_Loop
  112. .size Default_Handler, .-Default_Handler
  113. /******************************************************************************
  114. *
  115. * The minimal vector table for a Cortex-M4. Note that the proper constructs
  116. * must be placed on this to ensure that it ends up at physical address
  117. * 0x0000.0000.
  118. *
  119. ******************************************************************************/
  120. .section .isr_vector,"a",%progbits
  121. .type g_pfnVectors, %object
  122. .size g_pfnVectors, .-g_pfnVectors
  123. g_pfnVectors:
  124. .word _estack
  125. .word Reset_Handler
  126. .word NMI_Handler
  127. .word HardFault_Handler
  128. .word MemManage_Handler
  129. .word BusFault_Handler
  130. .word UsageFault_Handler
  131. .word 0
  132. .word 0
  133. .word 0
  134. .word 0
  135. .word SVC_Handler
  136. .word DebugMon_Handler
  137. .word 0
  138. .word PendSV_Handler
  139. .word SysTick_Handler
  140. .word WWDG_IRQHandler
  141. .word PVD_PVM_IRQHandler
  142. .word TAMP_STAMP_LSECSS_IRQHandler
  143. .word RTC_WKUP_IRQHandler
  144. .word FLASH_IRQHandler
  145. .word RCC_IRQHandler
  146. .word EXTI0_IRQHandler
  147. .word EXTI1_IRQHandler
  148. .word EXTI2_IRQHandler
  149. .word EXTI3_IRQHandler
  150. .word EXTI4_IRQHandler
  151. .word DMA1_Channel1_IRQHandler
  152. .word DMA1_Channel2_IRQHandler
  153. .word DMA1_Channel3_IRQHandler
  154. .word DMA1_Channel4_IRQHandler
  155. .word DMA1_Channel5_IRQHandler
  156. .word DMA1_Channel6_IRQHandler
  157. .word DMA1_Channel7_IRQHandler
  158. .word ADC1_IRQHandler
  159. .word USB_HP_IRQHandler
  160. .word USB_LP_IRQHandler
  161. .word C2SEV_PWR_C2H_IRQHandler
  162. .word COMP_IRQHandler
  163. .word EXTI9_5_IRQHandler
  164. .word TIM1_BRK_IRQHandler
  165. .word TIM1_UP_TIM16_IRQHandler
  166. .word TIM1_TRG_COM_TIM17_IRQHandler
  167. .word TIM1_CC_IRQHandler
  168. .word TIM2_IRQHandler
  169. .word PKA_IRQHandler
  170. .word I2C1_EV_IRQHandler
  171. .word I2C1_ER_IRQHandler
  172. .word I2C3_EV_IRQHandler
  173. .word I2C3_ER_IRQHandler
  174. .word SPI1_IRQHandler
  175. .word 0
  176. .word USART1_IRQHandler
  177. .word LPUART1_IRQHandler
  178. .word 0
  179. .word 0
  180. .word EXTI15_10_IRQHandler
  181. .word RTC_Alarm_IRQHandler
  182. .word CRS_IRQHandler
  183. .word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
  184. .word IPCC_C1_RX_IRQHandler
  185. .word IPCC_C1_TX_IRQHandler
  186. .word HSEM_IRQHandler
  187. .word LPTIM1_IRQHandler
  188. .word LPTIM2_IRQHandler
  189. .word 0
  190. .word QUADSPI_IRQHandler
  191. .word AES1_IRQHandler
  192. .word AES2_IRQHandler
  193. .word RNG_IRQHandler
  194. .word FPU_IRQHandler
  195. .word DMA2_Channel1_IRQHandler
  196. .word DMA2_Channel2_IRQHandler
  197. .word DMA2_Channel3_IRQHandler
  198. .word DMA2_Channel4_IRQHandler
  199. .word DMA2_Channel5_IRQHandler
  200. .word DMA2_Channel6_IRQHandler
  201. .word DMA2_Channel7_IRQHandler
  202. .word DMAMUX1_OVR_IRQHandler
  203. /*******************************************************************************
  204. *
  205. * Provide weak aliases for each Exception handler to the Default_Handler.
  206. * As they are weak aliases, any function with the same name will override
  207. * this definition.
  208. *
  209. *******************************************************************************/
  210. .weak NMI_Handler
  211. .thumb_set NMI_Handler,Default_Handler
  212. .weak HardFault_Handler
  213. .thumb_set HardFault_Handler,Default_Handler
  214. .weak MemManage_Handler
  215. .thumb_set MemManage_Handler,Default_Handler
  216. .weak BusFault_Handler
  217. .thumb_set BusFault_Handler,Default_Handler
  218. .weak UsageFault_Handler
  219. .thumb_set UsageFault_Handler,Default_Handler
  220. .weak SVC_Handler
  221. .thumb_set SVC_Handler,Default_Handler
  222. .weak DebugMon_Handler
  223. .thumb_set DebugMon_Handler,Default_Handler
  224. .weak PendSV_Handler
  225. .thumb_set PendSV_Handler,Default_Handler
  226. .weak SysTick_Handler
  227. .thumb_set SysTick_Handler,Default_Handler
  228. .weak WWDG_IRQHandler
  229. .thumb_set WWDG_IRQHandler,Default_Handler
  230. .weak PVD_PVM_IRQHandler
  231. .thumb_set PVD_PVM_IRQHandler,Default_Handler
  232. .weak TAMP_STAMP_LSECSS_IRQHandler
  233. .thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler
  234. .weak RTC_WKUP_IRQHandler
  235. .thumb_set RTC_WKUP_IRQHandler,Default_Handler
  236. .weak FLASH_IRQHandler
  237. .thumb_set FLASH_IRQHandler,Default_Handler
  238. .weak RCC_IRQHandler
  239. .thumb_set RCC_IRQHandler,Default_Handler
  240. .weak EXTI0_IRQHandler
  241. .thumb_set EXTI0_IRQHandler,Default_Handler
  242. .weak EXTI1_IRQHandler
  243. .thumb_set EXTI1_IRQHandler,Default_Handler
  244. .weak EXTI2_IRQHandler
  245. .thumb_set EXTI2_IRQHandler,Default_Handler
  246. .weak EXTI3_IRQHandler
  247. .thumb_set EXTI3_IRQHandler,Default_Handler
  248. .weak EXTI4_IRQHandler
  249. .thumb_set EXTI4_IRQHandler,Default_Handler
  250. .weak DMA1_Channel1_IRQHandler
  251. .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
  252. .weak DMA1_Channel2_IRQHandler
  253. .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
  254. .weak DMA1_Channel3_IRQHandler
  255. .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
  256. .weak DMA1_Channel4_IRQHandler
  257. .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
  258. .weak DMA1_Channel5_IRQHandler
  259. .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
  260. .weak DMA1_Channel6_IRQHandler
  261. .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
  262. .weak DMA1_Channel7_IRQHandler
  263. .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
  264. .weak ADC1_IRQHandler
  265. .thumb_set ADC1_IRQHandler,Default_Handler
  266. .weak USB_HP_IRQHandler
  267. .thumb_set USB_HP_IRQHandler,Default_Handler
  268. .weak USB_LP_IRQHandler
  269. .thumb_set USB_LP_IRQHandler,Default_Handler
  270. .weak C2SEV_PWR_C2H_IRQHandler
  271. .thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler
  272. .weak COMP_IRQHandler
  273. .thumb_set COMP_IRQHandler,Default_Handler
  274. .weak EXTI9_5_IRQHandler
  275. .thumb_set EXTI9_5_IRQHandler,Default_Handler
  276. .weak TIM1_BRK_IRQHandler
  277. .thumb_set TIM1_BRK_IRQHandler,Default_Handler
  278. .weak TIM1_UP_TIM16_IRQHandler
  279. .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
  280. .weak TIM1_TRG_COM_TIM17_IRQHandler
  281. .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler
  282. .weak TIM1_CC_IRQHandler
  283. .thumb_set TIM1_CC_IRQHandler,Default_Handler
  284. .weak TIM2_IRQHandler
  285. .thumb_set TIM2_IRQHandler,Default_Handler
  286. .weak PKA_IRQHandler
  287. .thumb_set PKA_IRQHandler,Default_Handler
  288. .weak I2C1_EV_IRQHandler
  289. .thumb_set I2C1_EV_IRQHandler,Default_Handler
  290. .weak I2C1_ER_IRQHandler
  291. .thumb_set I2C1_ER_IRQHandler,Default_Handler
  292. .weak I2C3_EV_IRQHandler
  293. .thumb_set I2C3_EV_IRQHandler,Default_Handler
  294. .weak I2C3_ER_IRQHandler
  295. .thumb_set I2C3_ER_IRQHandler,Default_Handler
  296. .weak SPI1_IRQHandler
  297. .thumb_set SPI1_IRQHandler,Default_Handler
  298. .weak USART1_IRQHandler
  299. .thumb_set USART1_IRQHandler,Default_Handler
  300. .weak LPUART1_IRQHandler
  301. .thumb_set LPUART1_IRQHandler,Default_Handler
  302. .weak EXTI15_10_IRQHandler
  303. .thumb_set EXTI15_10_IRQHandler,Default_Handler
  304. .weak RTC_Alarm_IRQHandler
  305. .thumb_set RTC_Alarm_IRQHandler,Default_Handler
  306. .weak CRS_IRQHandler
  307. .thumb_set CRS_IRQHandler,Default_Handler
  308. .weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler
  309. .thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler
  310. .weak IPCC_C1_RX_IRQHandler
  311. .thumb_set IPCC_C1_RX_IRQHandler,Default_Handler
  312. .weak IPCC_C1_TX_IRQHandler
  313. .thumb_set IPCC_C1_TX_IRQHandler,Default_Handler
  314. .weak HSEM_IRQHandler
  315. .thumb_set HSEM_IRQHandler,Default_Handler
  316. .weak LPTIM1_IRQHandler
  317. .thumb_set LPTIM1_IRQHandler,Default_Handler
  318. .weak LPTIM2_IRQHandler
  319. .thumb_set LPTIM2_IRQHandler,Default_Handler
  320. .weak QUADSPI_IRQHandler
  321. .thumb_set QUADSPI_IRQHandler,Default_Handler
  322. .weak AES1_IRQHandler
  323. .thumb_set AES1_IRQHandler,Default_Handler
  324. .weak AES2_IRQHandler
  325. .thumb_set AES2_IRQHandler,Default_Handler
  326. .weak RNG_IRQHandler
  327. .thumb_set RNG_IRQHandler,Default_Handler
  328. .weak FPU_IRQHandler
  329. .thumb_set FPU_IRQHandler,Default_Handler
  330. .weak DMA2_Channel1_IRQHandler
  331. .thumb_set DMA2_Channel1_IRQHandler,Default_Handler
  332. .weak DMA2_Channel2_IRQHandler
  333. .thumb_set DMA2_Channel2_IRQHandler,Default_Handler
  334. .weak DMA2_Channel3_IRQHandler
  335. .thumb_set DMA2_Channel3_IRQHandler,Default_Handler
  336. .weak DMA2_Channel4_IRQHandler
  337. .thumb_set DMA2_Channel4_IRQHandler,Default_Handler
  338. .weak DMA2_Channel5_IRQHandler
  339. .thumb_set DMA2_Channel5_IRQHandler,Default_Handler
  340. .weak DMA2_Channel6_IRQHandler
  341. .thumb_set DMA2_Channel6_IRQHandler,Default_Handler
  342. .weak DMA2_Channel7_IRQHandler
  343. .thumb_set DMA2_Channel7_IRQHandler,Default_Handler
  344. .weak DMAMUX1_OVR_IRQHandler
  345. .thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler
  346. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/