1; Copyright (c) 2009-2018 ARM Limited. All rights reserved. 2; 3; SPDX-License-Identifier: Apache-2.0 4; 5; Licensed under the Apache License, Version 2.0 (the License); you may 6; not use this file except in compliance with the License. 7; You may obtain a copy of the License at 8; 9; www.apache.org/licenses/LICENSE-2.0 10; 11; Unless required by applicable law or agreed to in writing, software 12; distributed under the License is distributed on an AS IS BASIS, WITHOUT 13; WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14; See the License for the specific language governing permissions and 15; limitations under the License. 16; 17; NOTICE: This file has been modified by Nordic Semiconductor ASA. 18 19; The modules in this file are included in the libraries, and may be replaced 20; by any user-defined modules that define the PUBLIC symbol _program_start or 21; a user defined start symbol. 22; To override the cstartup defined in the library, simply add your modified 23; version to the workbench project. 24; 25; The vector table is normally located at address 0. 26; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. 27; The name "__vector_table" has special meaning for C-SPY: 28; it is where the SP start value is found, and the NVIC vector 29; table register (VTOR) is initialized to this address if != 0. 30 31 MODULE ?cstartup 32 33#if defined(__STARTUP_CONFIG) 34 35 #include "startup_config.h" 36 37 #ifndef __STARTUP_CONFIG_STACK_ALIGNEMENT 38 #define __STARTUP_CONFIG_STACK_ALIGNEMENT 3 39 #endif 40 41 SECTION CSTACK:DATA:NOROOT(__STARTUP_CONFIG_STACK_ALIGNEMENT) 42 DS8 __STARTUP_CONFIG_STACK_SIZE 43 44 SECTION HEAP:DATA:NOROOT(3) 45 DS8 __STARTUP_CONFIG_HEAP_SIZE 46 47#else 48 49 ;; Stack size default : Defined in *.icf (linker file). Can be modified inside EW. 50 ;; Heap size default : Defined in *.icf (linker file). Can be modified inside EW. 51 52 ;; Forward declaration of sections. 53 SECTION CSTACK:DATA:NOROOT(3) 54 55#endif 56 57 58 SECTION .intvec:CODE:NOROOT(2) 59 60 EXTERN __iar_program_start 61 EXTERN SystemInit 62 PUBLIC __vector_table 63 PUBLIC __Vectors 64 PUBLIC __Vectors_End 65 PUBLIC __Vectors_Size 66 67 DATA 68 69__vector_table 70 DCD sfe(CSTACK) 71 DCD Reset_Handler 72 DCD NMI_Handler 73 DCD HardFault_Handler 74 DCD MemoryManagement_Handler 75 DCD BusFault_Handler 76 DCD UsageFault_Handler 77 DCD 0 ; Reserved 78 DCD 0 ; Reserved 79 DCD 0 ; Reserved 80 DCD 0 ; Reserved 81 DCD SVC_Handler 82 DCD DebugMon_Handler 83 DCD 0 ; Reserved 84 DCD PendSV_Handler 85 DCD SysTick_Handler 86 87 ; External Interrupts 88 DCD POWER_CLOCK_IRQHandler 89 DCD RADIO_IRQHandler 90 DCD UARTE0_UART0_IRQHandler 91 DCD SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler 92 DCD SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler 93 DCD NFCT_IRQHandler 94 DCD GPIOTE_IRQHandler 95 DCD SAADC_IRQHandler 96 DCD TIMER0_IRQHandler 97 DCD TIMER1_IRQHandler 98 DCD TIMER2_IRQHandler 99 DCD RTC0_IRQHandler 100 DCD TEMP_IRQHandler 101 DCD RNG_IRQHandler 102 DCD ECB_IRQHandler 103 DCD CCM_AAR_IRQHandler 104 DCD WDT_IRQHandler 105 DCD RTC1_IRQHandler 106 DCD QDEC_IRQHandler 107 DCD COMP_LPCOMP_IRQHandler 108 DCD SWI0_EGU0_IRQHandler 109 DCD SWI1_EGU1_IRQHandler 110 DCD SWI2_EGU2_IRQHandler 111 DCD SWI3_EGU3_IRQHandler 112 DCD SWI4_EGU4_IRQHandler 113 DCD SWI5_EGU5_IRQHandler 114 DCD TIMER3_IRQHandler 115 DCD TIMER4_IRQHandler 116 DCD PWM0_IRQHandler 117 DCD PDM_IRQHandler 118 DCD 0 ; Reserved 119 DCD 0 ; Reserved 120 DCD MWU_IRQHandler 121 DCD PWM1_IRQHandler 122 DCD PWM2_IRQHandler 123 DCD SPIM2_SPIS2_SPI2_IRQHandler 124 DCD RTC2_IRQHandler 125 DCD I2S_IRQHandler 126 DCD FPU_IRQHandler 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 201__Vectors_End 202__Vectors EQU __vector_table 203__Vectors_Size EQU __Vectors_End - __Vectors 204 205 206; Default handlers. 207 THUMB 208 209 PUBWEAK Reset_Handler 210 SECTION .text:CODE:REORDER:NOROOT(2) 211Reset_Handler 212 213 LDR R0, =SystemInit 214 BLX R0 215 LDR R0, =__iar_program_start 216 BX R0 217 218 ; Dummy exception handlers 219 220 221 PUBWEAK NMI_Handler 222 SECTION .text:CODE:REORDER:NOROOT(1) 223NMI_Handler 224 B . 225 226 PUBWEAK HardFault_Handler 227 SECTION .text:CODE:REORDER:NOROOT(1) 228HardFault_Handler 229 B . 230 231 PUBWEAK MemoryManagement_Handler 232 SECTION .text:CODE:REORDER:NOROOT(1) 233MemoryManagement_Handler 234 B . 235 236 PUBWEAK BusFault_Handler 237 SECTION .text:CODE:REORDER:NOROOT(1) 238BusFault_Handler 239 B . 240 241 PUBWEAK UsageFault_Handler 242 SECTION .text:CODE:REORDER:NOROOT(1) 243UsageFault_Handler 244 B . 245 246 PUBWEAK SVC_Handler 247 SECTION .text:CODE:REORDER:NOROOT(1) 248SVC_Handler 249 B . 250 251 PUBWEAK DebugMon_Handler 252 SECTION .text:CODE:REORDER:NOROOT(1) 253DebugMon_Handler 254 B . 255 256 PUBWEAK PendSV_Handler 257 SECTION .text:CODE:REORDER:NOROOT(1) 258PendSV_Handler 259 B . 260 261 PUBWEAK SysTick_Handler 262 SECTION .text:CODE:REORDER:NOROOT(1) 263SysTick_Handler 264 B . 265 266 267 ; Dummy interrupt handlers 268 269 PUBWEAK POWER_CLOCK_IRQHandler 270 SECTION .text:CODE:REORDER:NOROOT(1) 271POWER_CLOCK_IRQHandler 272 B . 273 274 PUBWEAK RADIO_IRQHandler 275 SECTION .text:CODE:REORDER:NOROOT(1) 276RADIO_IRQHandler 277 B . 278 279 PUBWEAK UARTE0_UART0_IRQHandler 280 SECTION .text:CODE:REORDER:NOROOT(1) 281UARTE0_UART0_IRQHandler 282 B . 283 284 PUBWEAK SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler 285 SECTION .text:CODE:REORDER:NOROOT(1) 286SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler 287 B . 288 289 PUBWEAK SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler 290 SECTION .text:CODE:REORDER:NOROOT(1) 291SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1_IRQHandler 292 B . 293 294 PUBWEAK NFCT_IRQHandler 295 SECTION .text:CODE:REORDER:NOROOT(1) 296NFCT_IRQHandler 297 B . 298 299 PUBWEAK GPIOTE_IRQHandler 300 SECTION .text:CODE:REORDER:NOROOT(1) 301GPIOTE_IRQHandler 302 B . 303 304 PUBWEAK SAADC_IRQHandler 305 SECTION .text:CODE:REORDER:NOROOT(1) 306SAADC_IRQHandler 307 B . 308 309 PUBWEAK TIMER0_IRQHandler 310 SECTION .text:CODE:REORDER:NOROOT(1) 311TIMER0_IRQHandler 312 B . 313 314 PUBWEAK TIMER1_IRQHandler 315 SECTION .text:CODE:REORDER:NOROOT(1) 316TIMER1_IRQHandler 317 B . 318 319 PUBWEAK TIMER2_IRQHandler 320 SECTION .text:CODE:REORDER:NOROOT(1) 321TIMER2_IRQHandler 322 B . 323 324 PUBWEAK RTC0_IRQHandler 325 SECTION .text:CODE:REORDER:NOROOT(1) 326RTC0_IRQHandler 327 B . 328 329 PUBWEAK TEMP_IRQHandler 330 SECTION .text:CODE:REORDER:NOROOT(1) 331TEMP_IRQHandler 332 B . 333 334 PUBWEAK RNG_IRQHandler 335 SECTION .text:CODE:REORDER:NOROOT(1) 336RNG_IRQHandler 337 B . 338 339 PUBWEAK ECB_IRQHandler 340 SECTION .text:CODE:REORDER:NOROOT(1) 341ECB_IRQHandler 342 B . 343 344 PUBWEAK CCM_AAR_IRQHandler 345 SECTION .text:CODE:REORDER:NOROOT(1) 346CCM_AAR_IRQHandler 347 B . 348 349 PUBWEAK WDT_IRQHandler 350 SECTION .text:CODE:REORDER:NOROOT(1) 351WDT_IRQHandler 352 B . 353 354 PUBWEAK RTC1_IRQHandler 355 SECTION .text:CODE:REORDER:NOROOT(1) 356RTC1_IRQHandler 357 B . 358 359 PUBWEAK QDEC_IRQHandler 360 SECTION .text:CODE:REORDER:NOROOT(1) 361QDEC_IRQHandler 362 B . 363 364 PUBWEAK COMP_LPCOMP_IRQHandler 365 SECTION .text:CODE:REORDER:NOROOT(1) 366COMP_LPCOMP_IRQHandler 367 B . 368 369 PUBWEAK SWI0_EGU0_IRQHandler 370 SECTION .text:CODE:REORDER:NOROOT(1) 371SWI0_EGU0_IRQHandler 372 B . 373 374 PUBWEAK SWI1_EGU1_IRQHandler 375 SECTION .text:CODE:REORDER:NOROOT(1) 376SWI1_EGU1_IRQHandler 377 B . 378 379 PUBWEAK SWI2_EGU2_IRQHandler 380 SECTION .text:CODE:REORDER:NOROOT(1) 381SWI2_EGU2_IRQHandler 382 B . 383 384 PUBWEAK SWI3_EGU3_IRQHandler 385 SECTION .text:CODE:REORDER:NOROOT(1) 386SWI3_EGU3_IRQHandler 387 B . 388 389 PUBWEAK SWI4_EGU4_IRQHandler 390 SECTION .text:CODE:REORDER:NOROOT(1) 391SWI4_EGU4_IRQHandler 392 B . 393 394 PUBWEAK SWI5_EGU5_IRQHandler 395 SECTION .text:CODE:REORDER:NOROOT(1) 396SWI5_EGU5_IRQHandler 397 B . 398 399 PUBWEAK TIMER3_IRQHandler 400 SECTION .text:CODE:REORDER:NOROOT(1) 401TIMER3_IRQHandler 402 B . 403 404 PUBWEAK TIMER4_IRQHandler 405 SECTION .text:CODE:REORDER:NOROOT(1) 406TIMER4_IRQHandler 407 B . 408 409 PUBWEAK PWM0_IRQHandler 410 SECTION .text:CODE:REORDER:NOROOT(1) 411PWM0_IRQHandler 412 B . 413 414 PUBWEAK PDM_IRQHandler 415 SECTION .text:CODE:REORDER:NOROOT(1) 416PDM_IRQHandler 417 B . 418 419 PUBWEAK MWU_IRQHandler 420 SECTION .text:CODE:REORDER:NOROOT(1) 421MWU_IRQHandler 422 B . 423 424 PUBWEAK PWM1_IRQHandler 425 SECTION .text:CODE:REORDER:NOROOT(1) 426PWM1_IRQHandler 427 B . 428 429 PUBWEAK PWM2_IRQHandler 430 SECTION .text:CODE:REORDER:NOROOT(1) 431PWM2_IRQHandler 432 B . 433 434 PUBWEAK SPIM2_SPIS2_SPI2_IRQHandler 435 SECTION .text:CODE:REORDER:NOROOT(1) 436SPIM2_SPIS2_SPI2_IRQHandler 437 B . 438 439 PUBWEAK RTC2_IRQHandler 440 SECTION .text:CODE:REORDER:NOROOT(1) 441RTC2_IRQHandler 442 B . 443 444 PUBWEAK I2S_IRQHandler 445 SECTION .text:CODE:REORDER:NOROOT(1) 446I2S_IRQHandler 447 B . 448 449 PUBWEAK FPU_IRQHandler 450 SECTION .text:CODE:REORDER:NOROOT(1) 451FPU_IRQHandler 452 B . 453 454 END 455 456 457