iar_startup_nrf52.s 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. ;/* Copyright (c) 2012 ARM LIMITED
  2. ;
  3. ; All rights reserved.
  4. ; Redistribution and use in source and binary forms, with or without
  5. ; modification, are permitted provided that the following conditions are met:
  6. ; - Redistributions of source code must retain the above copyright
  7. ; notice, this list of conditions and the following disclaimer.
  8. ; - Redistributions in binary form must reproduce the above copyright
  9. ; notice, this list of conditions and the following disclaimer in the
  10. ; documentation and/or other materials provided with the distribution.
  11. ; - Neither the name of ARM nor the names of its contributors may be used
  12. ; to endorse or promote products derived from this software without
  13. ; specific prior written permission.
  14. ; *
  15. ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. ; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. ; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
  19. ; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  20. ; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  21. ; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  22. ; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  23. ; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  24. ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  25. ; POSSIBILITY OF SUCH DAMAGE.
  26. ; ---------------------------------------------------------------------------*/
  27. ; The modules in this file are included in the libraries, and may be replaced
  28. ; by any user-defined modules that define the PUBLIC symbol _program_start or
  29. ; a user defined start symbol.
  30. ; To override the cstartup defined in the library, simply add your modified
  31. ; version to the workbench project.
  32. ;
  33. ; The vector table is normally located at address 0.
  34. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
  35. ; The name "__vector_table" has special meaning for C-SPY:
  36. ; it is where the SP start value is found, and the NVIC vector
  37. ; table register (VTOR) is initialized to this address if != 0.
  38. MODULE ?cstartup
  39. ;; Stack size default : Defined in *.icf (linker file). Can be modified inside EW.
  40. ;; Heap size default : Defined in *.icf (linker file). Can be modified inside EW.
  41. ;; Forward declaration of sections.
  42. SECTION CSTACK:DATA:NOROOT(3)
  43. SECTION .intvec:CODE:NOROOT(2)
  44. EXTERN __iar_program_start
  45. EXTERN SystemInit
  46. PUBLIC __vector_table
  47. PUBLIC __Vectors
  48. PUBLIC __Vectors_End
  49. PUBLIC __Vectors_Size
  50. DATA
  51. __vector_table
  52. DCD sfe(CSTACK)
  53. DCD Reset_Handler
  54. DCD NMI_Handler
  55. DCD HardFault_Handler
  56. DCD MemoryManagement_Handler
  57. DCD BusFault_Handler
  58. DCD UsageFault_Handler
  59. DCD 0 ; Reserved
  60. DCD 0 ; Reserved
  61. DCD 0 ; Reserved
  62. DCD 0 ; Reserved
  63. DCD SVC_Handler
  64. DCD DebugMonitor_Handler
  65. DCD 0 ; Reserved
  66. DCD PendSV_Handler
  67. DCD SysTick_Handler
  68. ; External Interrupts
  69. DCD POWER_CLOCK_IRQHandler
  70. DCD RADIO_IRQHandler
  71. DCD UARTE0_UART0_IRQHandler
  72. DCD SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler
  73. DCD SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler
  74. DCD NFCT_IRQHandler
  75. DCD GPIOTE_IRQHandler
  76. DCD SAADC_IRQHandler
  77. DCD TIMER0_IRQHandler
  78. DCD TIMER1_IRQHandler
  79. DCD TIMER2_IRQHandler
  80. DCD RTC0_IRQHandler
  81. DCD TEMP_IRQHandler
  82. DCD RNG_IRQHandler
  83. DCD ECB_IRQHandler
  84. DCD CCM_AAR_IRQHandler
  85. DCD WDT_IRQHandler
  86. DCD RTC1_IRQHandler
  87. DCD QDEC_IRQHandler
  88. DCD COMP_LPCOMP_IRQHandler
  89. DCD SWI0_EGU0_IRQHandler
  90. DCD SWI1_EGU1_IRQHandler
  91. DCD SWI2_EGU2_IRQHandler
  92. DCD SWI3_EGU3_IRQHandler
  93. DCD SWI4_EGU4_IRQHandler
  94. DCD SWI5_EGU5_IRQHandler
  95. DCD TIMER3_IRQHandler
  96. DCD TIMER4_IRQHandler
  97. DCD PWM0_IRQHandler
  98. DCD PDM_IRQHandler
  99. DCD 0 ; Reserved
  100. DCD 0 ; Reserved
  101. DCD MWU_IRQHandler
  102. DCD PWM1_IRQHandler
  103. DCD PWM2_IRQHandler
  104. DCD SPIM2_SPIS2_SPI2_IRQHandler
  105. DCD RTC2_IRQHandler
  106. DCD I2S_IRQHandler
  107. DCD FPU_IRQHandler
  108. DCD 0 ; Reserved
  109. DCD 0 ; Reserved
  110. DCD 0 ; Reserved
  111. DCD 0 ; Reserved
  112. DCD 0 ; Reserved
  113. DCD 0 ; Reserved
  114. DCD 0 ; Reserved
  115. DCD 0 ; Reserved
  116. DCD 0 ; Reserved
  117. DCD 0 ; Reserved
  118. DCD 0 ; Reserved
  119. DCD 0 ; Reserved
  120. DCD 0 ; Reserved
  121. DCD 0 ; Reserved
  122. DCD 0 ; Reserved
  123. DCD 0 ; Reserved
  124. DCD 0 ; Reserved
  125. DCD 0 ; Reserved
  126. DCD 0 ; Reserved
  127. DCD 0 ; Reserved
  128. DCD 0 ; Reserved
  129. DCD 0 ; Reserved
  130. DCD 0 ; Reserved
  131. DCD 0 ; Reserved
  132. DCD 0 ; Reserved
  133. DCD 0 ; Reserved
  134. DCD 0 ; Reserved
  135. DCD 0 ; Reserved
  136. DCD 0 ; Reserved
  137. DCD 0 ; Reserved
  138. DCD 0 ; Reserved
  139. DCD 0 ; Reserved
  140. DCD 0 ; Reserved
  141. DCD 0 ; Reserved
  142. DCD 0 ; Reserved
  143. DCD 0 ; Reserved
  144. DCD 0 ; Reserved
  145. DCD 0 ; Reserved
  146. DCD 0 ; Reserved
  147. DCD 0 ; Reserved
  148. DCD 0 ; Reserved
  149. DCD 0 ; Reserved
  150. DCD 0 ; Reserved
  151. DCD 0 ; Reserved
  152. DCD 0 ; Reserved
  153. DCD 0 ; Reserved
  154. DCD 0 ; Reserved
  155. DCD 0 ; Reserved
  156. DCD 0 ; Reserved
  157. DCD 0 ; Reserved
  158. DCD 0 ; Reserved
  159. DCD 0 ; Reserved
  160. DCD 0 ; Reserved
  161. DCD 0 ; Reserved
  162. DCD 0 ; Reserved
  163. DCD 0 ; Reserved
  164. DCD 0 ; Reserved
  165. DCD 0 ; Reserved
  166. DCD 0 ; Reserved
  167. DCD 0 ; Reserved
  168. DCD 0 ; Reserved
  169. DCD 0 ; Reserved
  170. DCD 0 ; Reserved
  171. DCD 0 ; Reserved
  172. DCD 0 ; Reserved
  173. DCD 0 ; Reserved
  174. DCD 0 ; Reserved
  175. DCD 0 ; Reserved
  176. DCD 0 ; Reserved
  177. DCD 0 ; Reserved
  178. DCD 0 ; Reserved
  179. DCD 0 ; Reserved
  180. DCD 0 ; Reserved
  181. DCD 0 ; Reserved
  182. DCD 0 ; Reserved
  183. DCD 0 ; Reserved
  184. DCD 0 ; Reserved
  185. DCD 0 ; Reserved
  186. DCD 0 ; Reserved
  187. DCD 0 ; Reserved
  188. DCD 0 ; Reserved
  189. DCD 0 ; Reserved
  190. DCD 0 ; Reserved
  191. DCD 0 ; Reserved
  192. DCD 0 ; Reserved
  193. DCD 0 ; Reserved
  194. DCD 0 ; Reserved
  195. DCD 0 ; Reserved
  196. DCD 0 ; Reserved
  197. DCD 0 ; Reserved
  198. DCD 0 ; Reserved
  199. DCD 0 ; Reserved
  200. DCD 0 ; Reserved
  201. DCD 0 ; Reserved
  202. DCD 0 ; Reserved
  203. DCD 0 ; Reserved
  204. DCD 0 ; Reserved
  205. DCD 0 ; Reserved
  206. DCD 0 ; Reserved
  207. DCD 0 ; Reserved
  208. DCD 0 ; Reserved
  209. DCD 0 ; Reserved
  210. DCD 0 ; Reserved
  211. DCD 0 ; Reserved
  212. DCD 0 ; Reserved
  213. DCD 0 ; Reserved
  214. DCD 0 ; Reserved
  215. DCD 0 ; Reserved
  216. DCD 0 ; Reserved
  217. DCD 0 ; Reserved
  218. DCD 0 ; Reserved
  219. DCD 0 ; Reserved
  220. DCD 0 ; Reserved
  221. DCD 0 ; Reserved
  222. DCD 0 ; Reserved
  223. DCD 0 ; Reserved
  224. DCD 0 ; Reserved
  225. DCD 0 ; Reserved
  226. DCD 0 ; Reserved
  227. DCD 0 ; Reserved
  228. DCD 0 ; Reserved
  229. DCD 0 ; Reserved
  230. DCD 0 ; Reserved
  231. DCD 0 ; Reserved
  232. DCD 0 ; Reserved
  233. DCD 0 ; Reserved
  234. DCD 0 ; Reserved
  235. DCD 0 ; Reserved
  236. DCD 0 ; Reserved
  237. DCD 0 ; Reserved
  238. DCD 0 ; Reserved
  239. DCD 0 ; Reserved
  240. DCD 0 ; Reserved
  241. DCD 0 ; Reserved
  242. DCD 0 ; Reserved
  243. DCD 0 ; Reserved
  244. DCD 0 ; Reserved
  245. DCD 0 ; Reserved
  246. DCD 0 ; Reserved
  247. DCD 0 ; Reserved
  248. DCD 0 ; Reserved
  249. DCD 0 ; Reserved
  250. DCD 0 ; Reserved
  251. DCD 0 ; Reserved
  252. DCD 0 ; Reserved
  253. DCD 0 ; Reserved
  254. DCD 0 ; Reserved
  255. DCD 0 ; Reserved
  256. DCD 0 ; Reserved
  257. DCD 0 ; Reserved
  258. DCD 0 ; Reserved
  259. DCD 0 ; Reserved
  260. DCD 0 ; Reserved
  261. DCD 0 ; Reserved
  262. DCD 0 ; Reserved
  263. DCD 0 ; Reserved
  264. DCD 0 ; Reserved
  265. DCD 0 ; Reserved
  266. DCD 0 ; Reserved
  267. DCD 0 ; Reserved
  268. DCD 0 ; Reserved
  269. DCD 0 ; Reserved
  270. DCD 0 ; Reserved
  271. DCD 0 ; Reserved
  272. DCD 0 ; Reserved
  273. DCD 0 ; Reserved
  274. DCD 0 ; Reserved
  275. DCD 0 ; Reserved
  276. DCD 0 ; Reserved
  277. DCD 0 ; Reserved
  278. DCD 0 ; Reserved
  279. DCD 0 ; Reserved
  280. DCD 0 ; Reserved
  281. DCD 0 ; Reserved
  282. DCD 0 ; Reserved
  283. DCD 0 ; Reserved
  284. DCD 0 ; Reserved
  285. DCD 0 ; Reserved
  286. DCD 0 ; Reserved
  287. DCD 0 ; Reserved
  288. DCD 0 ; Reserved
  289. DCD 0 ; Reserved
  290. DCD 0 ; Reserved
  291. DCD 0 ; Reserved
  292. DCD 0 ; Reserved
  293. DCD 0 ; Reserved
  294. DCD 0 ; Reserved
  295. DCD 0 ; Reserved
  296. DCD 0 ; Reserved
  297. DCD 0 ; Reserved
  298. DCD 0 ; Reserved
  299. DCD 0 ; Reserved
  300. DCD 0 ; Reserved
  301. DCD 0 ; Reserved
  302. DCD 0 ; Reserved
  303. DCD 0 ; Reserved
  304. DCD 0 ; Reserved
  305. DCD 0 ; Reserved
  306. DCD 0 ; Reserved
  307. DCD 0 ; Reserved
  308. DCD 0 ; Reserved
  309. __Vectors_End
  310. __Vectors EQU __vector_table
  311. __Vectors_Size EQU __Vectors_End - __Vectors
  312. ; Default handlers.
  313. THUMB
  314. PUBWEAK Reset_Handler
  315. SECTION .text:CODE:REORDER(2)
  316. Reset_Handler
  317. LDR R0, =SystemInit
  318. BLX R0
  319. LDR R0, =__iar_program_start
  320. BX R0
  321. ; Dummy exception handlers
  322. PUBWEAK NMI_Handler
  323. SECTION .text:CODE:REORDER(1)
  324. NMI_Handler
  325. B .
  326. PUBWEAK HardFault_Handler
  327. SECTION .text:CODE:REORDER(1)
  328. HardFault_Handler
  329. B .
  330. PUBWEAK MemoryManagement_Handler
  331. SECTION .text:CODE:REORDER(1)
  332. MemoryManagement_Handler
  333. B .
  334. PUBWEAK BusFault_Handler
  335. SECTION .text:CODE:REORDER(1)
  336. BusFault_Handler
  337. B .
  338. PUBWEAK UsageFault_Handler
  339. SECTION .text:CODE:REORDER(1)
  340. UsageFault_Handler
  341. B .
  342. PUBWEAK SVC_Handler
  343. SECTION .text:CODE:REORDER(1)
  344. SVC_Handler
  345. B .
  346. PUBWEAK DebugMonitor_Handler
  347. SECTION .text:CODE:REORDER(1)
  348. DebugMonitor_Handler
  349. B .
  350. PUBWEAK PendSV_Handler
  351. SECTION .text:CODE:REORDER(1)
  352. PendSV_Handler
  353. B .
  354. PUBWEAK SysTick_Handler
  355. SECTION .text:CODE:REORDER(1)
  356. SysTick_Handler
  357. B .
  358. ; Dummy interrupt handlers
  359. PUBWEAK POWER_CLOCK_IRQHandler
  360. SECTION .text:CODE:REORDER(1)
  361. POWER_CLOCK_IRQHandler
  362. B .
  363. PUBWEAK RADIO_IRQHandler
  364. SECTION .text:CODE:REORDER(1)
  365. RADIO_IRQHandler
  366. B .
  367. PUBWEAK UARTE0_UART0_IRQHandler
  368. SECTION .text:CODE:REORDER(1)
  369. UARTE0_UART0_IRQHandler
  370. B .
  371. PUBWEAK SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler
  372. SECTION .text:CODE:REORDER(1)
  373. SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler
  374. B .
  375. PUBWEAK SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler
  376. SECTION .text:CODE:REORDER(1)
  377. SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler
  378. B .
  379. PUBWEAK NFCT_IRQHandler
  380. SECTION .text:CODE:REORDER(1)
  381. NFCT_IRQHandler
  382. B .
  383. PUBWEAK GPIOTE_IRQHandler
  384. SECTION .text:CODE:REORDER(1)
  385. GPIOTE_IRQHandler
  386. B .
  387. PUBWEAK SAADC_IRQHandler
  388. SECTION .text:CODE:REORDER(1)
  389. SAADC_IRQHandler
  390. B .
  391. PUBWEAK TIMER0_IRQHandler
  392. SECTION .text:CODE:REORDER(1)
  393. TIMER0_IRQHandler
  394. B .
  395. PUBWEAK TIMER1_IRQHandler
  396. SECTION .text:CODE:REORDER(1)
  397. TIMER1_IRQHandler
  398. B .
  399. PUBWEAK TIMER2_IRQHandler
  400. SECTION .text:CODE:REORDER(1)
  401. TIMER2_IRQHandler
  402. B .
  403. PUBWEAK RTC0_IRQHandler
  404. SECTION .text:CODE:REORDER(1)
  405. RTC0_IRQHandler
  406. B .
  407. PUBWEAK TEMP_IRQHandler
  408. SECTION .text:CODE:REORDER(1)
  409. TEMP_IRQHandler
  410. B .
  411. PUBWEAK RNG_IRQHandler
  412. SECTION .text:CODE:REORDER(1)
  413. RNG_IRQHandler
  414. B .
  415. PUBWEAK ECB_IRQHandler
  416. SECTION .text:CODE:REORDER(1)
  417. ECB_IRQHandler
  418. B .
  419. PUBWEAK CCM_AAR_IRQHandler
  420. SECTION .text:CODE:REORDER(1)
  421. CCM_AAR_IRQHandler
  422. B .
  423. PUBWEAK WDT_IRQHandler
  424. SECTION .text:CODE:REORDER(1)
  425. WDT_IRQHandler
  426. B .
  427. PUBWEAK RTC1_IRQHandler
  428. SECTION .text:CODE:REORDER(1)
  429. RTC1_IRQHandler
  430. B .
  431. PUBWEAK QDEC_IRQHandler
  432. SECTION .text:CODE:REORDER(1)
  433. QDEC_IRQHandler
  434. B .
  435. PUBWEAK COMP_LPCOMP_IRQHandler
  436. SECTION .text:CODE:REORDER(1)
  437. COMP_LPCOMP_IRQHandler
  438. B .
  439. PUBWEAK SWI0_EGU0_IRQHandler
  440. SECTION .text:CODE:REORDER(1)
  441. SWI0_EGU0_IRQHandler
  442. B .
  443. PUBWEAK SWI1_EGU1_IRQHandler
  444. SECTION .text:CODE:REORDER(1)
  445. SWI1_EGU1_IRQHandler
  446. B .
  447. PUBWEAK SWI2_EGU2_IRQHandler
  448. SECTION .text:CODE:REORDER(1)
  449. SWI2_EGU2_IRQHandler
  450. B .
  451. PUBWEAK SWI3_EGU3_IRQHandler
  452. SECTION .text:CODE:REORDER(1)
  453. SWI3_EGU3_IRQHandler
  454. B .
  455. PUBWEAK SWI4_EGU4_IRQHandler
  456. SECTION .text:CODE:REORDER(1)
  457. SWI4_EGU4_IRQHandler
  458. B .
  459. PUBWEAK SWI5_EGU5_IRQHandler
  460. SECTION .text:CODE:REORDER(1)
  461. SWI5_EGU5_IRQHandler
  462. B .
  463. PUBWEAK TIMER3_IRQHandler
  464. SECTION .text:CODE:REORDER(1)
  465. TIMER3_IRQHandler
  466. B .
  467. PUBWEAK TIMER4_IRQHandler
  468. SECTION .text:CODE:REORDER(1)
  469. TIMER4_IRQHandler
  470. B .
  471. PUBWEAK PWM0_IRQHandler
  472. SECTION .text:CODE:REORDER(1)
  473. PWM0_IRQHandler
  474. B .
  475. PUBWEAK PDM_IRQHandler
  476. SECTION .text:CODE:REORDER(1)
  477. PDM_IRQHandler
  478. B .
  479. PUBWEAK MWU_IRQHandler
  480. SECTION .text:CODE:REORDER(1)
  481. MWU_IRQHandler
  482. B .
  483. PUBWEAK PWM1_IRQHandler
  484. SECTION .text:CODE:REORDER(1)
  485. PWM1_IRQHandler
  486. B .
  487. PUBWEAK PWM2_IRQHandler
  488. SECTION .text:CODE:REORDER(1)
  489. PWM2_IRQHandler
  490. B .
  491. PUBWEAK SPIM2_SPIS2_SPI2_IRQHandler
  492. SECTION .text:CODE:REORDER(1)
  493. SPIM2_SPIS2_SPI2_IRQHandler
  494. B .
  495. PUBWEAK RTC2_IRQHandler
  496. SECTION .text:CODE:REORDER(1)
  497. RTC2_IRQHandler
  498. B .
  499. PUBWEAK I2S_IRQHandler
  500. SECTION .text:CODE:REORDER(1)
  501. I2S_IRQHandler
  502. B .
  503. PUBWEAK FPU_IRQHandler
  504. SECTION .text:CODE:REORDER(1)
  505. FPU_IRQHandler
  506. B .
  507. END