Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
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.
 
 
 
 
 
 

401 lines
10 KiB

  1. /**
  2. ******************************************************************************
  3. * @file startup_stm32l151xc.s
  4. * @author MCD Application Team
  5. * @brief STM32L151XC Devices vector table for 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. * - Configure the clock system
  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. * @attention
  18. *
  19. * Copyright (c) 2017 STMicroelectronics. All rights reserved.
  20. *
  21. * This software component is licensed by ST under BSD 3-Clause license,
  22. * the "License"; You may not use this file except in compliance with the
  23. * License. You may obtain a copy of the License at:
  24. * opensource.org/licenses/BSD-3-Clause
  25. *
  26. ******************************************************************************
  27. */
  28. .syntax unified
  29. .cpu cortex-m3
  30. .fpu softvfp
  31. .thumb
  32. .global g_pfnVectors
  33. .global Default_Handler
  34. /* start address for the initialization values of the .data section.
  35. defined in linker script */
  36. .word _sidata
  37. /* start address for the .data section. defined in linker script */
  38. .word _sdata
  39. /* end address for the .data section. defined in linker script */
  40. .word _edata
  41. /* start address for the .bss section. defined in linker script */
  42. .word _sbss
  43. /* end address for the .bss section. defined in linker script */
  44. .word _ebss
  45. .equ BootRAM, 0xF108F85F
  46. /**
  47. * @brief This is the code that gets called when the processor first
  48. * starts execution following a reset event. Only the absolutely
  49. * necessary set is performed, after which the application
  50. * supplied main() routine is called.
  51. * @param None
  52. * @retval : None
  53. */
  54. .section .text.Reset_Handler
  55. .weak Reset_Handler
  56. .type Reset_Handler, %function
  57. Reset_Handler:
  58. /* Copy the data segment initializers from flash to SRAM */
  59. movs r1, #0
  60. b LoopCopyDataInit
  61. CopyDataInit:
  62. ldr r3, =_sidata
  63. ldr r3, [r3, r1]
  64. str r3, [r0, r1]
  65. adds r1, r1, #4
  66. LoopCopyDataInit:
  67. ldr r0, =_sdata
  68. ldr r3, =_edata
  69. adds r2, r0, r1
  70. cmp r2, r3
  71. bcc CopyDataInit
  72. ldr r2, =_sbss
  73. b LoopFillZerobss
  74. /* Zero fill the bss segment. */
  75. FillZerobss:
  76. movs r3, #0
  77. str r3, [r2], #4
  78. LoopFillZerobss:
  79. ldr r3, = _ebss
  80. cmp r2, r3
  81. bcc FillZerobss
  82. /* Call the clock system intitialization function.*/
  83. bl SystemInit
  84. /* Call static constructors */
  85. bl __libc_init_array
  86. /* Call the application's entry point.*/
  87. bl main
  88. bx lr
  89. .size Reset_Handler, .-Reset_Handler
  90. /**
  91. * @brief This is the code that gets called when the processor receives an
  92. * unexpected interrupt. This simply enters an infinite loop, preserving
  93. * the system state for examination by a debugger.
  94. *
  95. * @param None
  96. * @retval : None
  97. */
  98. .section .text.Default_Handler,"ax",%progbits
  99. Default_Handler:
  100. Infinite_Loop:
  101. b Infinite_Loop
  102. .size Default_Handler, .-Default_Handler
  103. /******************************************************************************
  104. *
  105. * The minimal vector table for a Cortex M3. Note that the proper constructs
  106. * must be placed on this to ensure that it ends up at physical address
  107. * 0x0000.0000.
  108. *
  109. ******************************************************************************/
  110. .section .isr_vector,"a",%progbits
  111. .type g_pfnVectors, %object
  112. .size g_pfnVectors, .-g_pfnVectors
  113. g_pfnVectors:
  114. .word _estack
  115. .word Reset_Handler
  116. .word NMI_Handler
  117. .word HardFault_Handler
  118. .word MemManage_Handler
  119. .word BusFault_Handler
  120. .word UsageFault_Handler
  121. .word 0
  122. .word 0
  123. .word 0
  124. .word 0
  125. .word SVC_Handler
  126. .word DebugMon_Handler
  127. .word 0
  128. .word PendSV_Handler
  129. .word SysTick_Handler
  130. .word WWDG_IRQHandler
  131. .word PVD_IRQHandler
  132. .word TAMPER_STAMP_IRQHandler
  133. .word RTC_WKUP_IRQHandler
  134. .word FLASH_IRQHandler
  135. .word RCC_IRQHandler
  136. .word EXTI0_IRQHandler
  137. .word EXTI1_IRQHandler
  138. .word EXTI2_IRQHandler
  139. .word EXTI3_IRQHandler
  140. .word EXTI4_IRQHandler
  141. .word DMA1_Channel1_IRQHandler
  142. .word DMA1_Channel2_IRQHandler
  143. .word DMA1_Channel3_IRQHandler
  144. .word DMA1_Channel4_IRQHandler
  145. .word DMA1_Channel5_IRQHandler
  146. .word DMA1_Channel6_IRQHandler
  147. .word DMA1_Channel7_IRQHandler
  148. .word ADC1_IRQHandler
  149. .word USB_HP_IRQHandler
  150. .word USB_LP_IRQHandler
  151. .word DAC_IRQHandler
  152. .word COMP_IRQHandler
  153. .word EXTI9_5_IRQHandler
  154. .word 0
  155. .word TIM9_IRQHandler
  156. .word TIM10_IRQHandler
  157. .word TIM11_IRQHandler
  158. .word TIM2_IRQHandler
  159. .word TIM3_IRQHandler
  160. .word TIM4_IRQHandler
  161. .word I2C1_EV_IRQHandler
  162. .word I2C1_ER_IRQHandler
  163. .word I2C2_EV_IRQHandler
  164. .word I2C2_ER_IRQHandler
  165. .word SPI1_IRQHandler
  166. .word SPI2_IRQHandler
  167. .word USART1_IRQHandler
  168. .word USART2_IRQHandler
  169. .word USART3_IRQHandler
  170. .word EXTI15_10_IRQHandler
  171. .word RTC_Alarm_IRQHandler
  172. .word USB_FS_WKUP_IRQHandler
  173. .word TIM6_IRQHandler
  174. .word TIM7_IRQHandler
  175. .word 0
  176. .word TIM5_IRQHandler
  177. .word SPI3_IRQHandler
  178. .word 0
  179. .word 0
  180. .word DMA2_Channel1_IRQHandler
  181. .word DMA2_Channel2_IRQHandler
  182. .word DMA2_Channel3_IRQHandler
  183. .word DMA2_Channel4_IRQHandler
  184. .word DMA2_Channel5_IRQHandler
  185. .word 0
  186. .word COMP_ACQ_IRQHandler
  187. .word 0
  188. .word 0
  189. .word 0
  190. .word 0
  191. .word 0
  192. .word BootRAM /* @0x108. This is for boot in RAM mode for
  193. STM32L151XC devices. */
  194. /*******************************************************************************
  195. *
  196. * Provide weak aliases for each Exception handler to the Default_Handler.
  197. * As they are weak aliases, any function with the same name will override
  198. * this definition.
  199. *
  200. *******************************************************************************/
  201. .weak NMI_Handler
  202. .thumb_set NMI_Handler,Default_Handler
  203. .weak HardFault_Handler
  204. .thumb_set HardFault_Handler,Default_Handler
  205. .weak MemManage_Handler
  206. .thumb_set MemManage_Handler,Default_Handler
  207. .weak BusFault_Handler
  208. .thumb_set BusFault_Handler,Default_Handler
  209. .weak UsageFault_Handler
  210. .thumb_set UsageFault_Handler,Default_Handler
  211. .weak SVC_Handler
  212. .thumb_set SVC_Handler,Default_Handler
  213. .weak DebugMon_Handler
  214. .thumb_set DebugMon_Handler,Default_Handler
  215. .weak PendSV_Handler
  216. .thumb_set PendSV_Handler,Default_Handler
  217. .weak SysTick_Handler
  218. .thumb_set SysTick_Handler,Default_Handler
  219. .weak WWDG_IRQHandler
  220. .thumb_set WWDG_IRQHandler,Default_Handler
  221. .weak PVD_IRQHandler
  222. .thumb_set PVD_IRQHandler,Default_Handler
  223. .weak TAMPER_STAMP_IRQHandler
  224. .thumb_set TAMPER_STAMP_IRQHandler,Default_Handler
  225. .weak RTC_WKUP_IRQHandler
  226. .thumb_set RTC_WKUP_IRQHandler,Default_Handler
  227. .weak FLASH_IRQHandler
  228. .thumb_set FLASH_IRQHandler,Default_Handler
  229. .weak RCC_IRQHandler
  230. .thumb_set RCC_IRQHandler,Default_Handler
  231. .weak EXTI0_IRQHandler
  232. .thumb_set EXTI0_IRQHandler,Default_Handler
  233. .weak EXTI1_IRQHandler
  234. .thumb_set EXTI1_IRQHandler,Default_Handler
  235. .weak EXTI2_IRQHandler
  236. .thumb_set EXTI2_IRQHandler,Default_Handler
  237. .weak EXTI3_IRQHandler
  238. .thumb_set EXTI3_IRQHandler,Default_Handler
  239. .weak EXTI4_IRQHandler
  240. .thumb_set EXTI4_IRQHandler,Default_Handler
  241. .weak DMA1_Channel1_IRQHandler
  242. .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
  243. .weak DMA1_Channel2_IRQHandler
  244. .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
  245. .weak DMA1_Channel3_IRQHandler
  246. .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
  247. .weak DMA1_Channel4_IRQHandler
  248. .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
  249. .weak DMA1_Channel5_IRQHandler
  250. .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
  251. .weak DMA1_Channel6_IRQHandler
  252. .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
  253. .weak DMA1_Channel7_IRQHandler
  254. .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
  255. .weak ADC1_IRQHandler
  256. .thumb_set ADC1_IRQHandler,Default_Handler
  257. .weak USB_HP_IRQHandler
  258. .thumb_set USB_HP_IRQHandler,Default_Handler
  259. .weak USB_LP_IRQHandler
  260. .thumb_set USB_LP_IRQHandler,Default_Handler
  261. .weak DAC_IRQHandler
  262. .thumb_set DAC_IRQHandler,Default_Handler
  263. .weak COMP_IRQHandler
  264. .thumb_set COMP_IRQHandler,Default_Handler
  265. .weak EXTI9_5_IRQHandler
  266. .thumb_set EXTI9_5_IRQHandler,Default_Handler
  267. .weak TIM9_IRQHandler
  268. .thumb_set TIM9_IRQHandler,Default_Handler
  269. .weak TIM10_IRQHandler
  270. .thumb_set TIM10_IRQHandler,Default_Handler
  271. .weak TIM11_IRQHandler
  272. .thumb_set TIM11_IRQHandler,Default_Handler
  273. .weak TIM2_IRQHandler
  274. .thumb_set TIM2_IRQHandler,Default_Handler
  275. .weak TIM3_IRQHandler
  276. .thumb_set TIM3_IRQHandler,Default_Handler
  277. .weak TIM4_IRQHandler
  278. .thumb_set TIM4_IRQHandler,Default_Handler
  279. .weak I2C1_EV_IRQHandler
  280. .thumb_set I2C1_EV_IRQHandler,Default_Handler
  281. .weak I2C1_ER_IRQHandler
  282. .thumb_set I2C1_ER_IRQHandler,Default_Handler
  283. .weak I2C2_EV_IRQHandler
  284. .thumb_set I2C2_EV_IRQHandler,Default_Handler
  285. .weak I2C2_ER_IRQHandler
  286. .thumb_set I2C2_ER_IRQHandler,Default_Handler
  287. .weak SPI1_IRQHandler
  288. .thumb_set SPI1_IRQHandler,Default_Handler
  289. .weak SPI2_IRQHandler
  290. .thumb_set SPI2_IRQHandler,Default_Handler
  291. .weak USART1_IRQHandler
  292. .thumb_set USART1_IRQHandler,Default_Handler
  293. .weak USART2_IRQHandler
  294. .thumb_set USART2_IRQHandler,Default_Handler
  295. .weak USART3_IRQHandler
  296. .thumb_set USART3_IRQHandler,Default_Handler
  297. .weak EXTI15_10_IRQHandler
  298. .thumb_set EXTI15_10_IRQHandler,Default_Handler
  299. .weak RTC_Alarm_IRQHandler
  300. .thumb_set RTC_Alarm_IRQHandler,Default_Handler
  301. .weak USB_FS_WKUP_IRQHandler
  302. .thumb_set USB_FS_WKUP_IRQHandler,Default_Handler
  303. .weak TIM6_IRQHandler
  304. .thumb_set TIM6_IRQHandler,Default_Handler
  305. .weak TIM7_IRQHandler
  306. .thumb_set TIM7_IRQHandler,Default_Handler
  307. .weak TIM5_IRQHandler
  308. .thumb_set TIM5_IRQHandler,Default_Handler
  309. .weak SPI3_IRQHandler
  310. .thumb_set SPI3_IRQHandler,Default_Handler
  311. .weak DMA2_Channel1_IRQHandler
  312. .thumb_set DMA2_Channel1_IRQHandler,Default_Handler
  313. .weak DMA2_Channel2_IRQHandler
  314. .thumb_set DMA2_Channel2_IRQHandler,Default_Handler
  315. .weak DMA2_Channel3_IRQHandler
  316. .thumb_set DMA2_Channel3_IRQHandler,Default_Handler
  317. .weak DMA2_Channel4_IRQHandler
  318. .thumb_set DMA2_Channel4_IRQHandler,Default_Handler
  319. .weak DMA2_Channel5_IRQHandler
  320. .thumb_set DMA2_Channel5_IRQHandler,Default_Handler
  321. .weak COMP_ACQ_IRQHandler
  322. .thumb_set COMP_ACQ_IRQHandler,Default_Handler
  323. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/