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.
 
 
 
 
 
 

366 lines
9.7 KiB

  1. /**
  2. *************** (C) COPYRIGHT 2017 STMicroelectronics ************************
  3. * @file startup_stm32f103xb.s
  4. * @author MCD Application Team
  5. * @brief STM32F103xB Devices vector table for Atollic 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. * @attention
  17. *
  18. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  19. * All rights reserved.</center></h2>
  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. ldr r0, =_sdata
  60. ldr r1, =_edata
  61. ldr r2, =_sidata
  62. movs r3, #0
  63. b LoopCopyDataInit
  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. /* Zero fill the bss segment. */
  73. ldr r2, =_sbss
  74. ldr r4, =_ebss
  75. movs r3, #0
  76. b LoopFillZerobss
  77. FillZerobss:
  78. str r3, [r2]
  79. adds r2, r2, #4
  80. LoopFillZerobss:
  81. cmp r2, r4
  82. bcc FillZerobss
  83. /* Call the clock system intitialization function.*/
  84. bl SystemInit
  85. /* Call static constructors */
  86. bl __libc_init_array
  87. /* Call the application's entry point.*/
  88. bl main
  89. bx lr
  90. .size Reset_Handler, .-Reset_Handler
  91. /**
  92. * @brief This is the code that gets called when the processor receives an
  93. * unexpected interrupt. This simply enters an infinite loop, preserving
  94. * the system state for examination by a debugger.
  95. *
  96. * @param None
  97. * @retval : None
  98. */
  99. .section .text.Default_Handler,"ax",%progbits
  100. Default_Handler:
  101. Infinite_Loop:
  102. b Infinite_Loop
  103. .size Default_Handler, .-Default_Handler
  104. /******************************************************************************
  105. *
  106. * The minimal vector table for a Cortex M3. Note that the proper constructs
  107. * must be placed on this to ensure that it ends up at physical address
  108. * 0x0000.0000.
  109. *
  110. ******************************************************************************/
  111. .section .isr_vector,"a",%progbits
  112. .type g_pfnVectors, %object
  113. .size g_pfnVectors, .-g_pfnVectors
  114. g_pfnVectors:
  115. .word _estack
  116. .word Reset_Handler
  117. .word NMI_Handler
  118. .word HardFault_Handler
  119. .word MemManage_Handler
  120. .word BusFault_Handler
  121. .word UsageFault_Handler
  122. .word 0
  123. .word 0
  124. .word 0
  125. .word 0
  126. .word SVC_Handler
  127. .word DebugMon_Handler
  128. .word 0
  129. .word PendSV_Handler
  130. .word SysTick_Handler
  131. .word WWDG_IRQHandler
  132. .word PVD_IRQHandler
  133. .word TAMPER_IRQHandler
  134. .word RTC_IRQHandler
  135. .word FLASH_IRQHandler
  136. .word RCC_IRQHandler
  137. .word EXTI0_IRQHandler
  138. .word EXTI1_IRQHandler
  139. .word EXTI2_IRQHandler
  140. .word EXTI3_IRQHandler
  141. .word EXTI4_IRQHandler
  142. .word DMA1_Channel1_IRQHandler
  143. .word DMA1_Channel2_IRQHandler
  144. .word DMA1_Channel3_IRQHandler
  145. .word DMA1_Channel4_IRQHandler
  146. .word DMA1_Channel5_IRQHandler
  147. .word DMA1_Channel6_IRQHandler
  148. .word DMA1_Channel7_IRQHandler
  149. .word ADC1_2_IRQHandler
  150. .word USB_HP_CAN1_TX_IRQHandler
  151. .word USB_LP_CAN1_RX0_IRQHandler
  152. .word CAN1_RX1_IRQHandler
  153. .word CAN1_SCE_IRQHandler
  154. .word EXTI9_5_IRQHandler
  155. .word TIM1_BRK_IRQHandler
  156. .word TIM1_UP_IRQHandler
  157. .word TIM1_TRG_COM_IRQHandler
  158. .word TIM1_CC_IRQHandler
  159. .word TIM2_IRQHandler
  160. .word TIM3_IRQHandler
  161. .word TIM4_IRQHandler
  162. .word I2C1_EV_IRQHandler
  163. .word I2C1_ER_IRQHandler
  164. .word I2C2_EV_IRQHandler
  165. .word I2C2_ER_IRQHandler
  166. .word SPI1_IRQHandler
  167. .word SPI2_IRQHandler
  168. .word USART1_IRQHandler
  169. .word USART2_IRQHandler
  170. .word USART3_IRQHandler
  171. .word EXTI15_10_IRQHandler
  172. .word RTC_Alarm_IRQHandler
  173. .word USBWakeUp_IRQHandler
  174. .word 0
  175. .word 0
  176. .word 0
  177. .word 0
  178. .word 0
  179. .word 0
  180. .word 0
  181. .word BootRAM /* @0x108. This is for boot in RAM mode for
  182. STM32F10x Medium Density devices. */
  183. /*******************************************************************************
  184. *
  185. * Provide weak aliases for each Exception handler to the Default_Handler.
  186. * As they are weak aliases, any function with the same name will override
  187. * this definition.
  188. *
  189. *******************************************************************************/
  190. .weak NMI_Handler
  191. .thumb_set NMI_Handler,Default_Handler
  192. .weak HardFault_Handler
  193. .thumb_set HardFault_Handler,Default_Handler
  194. .weak MemManage_Handler
  195. .thumb_set MemManage_Handler,Default_Handler
  196. .weak BusFault_Handler
  197. .thumb_set BusFault_Handler,Default_Handler
  198. .weak UsageFault_Handler
  199. .thumb_set UsageFault_Handler,Default_Handler
  200. .weak SVC_Handler
  201. .thumb_set SVC_Handler,Default_Handler
  202. .weak DebugMon_Handler
  203. .thumb_set DebugMon_Handler,Default_Handler
  204. .weak PendSV_Handler
  205. .thumb_set PendSV_Handler,Default_Handler
  206. .weak SysTick_Handler
  207. .thumb_set SysTick_Handler,Default_Handler
  208. .weak WWDG_IRQHandler
  209. .thumb_set WWDG_IRQHandler,Default_Handler
  210. .weak PVD_IRQHandler
  211. .thumb_set PVD_IRQHandler,Default_Handler
  212. .weak TAMPER_IRQHandler
  213. .thumb_set TAMPER_IRQHandler,Default_Handler
  214. .weak RTC_IRQHandler
  215. .thumb_set RTC_IRQHandler,Default_Handler
  216. .weak FLASH_IRQHandler
  217. .thumb_set FLASH_IRQHandler,Default_Handler
  218. .weak RCC_IRQHandler
  219. .thumb_set RCC_IRQHandler,Default_Handler
  220. .weak EXTI0_IRQHandler
  221. .thumb_set EXTI0_IRQHandler,Default_Handler
  222. .weak EXTI1_IRQHandler
  223. .thumb_set EXTI1_IRQHandler,Default_Handler
  224. .weak EXTI2_IRQHandler
  225. .thumb_set EXTI2_IRQHandler,Default_Handler
  226. .weak EXTI3_IRQHandler
  227. .thumb_set EXTI3_IRQHandler,Default_Handler
  228. .weak EXTI4_IRQHandler
  229. .thumb_set EXTI4_IRQHandler,Default_Handler
  230. .weak DMA1_Channel1_IRQHandler
  231. .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
  232. .weak DMA1_Channel2_IRQHandler
  233. .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
  234. .weak DMA1_Channel3_IRQHandler
  235. .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
  236. .weak DMA1_Channel4_IRQHandler
  237. .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
  238. .weak DMA1_Channel5_IRQHandler
  239. .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
  240. .weak DMA1_Channel6_IRQHandler
  241. .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
  242. .weak DMA1_Channel7_IRQHandler
  243. .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
  244. .weak ADC1_2_IRQHandler
  245. .thumb_set ADC1_2_IRQHandler,Default_Handler
  246. .weak USB_HP_CAN1_TX_IRQHandler
  247. .thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler
  248. .weak USB_LP_CAN1_RX0_IRQHandler
  249. .thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler
  250. .weak CAN1_RX1_IRQHandler
  251. .thumb_set CAN1_RX1_IRQHandler,Default_Handler
  252. .weak CAN1_SCE_IRQHandler
  253. .thumb_set CAN1_SCE_IRQHandler,Default_Handler
  254. .weak EXTI9_5_IRQHandler
  255. .thumb_set EXTI9_5_IRQHandler,Default_Handler
  256. .weak TIM1_BRK_IRQHandler
  257. .thumb_set TIM1_BRK_IRQHandler,Default_Handler
  258. .weak TIM1_UP_IRQHandler
  259. .thumb_set TIM1_UP_IRQHandler,Default_Handler
  260. .weak TIM1_TRG_COM_IRQHandler
  261. .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
  262. .weak TIM1_CC_IRQHandler
  263. .thumb_set TIM1_CC_IRQHandler,Default_Handler
  264. .weak TIM2_IRQHandler
  265. .thumb_set TIM2_IRQHandler,Default_Handler
  266. .weak TIM3_IRQHandler
  267. .thumb_set TIM3_IRQHandler,Default_Handler
  268. .weak TIM4_IRQHandler
  269. .thumb_set TIM4_IRQHandler,Default_Handler
  270. .weak I2C1_EV_IRQHandler
  271. .thumb_set I2C1_EV_IRQHandler,Default_Handler
  272. .weak I2C1_ER_IRQHandler
  273. .thumb_set I2C1_ER_IRQHandler,Default_Handler
  274. .weak I2C2_EV_IRQHandler
  275. .thumb_set I2C2_EV_IRQHandler,Default_Handler
  276. .weak I2C2_ER_IRQHandler
  277. .thumb_set I2C2_ER_IRQHandler,Default_Handler
  278. .weak SPI1_IRQHandler
  279. .thumb_set SPI1_IRQHandler,Default_Handler
  280. .weak SPI2_IRQHandler
  281. .thumb_set SPI2_IRQHandler,Default_Handler
  282. .weak USART1_IRQHandler
  283. .thumb_set USART1_IRQHandler,Default_Handler
  284. .weak USART2_IRQHandler
  285. .thumb_set USART2_IRQHandler,Default_Handler
  286. .weak USART3_IRQHandler
  287. .thumb_set USART3_IRQHandler,Default_Handler
  288. .weak EXTI15_10_IRQHandler
  289. .thumb_set EXTI15_10_IRQHandler,Default_Handler
  290. .weak RTC_Alarm_IRQHandler
  291. .thumb_set RTC_Alarm_IRQHandler,Default_Handler
  292. .weak USBWakeUp_IRQHandler
  293. .thumb_set USBWakeUp_IRQHandler,Default_Handler
  294. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/