ses_startup_nrf5340_application.s 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. /***********************************************************************************
  2. * SEGGER Microcontroller GmbH *
  3. * The Embedded Experts *
  4. ***********************************************************************************
  5. * *
  6. * (c) 2014 - 2018 SEGGER Microcontroller GmbH *
  7. * *
  8. * www.segger.com Support: support@segger.com *
  9. * *
  10. ***********************************************************************************
  11. * *
  12. * All rights reserved. *
  13. * *
  14. * Redistribution and use in source and binary forms, with or *
  15. * without modification, are permitted provided that the following *
  16. * conditions are met: *
  17. * *
  18. * - Redistributions of source code must retain the above copyright *
  19. * notice, this list of conditions and the following disclaimer. *
  20. * *
  21. * - Neither the name of SEGGER Microcontroller GmbH *
  22. * nor the names of its contributors may be used to endorse or *
  23. * promote products derived from this software without specific *
  24. * prior written permission. *
  25. * *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
  27. * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
  28. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
  29. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
  30. * DISCLAIMED. *
  31. * IN NO EVENT SHALL SEGGER Microcontroller GmbH BE LIABLE FOR *
  32. * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
  33. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
  34. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
  35. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
  36. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
  37. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
  38. * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
  39. * DAMAGE. *
  40. * *
  41. ***********************************************************************************/
  42. /************************************************************************************
  43. * Preprocessor Definitions *
  44. * ------------------------ *
  45. * VECTORS_IN_RAM *
  46. * *
  47. * If defined, an area of RAM will large enough to store the vector table *
  48. * will be reserved. *
  49. * *
  50. ************************************************************************************/
  51. .syntax unified
  52. .code 16
  53. .section .init, "ax"
  54. .align 0
  55. /************************************************************************************
  56. * Default Exception Handlers *
  57. ************************************************************************************/
  58. .thumb_func
  59. .weak NMI_Handler
  60. NMI_Handler:
  61. b .
  62. .thumb_func
  63. .weak HardFault_Handler
  64. HardFault_Handler:
  65. b .
  66. .thumb_func
  67. .weak MemoryManagement_Handler
  68. MemoryManagement_Handler:
  69. b .
  70. .thumb_func
  71. .weak BusFault_Handler
  72. BusFault_Handler:
  73. b .
  74. .thumb_func
  75. .weak UsageFault_Handler
  76. UsageFault_Handler:
  77. b .
  78. .thumb_func
  79. .weak SecureFault_Handler
  80. SecureFault_Handler:
  81. b .
  82. .thumb_func
  83. .weak SVC_Handler
  84. SVC_Handler:
  85. b .
  86. .thumb_func
  87. .weak DebugMon_Handler
  88. DebugMon_Handler:
  89. b .
  90. .thumb_func
  91. .weak PendSV_Handler
  92. PendSV_Handler:
  93. b .
  94. .thumb_func
  95. .weak SysTick_Handler
  96. SysTick_Handler:
  97. b .
  98. .thumb_func
  99. .weak Dummy_Handler
  100. Dummy_Handler:
  101. b .
  102. /************************************************************************************
  103. * Default Interrupt Handlers *
  104. ************************************************************************************/
  105. .weak FPU_IRQHandler
  106. .thumb_set FPU_IRQHandler, Dummy_Handler
  107. .weak CACHE_IRQHandler
  108. .thumb_set CACHE_IRQHandler, Dummy_Handler
  109. .weak SPU_IRQHandler
  110. .thumb_set SPU_IRQHandler, Dummy_Handler
  111. .weak CLOCK_POWER_IRQHandler
  112. .thumb_set CLOCK_POWER_IRQHandler, Dummy_Handler
  113. .weak SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQHandler
  114. .thumb_set SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQHandler, Dummy_Handler
  115. .weak SPIM1_SPIS1_TWIM1_TWIS1_UARTE1_IRQHandler
  116. .thumb_set SPIM1_SPIS1_TWIM1_TWIS1_UARTE1_IRQHandler, Dummy_Handler
  117. .weak SPIM4_IRQHandler
  118. .thumb_set SPIM4_IRQHandler, Dummy_Handler
  119. .weak SPIM2_SPIS2_TWIM2_TWIS2_UARTE2_IRQHandler
  120. .thumb_set SPIM2_SPIS2_TWIM2_TWIS2_UARTE2_IRQHandler, Dummy_Handler
  121. .weak SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQHandler
  122. .thumb_set SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQHandler, Dummy_Handler
  123. .weak GPIOTE0_IRQHandler
  124. .thumb_set GPIOTE0_IRQHandler, Dummy_Handler
  125. .weak SAADC_IRQHandler
  126. .thumb_set SAADC_IRQHandler, Dummy_Handler
  127. .weak TIMER0_IRQHandler
  128. .thumb_set TIMER0_IRQHandler, Dummy_Handler
  129. .weak TIMER1_IRQHandler
  130. .thumb_set TIMER1_IRQHandler, Dummy_Handler
  131. .weak TIMER2_IRQHandler
  132. .thumb_set TIMER2_IRQHandler, Dummy_Handler
  133. .weak RTC0_IRQHandler
  134. .thumb_set RTC0_IRQHandler, Dummy_Handler
  135. .weak RTC1_IRQHandler
  136. .thumb_set RTC1_IRQHandler, Dummy_Handler
  137. .weak WDT0_IRQHandler
  138. .thumb_set WDT0_IRQHandler, Dummy_Handler
  139. .weak WDT1_IRQHandler
  140. .thumb_set WDT1_IRQHandler, Dummy_Handler
  141. .weak COMP_LPCOMP_IRQHandler
  142. .thumb_set COMP_LPCOMP_IRQHandler, Dummy_Handler
  143. .weak EGU0_IRQHandler
  144. .thumb_set EGU0_IRQHandler, Dummy_Handler
  145. .weak EGU1_IRQHandler
  146. .thumb_set EGU1_IRQHandler, Dummy_Handler
  147. .weak EGU2_IRQHandler
  148. .thumb_set EGU2_IRQHandler, Dummy_Handler
  149. .weak EGU3_IRQHandler
  150. .thumb_set EGU3_IRQHandler, Dummy_Handler
  151. .weak EGU4_IRQHandler
  152. .thumb_set EGU4_IRQHandler, Dummy_Handler
  153. .weak EGU5_IRQHandler
  154. .thumb_set EGU5_IRQHandler, Dummy_Handler
  155. .weak PWM0_IRQHandler
  156. .thumb_set PWM0_IRQHandler, Dummy_Handler
  157. .weak PWM1_IRQHandler
  158. .thumb_set PWM1_IRQHandler, Dummy_Handler
  159. .weak PWM2_IRQHandler
  160. .thumb_set PWM2_IRQHandler, Dummy_Handler
  161. .weak PWM3_IRQHandler
  162. .thumb_set PWM3_IRQHandler, Dummy_Handler
  163. .weak PDM0_IRQHandler
  164. .thumb_set PDM0_IRQHandler, Dummy_Handler
  165. .weak I2S0_IRQHandler
  166. .thumb_set I2S0_IRQHandler, Dummy_Handler
  167. .weak IPC_IRQHandler
  168. .thumb_set IPC_IRQHandler, Dummy_Handler
  169. .weak QSPI_IRQHandler
  170. .thumb_set QSPI_IRQHandler, Dummy_Handler
  171. .weak NFCT_IRQHandler
  172. .thumb_set NFCT_IRQHandler, Dummy_Handler
  173. .weak GPIOTE1_IRQHandler
  174. .thumb_set GPIOTE1_IRQHandler, Dummy_Handler
  175. .weak QDEC0_IRQHandler
  176. .thumb_set QDEC0_IRQHandler, Dummy_Handler
  177. .weak QDEC1_IRQHandler
  178. .thumb_set QDEC1_IRQHandler, Dummy_Handler
  179. .weak USBD_IRQHandler
  180. .thumb_set USBD_IRQHandler, Dummy_Handler
  181. .weak USBREGULATOR_IRQHandler
  182. .thumb_set USBREGULATOR_IRQHandler, Dummy_Handler
  183. .weak KMU_IRQHandler
  184. .thumb_set KMU_IRQHandler, Dummy_Handler
  185. .weak CRYPTOCELL_IRQHandler
  186. .thumb_set CRYPTOCELL_IRQHandler, Dummy_Handler
  187. /************************************************************************************
  188. * Reset Handler Extensions *
  189. ************************************************************************************/
  190. .extern Reset_Handler
  191. .global nRFInitialize
  192. .extern afterInitialize
  193. .thumb_func
  194. nRFInitialize:
  195. b afterInitialize
  196. /************************************************************************************
  197. * Vector Table *
  198. ************************************************************************************/
  199. .section .vectors, "ax"
  200. .align 0
  201. .global _vectors
  202. .extern __stack_end__
  203. _vectors:
  204. .word __stack_end__
  205. .word Reset_Handler
  206. .word NMI_Handler
  207. .word HardFault_Handler
  208. .word MemoryManagement_Handler
  209. .word BusFault_Handler
  210. .word UsageFault_Handler
  211. .word SecureFault_Handler
  212. .word 0 /*Reserved */
  213. .word 0 /*Reserved */
  214. .word 0 /*Reserved */
  215. .word SVC_Handler
  216. .word DebugMon_Handler
  217. .word 0 /*Reserved */
  218. .word PendSV_Handler
  219. .word SysTick_Handler
  220. /* External Interrupts */
  221. .word FPU_IRQHandler
  222. .word CACHE_IRQHandler
  223. .word 0 /*Reserved */
  224. .word SPU_IRQHandler
  225. .word 0 /*Reserved */
  226. .word CLOCK_POWER_IRQHandler
  227. .word 0 /*Reserved */
  228. .word 0 /*Reserved */
  229. .word SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQHandler
  230. .word SPIM1_SPIS1_TWIM1_TWIS1_UARTE1_IRQHandler
  231. .word SPIM4_IRQHandler
  232. .word SPIM2_SPIS2_TWIM2_TWIS2_UARTE2_IRQHandler
  233. .word SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQHandler
  234. .word GPIOTE0_IRQHandler
  235. .word SAADC_IRQHandler
  236. .word TIMER0_IRQHandler
  237. .word TIMER1_IRQHandler
  238. .word TIMER2_IRQHandler
  239. .word 0 /*Reserved */
  240. .word 0 /*Reserved */
  241. .word RTC0_IRQHandler
  242. .word RTC1_IRQHandler
  243. .word 0 /*Reserved */
  244. .word 0 /*Reserved */
  245. .word WDT0_IRQHandler
  246. .word WDT1_IRQHandler
  247. .word COMP_LPCOMP_IRQHandler
  248. .word EGU0_IRQHandler
  249. .word EGU1_IRQHandler
  250. .word EGU2_IRQHandler
  251. .word EGU3_IRQHandler
  252. .word EGU4_IRQHandler
  253. .word EGU5_IRQHandler
  254. .word PWM0_IRQHandler
  255. .word PWM1_IRQHandler
  256. .word PWM2_IRQHandler
  257. .word PWM3_IRQHandler
  258. .word 0 /*Reserved */
  259. .word PDM0_IRQHandler
  260. .word 0 /*Reserved */
  261. .word I2S0_IRQHandler
  262. .word 0 /*Reserved */
  263. .word IPC_IRQHandler
  264. .word QSPI_IRQHandler
  265. .word 0 /*Reserved */
  266. .word NFCT_IRQHandler
  267. .word 0 /*Reserved */
  268. .word GPIOTE1_IRQHandler
  269. .word 0 /*Reserved */
  270. .word 0 /*Reserved */
  271. .word 0 /*Reserved */
  272. .word QDEC0_IRQHandler
  273. .word QDEC1_IRQHandler
  274. .word 0 /*Reserved */
  275. .word USBD_IRQHandler
  276. .word USBREGULATOR_IRQHandler
  277. .word 0 /*Reserved */
  278. .word KMU_IRQHandler
  279. .word 0 /*Reserved */
  280. .word 0 /*Reserved */
  281. .word 0 /*Reserved */
  282. .word 0 /*Reserved */
  283. .word 0 /*Reserved */
  284. .word 0 /*Reserved */
  285. .word 0 /*Reserved */
  286. .word 0 /*Reserved */
  287. .word 0 /*Reserved */
  288. .word 0 /*Reserved */
  289. .word CRYPTOCELL_IRQHandler
  290. .word 0 /*Reserved */
  291. .word 0 /*Reserved */
  292. .word 0 /*Reserved */
  293. .word 0 /*Reserved */
  294. .word 0 /*Reserved */
  295. .word 0 /*Reserved */
  296. .word 0 /*Reserved */
  297. .word 0 /*Reserved */
  298. .word 0 /*Reserved */
  299. .word 0 /*Reserved */
  300. .word 0 /*Reserved */
  301. .word 0 /*Reserved */
  302. .word 0 /*Reserved */
  303. .word 0 /*Reserved */
  304. .word 0 /*Reserved */
  305. .word 0 /*Reserved */
  306. .word 0 /*Reserved */
  307. .word 0 /*Reserved */
  308. .word 0 /*Reserved */
  309. .word 0 /*Reserved */
  310. .word 0 /*Reserved */
  311. .word 0 /*Reserved */
  312. .word 0 /*Reserved */
  313. .word 0 /*Reserved */
  314. .word 0 /*Reserved */
  315. .word 0 /*Reserved */
  316. .word 0 /*Reserved */
  317. .word 0 /*Reserved */
  318. .word 0 /*Reserved */
  319. .word 0 /*Reserved */
  320. .word 0 /*Reserved */
  321. .word 0 /*Reserved */
  322. .word 0 /*Reserved */
  323. .word 0 /*Reserved */
  324. .word 0 /*Reserved */
  325. .word 0 /*Reserved */
  326. .word 0 /*Reserved */
  327. .word 0 /*Reserved */
  328. .word 0 /*Reserved */
  329. .word 0 /*Reserved */
  330. .word 0 /*Reserved */
  331. .word 0 /*Reserved */
  332. .word 0 /*Reserved */
  333. .word 0 /*Reserved */
  334. .word 0 /*Reserved */
  335. .word 0 /*Reserved */
  336. .word 0 /*Reserved */
  337. .word 0 /*Reserved */
  338. .word 0 /*Reserved */
  339. .word 0 /*Reserved */
  340. .word 0 /*Reserved */
  341. .word 0 /*Reserved */
  342. .word 0 /*Reserved */
  343. .word 0 /*Reserved */
  344. .word 0 /*Reserved */
  345. .word 0 /*Reserved */
  346. .word 0 /*Reserved */
  347. .word 0 /*Reserved */
  348. .word 0 /*Reserved */
  349. .word 0 /*Reserved */
  350. .word 0 /*Reserved */
  351. .word 0 /*Reserved */
  352. .word 0 /*Reserved */
  353. .word 0 /*Reserved */
  354. .word 0 /*Reserved */
  355. .word 0 /*Reserved */
  356. .word 0 /*Reserved */
  357. .word 0 /*Reserved */
  358. .word 0 /*Reserved */
  359. .word 0 /*Reserved */
  360. .word 0 /*Reserved */
  361. .word 0 /*Reserved */
  362. .word 0 /*Reserved */
  363. .word 0 /*Reserved */
  364. .word 0 /*Reserved */
  365. .word 0 /*Reserved */
  366. .word 0 /*Reserved */
  367. .word 0 /*Reserved */
  368. .word 0 /*Reserved */
  369. .word 0 /*Reserved */
  370. .word 0 /*Reserved */
  371. .word 0 /*Reserved */
  372. .word 0 /*Reserved */
  373. .word 0 /*Reserved */
  374. .word 0 /*Reserved */
  375. .word 0 /*Reserved */
  376. .word 0 /*Reserved */
  377. .word 0 /*Reserved */
  378. .word 0 /*Reserved */
  379. .word 0 /*Reserved */
  380. .word 0 /*Reserved */
  381. .word 0 /*Reserved */
  382. .word 0 /*Reserved */
  383. .word 0 /*Reserved */
  384. .word 0 /*Reserved */
  385. .word 0 /*Reserved */
  386. .word 0 /*Reserved */
  387. .word 0 /*Reserved */
  388. .word 0 /*Reserved */
  389. .word 0 /*Reserved */
  390. .word 0 /*Reserved */
  391. .word 0 /*Reserved */
  392. .word 0 /*Reserved */
  393. .word 0 /*Reserved */
  394. .word 0 /*Reserved */
  395. .word 0 /*Reserved */
  396. .word 0 /*Reserved */
  397. .word 0 /*Reserved */
  398. .word 0 /*Reserved */
  399. .word 0 /*Reserved */
  400. .word 0 /*Reserved */
  401. .word 0 /*Reserved */
  402. .word 0 /*Reserved */
  403. .word 0 /*Reserved */
  404. .word 0 /*Reserved */
  405. .word 0 /*Reserved */
  406. .word 0 /*Reserved */
  407. .word 0 /*Reserved */
  408. .word 0 /*Reserved */
  409. .word 0 /*Reserved */
  410. .word 0 /*Reserved */
  411. .word 0 /*Reserved */
  412. .word 0 /*Reserved */
  413. .word 0 /*Reserved */
  414. .word 0 /*Reserved */
  415. .word 0 /*Reserved */
  416. .word 0 /*Reserved */
  417. .word 0 /*Reserved */
  418. .word 0 /*Reserved */
  419. .word 0 /*Reserved */
  420. .word 0 /*Reserved */
  421. .word 0 /*Reserved */
  422. .word 0 /*Reserved */
  423. .word 0 /*Reserved */
  424. .word 0 /*Reserved */
  425. .word 0 /*Reserved */
  426. .word 0 /*Reserved */
  427. .word 0 /*Reserved */
  428. .word 0 /*Reserved */
  429. .word 0 /*Reserved */
  430. .word 0 /*Reserved */
  431. .word 0 /*Reserved */
  432. .word 0 /*Reserved */
  433. .word 0 /*Reserved */
  434. .word 0 /*Reserved */
  435. .word 0 /*Reserved */
  436. .word 0 /*Reserved */
  437. .word 0 /*Reserved */
  438. .word 0 /*Reserved */
  439. .word 0 /*Reserved */
  440. .word 0 /*Reserved */
  441. .word 0 /*Reserved */
  442. .word 0 /*Reserved */
  443. .word 0 /*Reserved */
  444. .word 0 /*Reserved */
  445. .word 0 /*Reserved */
  446. .word 0 /*Reserved */
  447. .word 0 /*Reserved */
  448. .word 0 /*Reserved */
  449. .word 0 /*Reserved */
  450. .word 0 /*Reserved */
  451. .word 0 /*Reserved */
  452. .word 0 /*Reserved */
  453. .word 0 /*Reserved */
  454. .word 0 /*Reserved */
  455. .word 0 /*Reserved */
  456. .word 0 /*Reserved */
  457. .word 0 /*Reserved */
  458. .word 0 /*Reserved */
  459. .word 0 /*Reserved */
  460. .word 0 /*Reserved */
  461. _vectors_end:
  462. #ifdef VECTORS_IN_RAM
  463. .section .vectors_ram, "ax"
  464. .align 0
  465. .global _vectors_ram
  466. _vectors_ram:
  467. .space _vectors_end - _vectors, 0
  468. #endif