123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394 |
- /*
-
- Copyright (c) 2009-2018 ARM Limited. All rights reserved.
- SPDX-License-Identifier: Apache-2.0
- Licensed under the Apache License, Version 2.0 (the License); you may
- not use this file except in compliance with the License.
- You may obtain a copy of the License at
- www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an AS IS BASIS, WITHOUT
- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- NOTICE: This file has been modified by Nordic Semiconductor ASA.
- */
- .syntax unified
- .arch armv7e-m
- #ifdef __STARTUP_CONFIG
- #include "startup_config.h"
- #ifndef __STARTUP_CONFIG_STACK_ALIGNEMENT
- #define __STARTUP_CONFIG_STACK_ALIGNEMENT 3
- #endif
- #endif
- .section .stack
- #if defined(__STARTUP_CONFIG)
- .align __STARTUP_CONFIG_STACK_ALIGNEMENT
- .equ Stack_Size, __STARTUP_CONFIG_STACK_SIZE
- #elif defined(__STACK_SIZE)
- .align 3
- .equ Stack_Size, __STACK_SIZE
- #else
- .align 3
- .equ Stack_Size, 2048
- #endif
- .globl __StackTop
- .globl __StackLimit
- __StackLimit:
- .space Stack_Size
- .size __StackLimit, . - __StackLimit
- __StackTop:
- .size __StackTop, . - __StackTop
- .section .heap
- .align 3
- #if defined(__STARTUP_CONFIG)
- .equ Heap_Size, __STARTUP_CONFIG_HEAP_SIZE
- #elif defined(__HEAP_SIZE)
- .equ Heap_Size, __HEAP_SIZE
- #else
- .equ Heap_Size, 2048
- #endif
- .globl __HeapBase
- .globl __HeapLimit
- __HeapBase:
- .if Heap_Size
- .space Heap_Size
- .endif
- .size __HeapBase, . - __HeapBase
- __HeapLimit:
- .size __HeapLimit, . - __HeapLimit
- .section .isr_vector
- .align 2
- .globl __isr_vector
- __isr_vector:
- .long __StackTop /* Top of Stack */
- .long Reset_Handler
- .long NMI_Handler
- .long HardFault_Handler
- .long MemoryManagement_Handler
- .long BusFault_Handler
- .long UsageFault_Handler
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long SVC_Handler
- .long DebugMon_Handler
- .long 0 /*Reserved */
- .long PendSV_Handler
- .long SysTick_Handler
- /* External Interrupts */
- .long POWER_CLOCK_IRQHandler
- .long RADIO_IRQHandler
- .long UARTE0_IRQHandler
- .long TWIM0_TWIS0_IRQHandler
- .long SPIM0_SPIS0_IRQHandler
- .long 0 /*Reserved */
- .long GPIOTE_IRQHandler
- .long SAADC_IRQHandler
- .long TIMER0_IRQHandler
- .long TIMER1_IRQHandler
- .long TIMER2_IRQHandler
- .long RTC0_IRQHandler
- .long TEMP_IRQHandler
- .long RNG_IRQHandler
- .long ECB_IRQHandler
- .long CCM_AAR_IRQHandler
- .long WDT_IRQHandler
- .long RTC1_IRQHandler
- .long QDEC_IRQHandler
- .long COMP_IRQHandler
- .long SWI0_EGU0_IRQHandler
- .long SWI1_EGU1_IRQHandler
- .long SWI2_IRQHandler
- .long SWI3_IRQHandler
- .long SWI4_IRQHandler
- .long SWI5_IRQHandler
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long PWM0_IRQHandler
- .long PDM_IRQHandler
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .long 0 /*Reserved */
- .size __isr_vector, . - __isr_vector
- /* Reset Handler */
- .text
- .thumb
- .thumb_func
- .align 1
- .globl Reset_Handler
- .type Reset_Handler, %function
- Reset_Handler:
- /* Loop to copy data from read only memory to RAM.
- * The ranges of copy from/to are specified by following symbols:
- * __etext: LMA of start of the section to copy from. Usually end of text
- * __data_start__: VMA of start of the section to copy to.
- * __bss_start__: VMA of end of the section to copy to. Normally __data_end__ is used, but by using __bss_start__
- * the user can add their own initialized data section before BSS section with the INTERT AFTER command.
- *
- * All addresses must be aligned to 4 bytes boundary.
- */
- ldr r1, =__etext
- ldr r2, =__data_start__
- ldr r3, =__bss_start__
- subs r3, r3, r2
- ble .L_loop1_done
- .L_loop1:
- subs r3, r3, #4
- ldr r0, [r1,r3]
- str r0, [r2,r3]
- bgt .L_loop1
- .L_loop1_done:
- /* This part of work usually is done in C library startup code. Otherwise,
- * define __STARTUP_CLEAR_BSS to enable it in this startup. This section
- * clears the RAM where BSS data is located.
- *
- * The BSS section is specified by following symbols
- * __bss_start__: start of the BSS section.
- * __bss_end__: end of the BSS section.
- *
- * All addresses must be aligned to 4 bytes boundary.
- */
- #ifdef __STARTUP_CLEAR_BSS
- ldr r1, =__bss_start__
- ldr r2, =__bss_end__
- movs r0, 0
- subs r2, r2, r1
- ble .L_loop3_done
- .L_loop3:
- subs r2, r2, #4
- str r0, [r1, r2]
- bgt .L_loop3
- .L_loop3_done:
- #endif /* __STARTUP_CLEAR_BSS */
- /* Execute SystemInit function. */
- bl SystemInit
- /* Call _start function provided by libraries.
- * If those libraries are not accessible, define __START as your entry point.
- */
- #ifndef __START
- #define __START _start
- #endif
- bl __START
- .pool
- .size Reset_Handler,.-Reset_Handler
- .section ".text"
- /* Dummy Exception Handlers (infinite loops which can be modified) */
- .weak NMI_Handler
- .type NMI_Handler, %function
- NMI_Handler:
- b .
- .size NMI_Handler, . - NMI_Handler
- .weak HardFault_Handler
- .type HardFault_Handler, %function
- HardFault_Handler:
- b .
- .size HardFault_Handler, . - HardFault_Handler
- .weak MemoryManagement_Handler
- .type MemoryManagement_Handler, %function
- MemoryManagement_Handler:
- b .
- .size MemoryManagement_Handler, . - MemoryManagement_Handler
- .weak BusFault_Handler
- .type BusFault_Handler, %function
- BusFault_Handler:
- b .
- .size BusFault_Handler, . - BusFault_Handler
- .weak UsageFault_Handler
- .type UsageFault_Handler, %function
- UsageFault_Handler:
- b .
- .size UsageFault_Handler, . - UsageFault_Handler
- .weak SVC_Handler
- .type SVC_Handler, %function
- SVC_Handler:
- b .
- .size SVC_Handler, . - SVC_Handler
- .weak DebugMon_Handler
- .type DebugMon_Handler, %function
- DebugMon_Handler:
- b .
- .size DebugMon_Handler, . - DebugMon_Handler
- .weak PendSV_Handler
- .type PendSV_Handler, %function
- PendSV_Handler:
- b .
- .size PendSV_Handler, . - PendSV_Handler
- .weak SysTick_Handler
- .type SysTick_Handler, %function
- SysTick_Handler:
- b .
- .size SysTick_Handler, . - SysTick_Handler
- /* IRQ Handlers */
- .globl Default_Handler
- .type Default_Handler, %function
- Default_Handler:
- b .
- .size Default_Handler, . - Default_Handler
- .macro IRQ handler
- .weak \handler
- .set \handler, Default_Handler
- .endm
- IRQ POWER_CLOCK_IRQHandler
- IRQ RADIO_IRQHandler
- IRQ UARTE0_IRQHandler
- IRQ TWIM0_TWIS0_IRQHandler
- IRQ SPIM0_SPIS0_IRQHandler
- IRQ GPIOTE_IRQHandler
- IRQ SAADC_IRQHandler
- IRQ TIMER0_IRQHandler
- IRQ TIMER1_IRQHandler
- IRQ TIMER2_IRQHandler
- IRQ RTC0_IRQHandler
- IRQ TEMP_IRQHandler
- IRQ RNG_IRQHandler
- IRQ ECB_IRQHandler
- IRQ CCM_AAR_IRQHandler
- IRQ WDT_IRQHandler
- IRQ RTC1_IRQHandler
- IRQ QDEC_IRQHandler
- IRQ COMP_IRQHandler
- IRQ SWI0_EGU0_IRQHandler
- IRQ SWI1_EGU1_IRQHandler
- IRQ SWI2_IRQHandler
- IRQ SWI3_IRQHandler
- IRQ SWI4_IRQHandler
- IRQ SWI5_IRQHandler
- IRQ PWM0_IRQHandler
- IRQ PDM_IRQHandler
- .end
|