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_IRQHandler 91 DCD TWIM0_TWIS0_IRQHandler 92 DCD SPIM0_SPIS0_IRQHandler 93 DCD 0 ; Reserved 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_IRQHandler 108 DCD SWI0_EGU0_IRQHandler 109 DCD SWI1_EGU1_IRQHandler 110 DCD SWI2_IRQHandler 111 DCD SWI3_IRQHandler 112 DCD SWI4_IRQHandler 113 DCD SWI5_IRQHandler 114 DCD 0 ; Reserved 115 DCD 0 ; Reserved 116 DCD PWM0_IRQHandler 117 DCD PDM_IRQHandler 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 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_IRQHandler 280 SECTION .text:CODE:REORDER:NOROOT(1) 281UARTE0_IRQHandler 282 B . 283 284 PUBWEAK TWIM0_TWIS0_IRQHandler 285 SECTION .text:CODE:REORDER:NOROOT(1) 286TWIM0_TWIS0_IRQHandler 287 B . 288 289 PUBWEAK SPIM0_SPIS0_IRQHandler 290 SECTION .text:CODE:REORDER:NOROOT(1) 291SPIM0_SPIS0_IRQHandler 292 B . 293 294 PUBWEAK GPIOTE_IRQHandler 295 SECTION .text:CODE:REORDER:NOROOT(1) 296GPIOTE_IRQHandler 297 B . 298 299 PUBWEAK SAADC_IRQHandler 300 SECTION .text:CODE:REORDER:NOROOT(1) 301SAADC_IRQHandler 302 B . 303 304 PUBWEAK TIMER0_IRQHandler 305 SECTION .text:CODE:REORDER:NOROOT(1) 306TIMER0_IRQHandler 307 B . 308 309 PUBWEAK TIMER1_IRQHandler 310 SECTION .text:CODE:REORDER:NOROOT(1) 311TIMER1_IRQHandler 312 B . 313 314 PUBWEAK TIMER2_IRQHandler 315 SECTION .text:CODE:REORDER:NOROOT(1) 316TIMER2_IRQHandler 317 B . 318 319 PUBWEAK RTC0_IRQHandler 320 SECTION .text:CODE:REORDER:NOROOT(1) 321RTC0_IRQHandler 322 B . 323 324 PUBWEAK TEMP_IRQHandler 325 SECTION .text:CODE:REORDER:NOROOT(1) 326TEMP_IRQHandler 327 B . 328 329 PUBWEAK RNG_IRQHandler 330 SECTION .text:CODE:REORDER:NOROOT(1) 331RNG_IRQHandler 332 B . 333 334 PUBWEAK ECB_IRQHandler 335 SECTION .text:CODE:REORDER:NOROOT(1) 336ECB_IRQHandler 337 B . 338 339 PUBWEAK CCM_AAR_IRQHandler 340 SECTION .text:CODE:REORDER:NOROOT(1) 341CCM_AAR_IRQHandler 342 B . 343 344 PUBWEAK WDT_IRQHandler 345 SECTION .text:CODE:REORDER:NOROOT(1) 346WDT_IRQHandler 347 B . 348 349 PUBWEAK RTC1_IRQHandler 350 SECTION .text:CODE:REORDER:NOROOT(1) 351RTC1_IRQHandler 352 B . 353 354 PUBWEAK QDEC_IRQHandler 355 SECTION .text:CODE:REORDER:NOROOT(1) 356QDEC_IRQHandler 357 B . 358 359 PUBWEAK COMP_IRQHandler 360 SECTION .text:CODE:REORDER:NOROOT(1) 361COMP_IRQHandler 362 B . 363 364 PUBWEAK SWI0_EGU0_IRQHandler 365 SECTION .text:CODE:REORDER:NOROOT(1) 366SWI0_EGU0_IRQHandler 367 B . 368 369 PUBWEAK SWI1_EGU1_IRQHandler 370 SECTION .text:CODE:REORDER:NOROOT(1) 371SWI1_EGU1_IRQHandler 372 B . 373 374 PUBWEAK SWI2_IRQHandler 375 SECTION .text:CODE:REORDER:NOROOT(1) 376SWI2_IRQHandler 377 B . 378 379 PUBWEAK SWI3_IRQHandler 380 SECTION .text:CODE:REORDER:NOROOT(1) 381SWI3_IRQHandler 382 B . 383 384 PUBWEAK SWI4_IRQHandler 385 SECTION .text:CODE:REORDER:NOROOT(1) 386SWI4_IRQHandler 387 B . 388 389 PUBWEAK SWI5_IRQHandler 390 SECTION .text:CODE:REORDER:NOROOT(1) 391SWI5_IRQHandler 392 B . 393 394 PUBWEAK PWM0_IRQHandler 395 SECTION .text:CODE:REORDER:NOROOT(1) 396PWM0_IRQHandler 397 B . 398 399 PUBWEAK PDM_IRQHandler 400 SECTION .text:CODE:REORDER:NOROOT(1) 401PDM_IRQHandler 402 B . 403 404 END 405 406 407