mbed official / mbed-src

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Committer:
mbed_official
Date:
Tue Dec 16 08:15:08 2014 +0000
Revision:
440:8a0b45cd594f
Parent:
207:05668db47a72
Synchronized with git revision 67fbbf0b635d0c0d93fbe433306c537c2ad206aa

Full URL: https://github.com/mbedmicro/mbed/commit/67fbbf0b635d0c0d93fbe433306c537c2ad206aa/

Targets: nrf51 - updating app_timer.c from Norid'c SDKv7.1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 207:05668db47a72 1 /* File: startup_ARMCM3.s
mbed_official 207:05668db47a72 2 * Purpose: startup file for Cortex-M3/M4 devices. Should use with
mbed_official 207:05668db47a72 3 * GNU Tools for ARM Embedded Processors
mbed_official 207:05668db47a72 4 * Version: V1.1
mbed_official 207:05668db47a72 5 * Date: 17 June 2011
mbed_official 207:05668db47a72 6 *
mbed_official 207:05668db47a72 7 * Copyright (c) 2011, 2012, ARM Limited
mbed_official 207:05668db47a72 8 * All rights reserved.
mbed_official 207:05668db47a72 9 *
mbed_official 207:05668db47a72 10 * Redistribution and use in source and binary forms, with or without
mbed_official 207:05668db47a72 11 * modification, are permitted provided that the following conditions are met:
mbed_official 207:05668db47a72 12 * Redistributions of source code must retain the above copyright
mbed_official 207:05668db47a72 13 notice, this list of conditions and the following disclaimer.
mbed_official 207:05668db47a72 14 * Redistributions in binary form must reproduce the above copyright
mbed_official 207:05668db47a72 15 notice, this list of conditions and the following disclaimer in the
mbed_official 207:05668db47a72 16 documentation and/or other materials provided with the distribution.
mbed_official 207:05668db47a72 17 * Neither the name of the ARM Limited nor the
mbed_official 207:05668db47a72 18 names of its contributors may be used to endorse or promote products
mbed_official 207:05668db47a72 19 derived from this software without specific prior written permission.
mbed_official 207:05668db47a72 20 *
mbed_official 207:05668db47a72 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 207:05668db47a72 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 207:05668db47a72 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 207:05668db47a72 24 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED BE LIABLE FOR ANY
mbed_official 207:05668db47a72 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 207:05668db47a72 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 207:05668db47a72 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
mbed_official 207:05668db47a72 28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 207:05668db47a72 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 207:05668db47a72 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 207:05668db47a72 31 */
mbed_official 207:05668db47a72 32 .syntax unified
mbed_official 207:05668db47a72 33 .arch armv7-m
mbed_official 207:05668db47a72 34
mbed_official 207:05668db47a72 35 .section .stack
mbed_official 207:05668db47a72 36 .align 3
mbed_official 207:05668db47a72 37 #ifdef __STACK_SIZE
mbed_official 207:05668db47a72 38 .equ Stack_Size, __STACK_SIZE
mbed_official 207:05668db47a72 39 #else
mbed_official 207:05668db47a72 40 .equ Stack_Size, 0xc00
mbed_official 207:05668db47a72 41 #endif
mbed_official 207:05668db47a72 42 .globl __StackTop
mbed_official 207:05668db47a72 43 .globl __StackLimit
mbed_official 207:05668db47a72 44 __StackLimit:
mbed_official 207:05668db47a72 45 .space Stack_Size
mbed_official 207:05668db47a72 46 .size __StackLimit, . - __StackLimit
mbed_official 207:05668db47a72 47 __StackTop:
mbed_official 207:05668db47a72 48 .size __StackTop, . - __StackTop
mbed_official 207:05668db47a72 49
mbed_official 207:05668db47a72 50 .section .heap
mbed_official 207:05668db47a72 51 .align 3
mbed_official 207:05668db47a72 52 #ifdef __HEAP_SIZE
mbed_official 207:05668db47a72 53 .equ Heap_Size, __HEAP_SIZE
mbed_official 207:05668db47a72 54 #else
mbed_official 207:05668db47a72 55 .equ Heap_Size, 0
mbed_official 207:05668db47a72 56 #endif
mbed_official 207:05668db47a72 57 .globl __HeapBase
mbed_official 207:05668db47a72 58 .globl __HeapLimit
mbed_official 207:05668db47a72 59 __HeapBase:
mbed_official 207:05668db47a72 60 .if Heap_Size
mbed_official 207:05668db47a72 61 .space Heap_Size
mbed_official 207:05668db47a72 62 .endif
mbed_official 207:05668db47a72 63 .size __HeapBase, . - __HeapBase
mbed_official 207:05668db47a72 64 __HeapLimit:
mbed_official 207:05668db47a72 65 .size __HeapLimit, . - __HeapLimit
mbed_official 207:05668db47a72 66
mbed_official 207:05668db47a72 67 .section .isr_vector
mbed_official 207:05668db47a72 68 .align 2
mbed_official 207:05668db47a72 69 .globl __isr_vector
mbed_official 207:05668db47a72 70 __isr_vector:
mbed_official 207:05668db47a72 71 .long __StackTop /* Top of Stack */
mbed_official 207:05668db47a72 72 .long Reset_Handler /* Reset Handler */
mbed_official 207:05668db47a72 73 .long NMI_Handler /* NMI Handler */
mbed_official 207:05668db47a72 74 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 207:05668db47a72 75 .long MemManage_Handler /* MPU Fault Handler */
mbed_official 207:05668db47a72 76 .long BusFault_Handler /* Bus Fault Handler */
mbed_official 207:05668db47a72 77 .long UsageFault_Handler /* Usage Fault Handler */
mbed_official 207:05668db47a72 78 .long 0 /* Reserved */
mbed_official 207:05668db47a72 79 .long 0 /* Reserved */
mbed_official 207:05668db47a72 80 .long 0 /* Reserved */
mbed_official 207:05668db47a72 81 .long 0 /* Reserved */
mbed_official 207:05668db47a72 82 .long SVC_Handler /* SVCall Handler */
mbed_official 207:05668db47a72 83 .long DebugMon_Handler /* Debug Monitor Handler */
mbed_official 207:05668db47a72 84 .long 0 /* Reserved */
mbed_official 207:05668db47a72 85 .long PendSV_Handler /* PendSV Handler */
mbed_official 207:05668db47a72 86 .long SysTick_Handler /* SysTick Handler */
mbed_official 207:05668db47a72 87 .long WWDG_IRQHandler /* Window Watchdog */
mbed_official 207:05668db47a72 88
mbed_official 207:05668db47a72 89 /* External interrupts */
mbed_official 207:05668db47a72 90 .long PVD_IRQHandler /* PVD through EXTI Line detect */
mbed_official 207:05668db47a72 91 .long TAMPER_IRQHandler /* Tamper */
mbed_official 207:05668db47a72 92 .long RTC_IRQHandler /* RTC */
mbed_official 207:05668db47a72 93 .long FLASH_IRQHandler /* Flash */
mbed_official 207:05668db47a72 94 .long RCC_IRQHandler /* RCC */
mbed_official 207:05668db47a72 95 .long EXTI0_IRQHandler /* EXTI Line 0 */
mbed_official 207:05668db47a72 96 .long EXTI1_IRQHandler /* EXTI Line 1 */
mbed_official 207:05668db47a72 97 .long EXTI2_IRQHandler /* EXTI Line 2 */
mbed_official 207:05668db47a72 98 .long EXTI3_IRQHandler /* EXTI Line 3 */
mbed_official 207:05668db47a72 99 .long EXTI4_IRQHandler /* EXTI Line 4 */
mbed_official 207:05668db47a72 100 .long DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */
mbed_official 207:05668db47a72 101 .long DMA1_Channel2_IRQHandler /* DMA1 Channel 2 */
mbed_official 207:05668db47a72 102 .long DMA1_Channel3_IRQHandler /* DMA1 Channel 3 */
mbed_official 207:05668db47a72 103 .long DMA1_Channel4_IRQHandler /* DMA1 Channel 4 */
mbed_official 207:05668db47a72 104 .long DMA1_Channel5_IRQHandler /* DMA1 Channel 5 */
mbed_official 207:05668db47a72 105 .long DMA1_Channel6_IRQHandler /* DMA1 Channel 6 */
mbed_official 207:05668db47a72 106 .long DMA1_Channel7_IRQHandler /* DMA1 Channel 7 */
mbed_official 207:05668db47a72 107 .long ADC1_2_IRQHandler /* ADC1_2 */
mbed_official 207:05668db47a72 108 .long USB_HP_CAN1_TX_IRQHandler /* USB High Priority or CAN1 TX */
mbed_official 207:05668db47a72 109 .long USB_LP_CAN1_RX0_IRQHandler /* USB Low Priority or CAN1 RX0 */
mbed_official 207:05668db47a72 110 .long CAN1_RX1_IRQHandler /* CAN1 RX1 */
mbed_official 207:05668db47a72 111 .long CAN1_SCE_IRQHandler /* CAN1 SCE */
mbed_official 207:05668db47a72 112 .long EXTI9_5_IRQHandler /* EXTI Line 9..5 */
mbed_official 207:05668db47a72 113 .long TIM1_BRK_IRQHandler /* TIM1 Break */
mbed_official 207:05668db47a72 114 .long TIM1_UP_IRQHandler /* TIM1 Update */
mbed_official 207:05668db47a72 115 .long TIM1_TRG_COM_IRQHandler /* TIM1 Trigger and Commutation */
mbed_official 207:05668db47a72 116 .long TIM1_CC_IRQHandler /* TIM1 Capture Compare */
mbed_official 207:05668db47a72 117 .long TIM2_IRQHandler /* TIM2 */
mbed_official 207:05668db47a72 118 .long TIM3_IRQHandler /* TIM3 */
mbed_official 207:05668db47a72 119 .long TIM4_IRQHandler /* TIM4 */
mbed_official 207:05668db47a72 120 .long I2C1_EV_IRQHandler /* I2C1 Event */
mbed_official 207:05668db47a72 121 .long I2C1_ER_IRQHandler /* I2C1 Error */
mbed_official 207:05668db47a72 122 .long I2C2_EV_IRQHandler /* I2C2 Event */
mbed_official 207:05668db47a72 123 .long I2C2_ER_IRQHandler /* I2C2 Error */
mbed_official 207:05668db47a72 124 .long SPI1_IRQHandler /* SPI1 */
mbed_official 207:05668db47a72 125 .long SPI2_IRQHandler /* SPI2 */
mbed_official 207:05668db47a72 126 .long USART1_IRQHandler /* USART1 */
mbed_official 207:05668db47a72 127 .long USART2_IRQHandler /* USART2 */
mbed_official 207:05668db47a72 128 .long USART3_IRQHandler /* USART3 */
mbed_official 207:05668db47a72 129 .long EXTI15_10_IRQHandler /* EXTI Line 15..10 */
mbed_official 207:05668db47a72 130 .long RTCAlarm_IRQHandler /* RTC Alarm through EXTI Line */
mbed_official 207:05668db47a72 131 .long USBWakeUp_IRQHandler /* USB Wakeup from suspend */
mbed_official 207:05668db47a72 132
mbed_official 207:05668db47a72 133 .size __isr_vector, . - __isr_vector
mbed_official 207:05668db47a72 134
mbed_official 207:05668db47a72 135 .text
mbed_official 207:05668db47a72 136 .thumb
mbed_official 207:05668db47a72 137 .thumb_func
mbed_official 207:05668db47a72 138 .align 2
mbed_official 207:05668db47a72 139 .globl Reset_Handler
mbed_official 207:05668db47a72 140 .type Reset_Handler, %function
mbed_official 207:05668db47a72 141 Reset_Handler:
mbed_official 207:05668db47a72 142 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 207:05668db47a72 143 * of copy from/to are specified by following symbols evaluated in
mbed_official 207:05668db47a72 144 * linker script.
mbed_official 207:05668db47a72 145 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 207:05668db47a72 146 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 207:05668db47a72 147 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 207:05668db47a72 148
mbed_official 207:05668db47a72 149 ldr r1, =__etext
mbed_official 207:05668db47a72 150 ldr r2, =__data_start__
mbed_official 207:05668db47a72 151 ldr r3, =__data_end__
mbed_official 207:05668db47a72 152
mbed_official 207:05668db47a72 153 .LC0:
mbed_official 207:05668db47a72 154 cmp r2, r3
mbed_official 207:05668db47a72 155 ittt lt
mbed_official 207:05668db47a72 156 ldrlt r0, [r1], #4
mbed_official 207:05668db47a72 157 strlt r0, [r2], #4
mbed_official 207:05668db47a72 158 blt .LC0
mbed_official 207:05668db47a72 159
mbed_official 207:05668db47a72 160 ldr r0, =SystemInit
mbed_official 207:05668db47a72 161 blx r0
mbed_official 207:05668db47a72 162 ldr r0, =_start
mbed_official 207:05668db47a72 163 bx r0
mbed_official 207:05668db47a72 164 .pool
mbed_official 207:05668db47a72 165 .size Reset_Handler, . - Reset_Handler
mbed_official 207:05668db47a72 166
mbed_official 207:05668db47a72 167 .text
mbed_official 207:05668db47a72 168 /* Macro to define default handlers. Default handler
mbed_official 207:05668db47a72 169 * will be weak symbol and just dead loops. They can be
mbed_official 207:05668db47a72 170 * overwritten by other handlers */
mbed_official 207:05668db47a72 171 .macro def_default_handler handler_name
mbed_official 207:05668db47a72 172 .align 1
mbed_official 207:05668db47a72 173 .thumb_func
mbed_official 207:05668db47a72 174 .weak \handler_name
mbed_official 207:05668db47a72 175 .type \handler_name, %function
mbed_official 207:05668db47a72 176 \handler_name :
mbed_official 207:05668db47a72 177 b .
mbed_official 207:05668db47a72 178 .size \handler_name, . - \handler_name
mbed_official 207:05668db47a72 179 .endm
mbed_official 207:05668db47a72 180
mbed_official 207:05668db47a72 181 def_default_handler NMI_Handler
mbed_official 207:05668db47a72 182 def_default_handler HardFault_Handler
mbed_official 207:05668db47a72 183 def_default_handler MemManage_Handler
mbed_official 207:05668db47a72 184 def_default_handler BusFault_Handler
mbed_official 207:05668db47a72 185 def_default_handler UsageFault_Handler
mbed_official 207:05668db47a72 186 def_default_handler SVC_Handler
mbed_official 207:05668db47a72 187 def_default_handler DebugMon_Handler
mbed_official 207:05668db47a72 188 def_default_handler PendSV_Handler
mbed_official 207:05668db47a72 189 def_default_handler SysTick_Handler
mbed_official 207:05668db47a72 190 def_default_handler Default_Handler
mbed_official 207:05668db47a72 191
mbed_official 207:05668db47a72 192 .macro def_irq_default_handler handler_name
mbed_official 207:05668db47a72 193 .weak \handler_name
mbed_official 207:05668db47a72 194 .set \handler_name, Default_Handler
mbed_official 207:05668db47a72 195 .endm
mbed_official 207:05668db47a72 196
mbed_official 207:05668db47a72 197 def_irq_default_handler WWDG_IRQHandler
mbed_official 207:05668db47a72 198 def_irq_default_handler PVD_IRQHandler
mbed_official 207:05668db47a72 199 def_irq_default_handler TAMPER_IRQHandler
mbed_official 207:05668db47a72 200 def_irq_default_handler RTC_IRQHandler
mbed_official 207:05668db47a72 201 def_irq_default_handler FLASH_IRQHandler
mbed_official 207:05668db47a72 202 def_irq_default_handler RCC_IRQHandler
mbed_official 207:05668db47a72 203 def_irq_default_handler EXTI0_IRQHandler
mbed_official 207:05668db47a72 204 def_irq_default_handler EXTI1_IRQHandler
mbed_official 207:05668db47a72 205 def_irq_default_handler EXTI2_IRQHandler
mbed_official 207:05668db47a72 206 def_irq_default_handler EXTI3_IRQHandler
mbed_official 207:05668db47a72 207 def_irq_default_handler EXTI4_IRQHandler
mbed_official 207:05668db47a72 208 def_irq_default_handler DMA1_Channel1_IRQHandler
mbed_official 207:05668db47a72 209 def_irq_default_handler DMA1_Channel2_IRQHandler
mbed_official 207:05668db47a72 210 def_irq_default_handler DMA1_Channel3_IRQHandler
mbed_official 207:05668db47a72 211 def_irq_default_handler DMA1_Channel4_IRQHandler
mbed_official 207:05668db47a72 212 def_irq_default_handler DMA1_Channel5_IRQHandler
mbed_official 207:05668db47a72 213 def_irq_default_handler DMA1_Channel6_IRQHandler
mbed_official 207:05668db47a72 214 def_irq_default_handler DMA1_Channel7_IRQHandler
mbed_official 207:05668db47a72 215
mbed_official 207:05668db47a72 216 def_irq_default_handler ADC1_2_IRQHandler
mbed_official 207:05668db47a72 217 def_irq_default_handler USB_HP_CAN1_TX_IRQHandler
mbed_official 207:05668db47a72 218 def_irq_default_handler USB_LP_CAN1_RX0_IRQHandler
mbed_official 207:05668db47a72 219 def_irq_default_handler CAN1_RX1_IRQHandler
mbed_official 207:05668db47a72 220 def_irq_default_handler CAN1_SCE_IRQHandler
mbed_official 207:05668db47a72 221 def_irq_default_handler EXTI9_5_IRQHandler
mbed_official 207:05668db47a72 222 def_irq_default_handler TIM1_BRK_IRQHandler
mbed_official 207:05668db47a72 223 def_irq_default_handler TIM1_UP_IRQHandler
mbed_official 207:05668db47a72 224 def_irq_default_handler TIM1_TRG_COM_IRQHandler
mbed_official 207:05668db47a72 225 def_irq_default_handler TIM1_CC_IRQHandler
mbed_official 207:05668db47a72 226 def_irq_default_handler TIM2_IRQHandler
mbed_official 207:05668db47a72 227 def_irq_default_handler TIM3_IRQHandler
mbed_official 207:05668db47a72 228 def_irq_default_handler TIM4_IRQHandler
mbed_official 207:05668db47a72 229 def_irq_default_handler I2C1_EV_IRQHandler
mbed_official 207:05668db47a72 230 def_irq_default_handler I2C1_ER_IRQHandler
mbed_official 207:05668db47a72 231 def_irq_default_handler I2C2_EV_IRQHandler
mbed_official 207:05668db47a72 232 def_irq_default_handler I2C2_ER_IRQHandler
mbed_official 207:05668db47a72 233 def_irq_default_handler SPI1_IRQHandler
mbed_official 207:05668db47a72 234 def_irq_default_handler SPI2_IRQHandler
mbed_official 207:05668db47a72 235 def_irq_default_handler USART1_IRQHandler
mbed_official 207:05668db47a72 236 def_irq_default_handler USART2_IRQHandler
mbed_official 207:05668db47a72 237 def_irq_default_handler USART3_IRQHandler
mbed_official 207:05668db47a72 238 def_irq_default_handler EXTI15_10_IRQHandler
mbed_official 207:05668db47a72 239 def_irq_default_handler RTCAlarm_IRQHandler
mbed_official 207:05668db47a72 240 def_irq_default_handler USBWakeUp_IRQHandler
mbed_official 207:05668db47a72 241
mbed_official 207:05668db47a72 242 .end
mbed_official 207:05668db47a72 243