mbed library sources
Fork of mbed-src by
targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822/TOOLCHAIN_GCC_ARM/startup_NRF51822.s@308:59cc78a25982, 2014-09-05 (annotated)
- Committer:
- todotani
- Date:
- Fri Sep 05 14:20:33 2014 +0000
- Revision:
- 308:59cc78a25982
- Parent:
- 270:e2babe29baf8
BLE_Health_Thermometer for mbed HRM1017 with BLE library 0.1.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 230:b37c24245c0d | 1 | /* |
mbed_official | 230:b37c24245c0d | 2 | Copyright (c) 2013, Nordic Semiconductor ASA |
mbed_official | 230:b37c24245c0d | 3 | All rights reserved. |
mbed_official | 230:b37c24245c0d | 4 | |
mbed_official | 230:b37c24245c0d | 5 | Redistribution and use in source and binary forms, with or without |
mbed_official | 230:b37c24245c0d | 6 | modification, are permitted provided that the following conditions are met: |
mbed_official | 230:b37c24245c0d | 7 | |
mbed_official | 230:b37c24245c0d | 8 | * Redistributions of source code must retain the above copyright notice, this |
mbed_official | 230:b37c24245c0d | 9 | list of conditions and the following disclaimer. |
mbed_official | 230:b37c24245c0d | 10 | |
mbed_official | 230:b37c24245c0d | 11 | * Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 230:b37c24245c0d | 12 | this list of conditions and the following disclaimer in the documentation |
mbed_official | 230:b37c24245c0d | 13 | and/or other materials provided with the distribution. |
mbed_official | 230:b37c24245c0d | 14 | |
mbed_official | 230:b37c24245c0d | 15 | * Neither the name of Nordic Semiconductor ASA nor the names of its |
mbed_official | 230:b37c24245c0d | 16 | contributors may be used to endorse or promote products derived from |
mbed_official | 230:b37c24245c0d | 17 | this software without specific prior written permission. |
mbed_official | 230:b37c24245c0d | 18 | |
mbed_official | 230:b37c24245c0d | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 230:b37c24245c0d | 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 230:b37c24245c0d | 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 230:b37c24245c0d | 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 230:b37c24245c0d | 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 230:b37c24245c0d | 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 230:b37c24245c0d | 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 230:b37c24245c0d | 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 230:b37c24245c0d | 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 230:b37c24245c0d | 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 230:b37c24245c0d | 29 | */ |
mbed_official | 230:b37c24245c0d | 30 | |
mbed_official | 230:b37c24245c0d | 31 | /* |
mbed_official | 230:b37c24245c0d | 32 | NOTE: Template files (including this one) are application specific and therefore |
mbed_official | 230:b37c24245c0d | 33 | expected to be copied into the application project folder prior to its use! |
mbed_official | 230:b37c24245c0d | 34 | */ |
mbed_official | 230:b37c24245c0d | 35 | |
mbed_official | 230:b37c24245c0d | 36 | .syntax unified |
mbed_official | 230:b37c24245c0d | 37 | .arch armv6-m |
mbed_official | 230:b37c24245c0d | 38 | |
mbed_official | 230:b37c24245c0d | 39 | .section .stack |
mbed_official | 230:b37c24245c0d | 40 | .align 3 |
mbed_official | 230:b37c24245c0d | 41 | #ifdef __STACK_SIZE |
mbed_official | 230:b37c24245c0d | 42 | .equ Stack_Size, __STACK_SIZE |
mbed_official | 230:b37c24245c0d | 43 | #else |
mbed_official | 230:b37c24245c0d | 44 | .equ Stack_Size, 2048 |
mbed_official | 230:b37c24245c0d | 45 | #endif |
mbed_official | 230:b37c24245c0d | 46 | .globl __StackTop |
mbed_official | 230:b37c24245c0d | 47 | .globl __StackLimit |
mbed_official | 230:b37c24245c0d | 48 | __StackLimit: |
mbed_official | 230:b37c24245c0d | 49 | .space Stack_Size |
mbed_official | 230:b37c24245c0d | 50 | .size __StackLimit, . - __StackLimit |
mbed_official | 230:b37c24245c0d | 51 | __StackTop: |
mbed_official | 230:b37c24245c0d | 52 | .size __StackTop, . - __StackTop |
mbed_official | 230:b37c24245c0d | 53 | |
mbed_official | 230:b37c24245c0d | 54 | .section .heap |
mbed_official | 230:b37c24245c0d | 55 | .align 3 |
mbed_official | 230:b37c24245c0d | 56 | #ifdef __HEAP_SIZE |
mbed_official | 230:b37c24245c0d | 57 | .equ Heap_Size, __HEAP_SIZE |
mbed_official | 230:b37c24245c0d | 58 | #else |
mbed_official | 230:b37c24245c0d | 59 | .equ Heap_Size, 2048 |
mbed_official | 230:b37c24245c0d | 60 | #endif |
mbed_official | 230:b37c24245c0d | 61 | .globl __HeapBase |
mbed_official | 230:b37c24245c0d | 62 | .globl __HeapLimit |
mbed_official | 230:b37c24245c0d | 63 | __HeapBase: |
mbed_official | 230:b37c24245c0d | 64 | .if Heap_Size |
mbed_official | 230:b37c24245c0d | 65 | .space Heap_Size |
mbed_official | 230:b37c24245c0d | 66 | .endif |
mbed_official | 230:b37c24245c0d | 67 | .size __HeapBase, . - __HeapBase |
mbed_official | 230:b37c24245c0d | 68 | __HeapLimit: |
mbed_official | 230:b37c24245c0d | 69 | .size __HeapLimit, . - __HeapLimit |
mbed_official | 230:b37c24245c0d | 70 | |
mbed_official | 230:b37c24245c0d | 71 | .section .Vectors |
mbed_official | 230:b37c24245c0d | 72 | .align 2 |
mbed_official | 230:b37c24245c0d | 73 | .globl __Vectors |
mbed_official | 230:b37c24245c0d | 74 | __Vectors: |
mbed_official | 230:b37c24245c0d | 75 | .long __StackTop /* Top of Stack */ |
mbed_official | 230:b37c24245c0d | 76 | .long Reset_Handler /* Reset Handler */ |
mbed_official | 230:b37c24245c0d | 77 | .long NMI_Handler /* NMI Handler */ |
mbed_official | 230:b37c24245c0d | 78 | .long HardFault_Handler /* Hard Fault Handler */ |
mbed_official | 230:b37c24245c0d | 79 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 80 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 81 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 82 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 83 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 84 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 85 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 86 | .long SVC_Handler /* SVCall Handler */ |
mbed_official | 230:b37c24245c0d | 87 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 88 | .long 0 /* Reserved */ |
mbed_official | 230:b37c24245c0d | 89 | .long PendSV_Handler /* PendSV Handler */ |
mbed_official | 230:b37c24245c0d | 90 | .long SysTick_Handler /* SysTick Handler */ |
mbed_official | 230:b37c24245c0d | 91 | |
mbed_official | 230:b37c24245c0d | 92 | /* External Interrupts */ |
mbed_official | 230:b37c24245c0d | 93 | .long POWER_CLOCK_IRQHandler /*POWER_CLOCK */ |
mbed_official | 230:b37c24245c0d | 94 | .long RADIO_IRQHandler /*RADIO */ |
mbed_official | 230:b37c24245c0d | 95 | .long UART0_IRQHandler /*UART0 */ |
mbed_official | 230:b37c24245c0d | 96 | .long SPI0_TWI0_IRQHandler /*SPI0_TWI0 */ |
mbed_official | 230:b37c24245c0d | 97 | .long SPI1_TWI1_IRQHandler /*SPI1_TWI1 */ |
mbed_official | 230:b37c24245c0d | 98 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 99 | .long GPIOTE_IRQHandler /*GPIOTE */ |
mbed_official | 230:b37c24245c0d | 100 | .long ADC_IRQHandler /*ADC */ |
mbed_official | 230:b37c24245c0d | 101 | .long TIMER0_IRQHandler /*TIMER0 */ |
mbed_official | 230:b37c24245c0d | 102 | .long TIMER1_IRQHandler /*TIMER1 */ |
mbed_official | 230:b37c24245c0d | 103 | .long TIMER2_IRQHandler /*TIMER2 */ |
mbed_official | 230:b37c24245c0d | 104 | .long RTC0_IRQHandler /*RTC0 */ |
mbed_official | 230:b37c24245c0d | 105 | .long TEMP_IRQHandler /*TEMP */ |
mbed_official | 230:b37c24245c0d | 106 | .long RNG_IRQHandler /*RNG */ |
mbed_official | 230:b37c24245c0d | 107 | .long ECB_IRQHandler /*ECB */ |
mbed_official | 230:b37c24245c0d | 108 | .long CCM_AAR_IRQHandler /*CCM_AAR */ |
mbed_official | 230:b37c24245c0d | 109 | .long WDT_IRQHandler /*WDT */ |
mbed_official | 230:b37c24245c0d | 110 | .long RTC1_IRQHandler /*RTC1 */ |
mbed_official | 230:b37c24245c0d | 111 | .long QDEC_IRQHandler /*QDEC */ |
mbed_official | 230:b37c24245c0d | 112 | .long LPCOMP_IRQHandler /*LPCOMP */ |
mbed_official | 230:b37c24245c0d | 113 | .long SWI0_IRQHandler /*SWI0 */ |
mbed_official | 230:b37c24245c0d | 114 | .long SWI1_IRQHandler /*SWI1 */ |
mbed_official | 230:b37c24245c0d | 115 | .long SWI2_IRQHandler /*SWI2 */ |
mbed_official | 230:b37c24245c0d | 116 | .long SWI3_IRQHandler /*SWI3 */ |
mbed_official | 230:b37c24245c0d | 117 | .long SWI4_IRQHandler /*SWI4 */ |
mbed_official | 230:b37c24245c0d | 118 | .long SWI5_IRQHandler /*SWI5 */ |
mbed_official | 230:b37c24245c0d | 119 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 120 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 121 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 122 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 123 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 124 | .long 0 /*Reserved */ |
mbed_official | 230:b37c24245c0d | 125 | |
mbed_official | 230:b37c24245c0d | 126 | |
mbed_official | 230:b37c24245c0d | 127 | .size __Vectors, . - __Vectors |
mbed_official | 230:b37c24245c0d | 128 | |
mbed_official | 230:b37c24245c0d | 129 | /* Reset Handler */ |
mbed_official | 230:b37c24245c0d | 130 | |
mbed_official | 230:b37c24245c0d | 131 | .equ NRF_POWER_RAMON_ADDRESS, 0x40000524 |
mbed_official | 230:b37c24245c0d | 132 | .equ NRF_POWER_RAMON_RAMxON_ONMODE_Msk, 0x3 |
mbed_official | 230:b37c24245c0d | 133 | |
mbed_official | 230:b37c24245c0d | 134 | .text |
mbed_official | 230:b37c24245c0d | 135 | .thumb |
mbed_official | 230:b37c24245c0d | 136 | .thumb_func |
mbed_official | 230:b37c24245c0d | 137 | .align 1 |
mbed_official | 230:b37c24245c0d | 138 | .globl Reset_Handler |
mbed_official | 230:b37c24245c0d | 139 | .type Reset_Handler, %function |
mbed_official | 230:b37c24245c0d | 140 | Reset_Handler: |
mbed_official | 230:b37c24245c0d | 141 | .fnstart |
mbed_official | 230:b37c24245c0d | 142 | |
mbed_official | 230:b37c24245c0d | 143 | /* Make sure ALL RAM banks are powered on */ |
mbed_official | 230:b37c24245c0d | 144 | LDR R0, =NRF_POWER_RAMON_ADDRESS |
mbed_official | 230:b37c24245c0d | 145 | LDR R2, [R0] |
mbed_official | 230:b37c24245c0d | 146 | MOVS R1, #NRF_POWER_RAMON_RAMxON_ONMODE_Msk |
mbed_official | 230:b37c24245c0d | 147 | ORRS R2, R1 |
mbed_official | 230:b37c24245c0d | 148 | STR R2, [R0] |
mbed_official | 230:b37c24245c0d | 149 | |
mbed_official | 230:b37c24245c0d | 150 | /* Loop to copy data from read only memory to RAM. The ranges |
mbed_official | 230:b37c24245c0d | 151 | * of copy from/to are specified by following symbols evaluated in |
mbed_official | 230:b37c24245c0d | 152 | * linker script. |
mbed_official | 230:b37c24245c0d | 153 | * __etext: End of code section, i.e., begin of data sections to copy from. |
mbed_official | 230:b37c24245c0d | 154 | * __data_start__/__data_end__: RAM address range that data should be |
mbed_official | 230:b37c24245c0d | 155 | * copied to. Both must be aligned to 4 bytes boundary. */ |
mbed_official | 230:b37c24245c0d | 156 | |
mbed_official | 230:b37c24245c0d | 157 | ldr r1, =__etext |
mbed_official | 230:b37c24245c0d | 158 | ldr r2, =__data_start__ |
mbed_official | 230:b37c24245c0d | 159 | ldr r3, =__data_end__ |
mbed_official | 230:b37c24245c0d | 160 | |
mbed_official | 230:b37c24245c0d | 161 | subs r3, r2 |
mbed_official | 230:b37c24245c0d | 162 | ble .LC0 |
mbed_official | 230:b37c24245c0d | 163 | |
mbed_official | 230:b37c24245c0d | 164 | .LC1: |
mbed_official | 230:b37c24245c0d | 165 | subs r3, 4 |
mbed_official | 230:b37c24245c0d | 166 | ldr r0, [r1,r3] |
mbed_official | 230:b37c24245c0d | 167 | str r0, [r2,r3] |
mbed_official | 230:b37c24245c0d | 168 | bgt .LC1 |
mbed_official | 230:b37c24245c0d | 169 | .LC0: |
mbed_official | 230:b37c24245c0d | 170 | |
mbed_official | 230:b37c24245c0d | 171 | LDR R0, =SystemInit |
mbed_official | 230:b37c24245c0d | 172 | BLX R0 |
mbed_official | 230:b37c24245c0d | 173 | LDR R0, =_start |
mbed_official | 230:b37c24245c0d | 174 | BX R0 |
mbed_official | 230:b37c24245c0d | 175 | |
mbed_official | 230:b37c24245c0d | 176 | .pool |
mbed_official | 230:b37c24245c0d | 177 | .cantunwind |
mbed_official | 230:b37c24245c0d | 178 | .fnend |
mbed_official | 230:b37c24245c0d | 179 | .size Reset_Handler,.-Reset_Handler |
mbed_official | 230:b37c24245c0d | 180 | |
mbed_official | 230:b37c24245c0d | 181 | .section ".text" |
mbed_official | 230:b37c24245c0d | 182 | |
mbed_official | 230:b37c24245c0d | 183 | |
mbed_official | 230:b37c24245c0d | 184 | /* Dummy Exception Handlers (infinite loops which can be modified) */ |
mbed_official | 230:b37c24245c0d | 185 | |
mbed_official | 230:b37c24245c0d | 186 | .weak NMI_Handler |
mbed_official | 230:b37c24245c0d | 187 | .type NMI_Handler, %function |
mbed_official | 230:b37c24245c0d | 188 | NMI_Handler: |
mbed_official | 230:b37c24245c0d | 189 | B . |
mbed_official | 230:b37c24245c0d | 190 | .size NMI_Handler, . - NMI_Handler |
mbed_official | 230:b37c24245c0d | 191 | |
mbed_official | 230:b37c24245c0d | 192 | |
mbed_official | 230:b37c24245c0d | 193 | .weak HardFault_Handler |
mbed_official | 230:b37c24245c0d | 194 | .type HardFault_Handler, %function |
mbed_official | 230:b37c24245c0d | 195 | HardFault_Handler: |
mbed_official | 230:b37c24245c0d | 196 | B . |
mbed_official | 230:b37c24245c0d | 197 | .size HardFault_Handler, . - HardFault_Handler |
mbed_official | 230:b37c24245c0d | 198 | |
mbed_official | 230:b37c24245c0d | 199 | |
mbed_official | 230:b37c24245c0d | 200 | .weak SVC_Handler |
mbed_official | 230:b37c24245c0d | 201 | .type SVC_Handler, %function |
mbed_official | 230:b37c24245c0d | 202 | SVC_Handler: |
mbed_official | 230:b37c24245c0d | 203 | B . |
mbed_official | 230:b37c24245c0d | 204 | .size SVC_Handler, . - SVC_Handler |
mbed_official | 230:b37c24245c0d | 205 | |
mbed_official | 230:b37c24245c0d | 206 | |
mbed_official | 230:b37c24245c0d | 207 | .weak PendSV_Handler |
mbed_official | 230:b37c24245c0d | 208 | .type PendSV_Handler, %function |
mbed_official | 230:b37c24245c0d | 209 | PendSV_Handler: |
mbed_official | 230:b37c24245c0d | 210 | B . |
mbed_official | 230:b37c24245c0d | 211 | .size PendSV_Handler, . - PendSV_Handler |
mbed_official | 230:b37c24245c0d | 212 | |
mbed_official | 230:b37c24245c0d | 213 | |
mbed_official | 230:b37c24245c0d | 214 | .weak SysTick_Handler |
mbed_official | 230:b37c24245c0d | 215 | .type SysTick_Handler, %function |
mbed_official | 230:b37c24245c0d | 216 | SysTick_Handler: |
mbed_official | 230:b37c24245c0d | 217 | B . |
mbed_official | 230:b37c24245c0d | 218 | .size SysTick_Handler, . - SysTick_Handler |
mbed_official | 230:b37c24245c0d | 219 | |
mbed_official | 230:b37c24245c0d | 220 | |
mbed_official | 230:b37c24245c0d | 221 | /* IRQ Handlers */ |
mbed_official | 230:b37c24245c0d | 222 | |
mbed_official | 230:b37c24245c0d | 223 | .globl Default_Handler |
mbed_official | 230:b37c24245c0d | 224 | .type Default_Handler, %function |
mbed_official | 230:b37c24245c0d | 225 | Default_Handler: |
mbed_official | 230:b37c24245c0d | 226 | B . |
mbed_official | 230:b37c24245c0d | 227 | .size Default_Handler, . - Default_Handler |
mbed_official | 230:b37c24245c0d | 228 | |
mbed_official | 230:b37c24245c0d | 229 | .macro IRQ handler |
mbed_official | 230:b37c24245c0d | 230 | .weak \handler |
mbed_official | 230:b37c24245c0d | 231 | .set \handler, Default_Handler |
mbed_official | 230:b37c24245c0d | 232 | .endm |
mbed_official | 230:b37c24245c0d | 233 | |
mbed_official | 230:b37c24245c0d | 234 | IRQ POWER_CLOCK_IRQHandler |
mbed_official | 230:b37c24245c0d | 235 | IRQ RADIO_IRQHandler |
mbed_official | 230:b37c24245c0d | 236 | IRQ UART0_IRQHandler |
mbed_official | 230:b37c24245c0d | 237 | IRQ SPI0_TWI0_IRQHandler |
mbed_official | 230:b37c24245c0d | 238 | IRQ SPI1_TWI1_IRQHandler |
mbed_official | 230:b37c24245c0d | 239 | IRQ GPIOTE_IRQHandler |
mbed_official | 230:b37c24245c0d | 240 | IRQ ADC_IRQHandler |
mbed_official | 230:b37c24245c0d | 241 | IRQ TIMER0_IRQHandler |
mbed_official | 230:b37c24245c0d | 242 | IRQ TIMER1_IRQHandler |
mbed_official | 230:b37c24245c0d | 243 | IRQ TIMER2_IRQHandler |
mbed_official | 230:b37c24245c0d | 244 | IRQ RTC0_IRQHandler |
mbed_official | 230:b37c24245c0d | 245 | IRQ TEMP_IRQHandler |
mbed_official | 230:b37c24245c0d | 246 | IRQ RNG_IRQHandler |
mbed_official | 230:b37c24245c0d | 247 | IRQ ECB_IRQHandler |
mbed_official | 230:b37c24245c0d | 248 | IRQ CCM_AAR_IRQHandler |
mbed_official | 230:b37c24245c0d | 249 | IRQ WDT_IRQHandler |
mbed_official | 230:b37c24245c0d | 250 | IRQ RTC1_IRQHandler |
mbed_official | 230:b37c24245c0d | 251 | IRQ QDEC_IRQHandler |
mbed_official | 230:b37c24245c0d | 252 | IRQ LPCOMP_IRQHandler |
mbed_official | 230:b37c24245c0d | 253 | IRQ SWI0_IRQHandler |
mbed_official | 230:b37c24245c0d | 254 | IRQ SWI1_IRQHandler |
mbed_official | 230:b37c24245c0d | 255 | IRQ SWI2_IRQHandler |
mbed_official | 230:b37c24245c0d | 256 | IRQ SWI3_IRQHandler |
mbed_official | 230:b37c24245c0d | 257 | IRQ SWI4_IRQHandler |
mbed_official | 230:b37c24245c0d | 258 | IRQ SWI5_IRQHandler |
mbed_official | 230:b37c24245c0d | 259 | |
mbed_official | 230:b37c24245c0d | 260 | |
mbed_official | 230:b37c24245c0d | 261 | .end |
mbed_official | 230:b37c24245c0d | 262 |