mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 08:15:11 2015 +0100
Revision:
577:15494b56c2f3
Synchronized with git revision 7766e75dd858812cd79aedb3080349715f55dd56

Full URL: https://github.com/mbedmicro/mbed/commit/7766e75dd858812cd79aedb3080349715f55dd56/

GCC asm updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 577:15494b56c2f3 1 /* File: startup_ARMCM3.s
mbed_official 577:15494b56c2f3 2 * Purpose: startup file for Cortex-M3/M4 devices. Should use with
mbed_official 577:15494b56c2f3 3 * GNU Tools for ARM Embedded Processors
mbed_official 577:15494b56c2f3 4 * Version: V1.1
mbed_official 577:15494b56c2f3 5 * Date: 17 June 2011
mbed_official 577:15494b56c2f3 6 *
mbed_official 577:15494b56c2f3 7 * Copyright (C) 2011 ARM Limited. All rights reserved.
mbed_official 577:15494b56c2f3 8 * ARM Limited (ARM) is supplying this software for use with Cortex-M3/M4
mbed_official 577:15494b56c2f3 9 * processor based microcontrollers. This file can be freely distributed
mbed_official 577:15494b56c2f3 10 * within development tools that are supporting such ARM based processors.
mbed_official 577:15494b56c2f3 11 *
mbed_official 577:15494b56c2f3 12 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
mbed_official 577:15494b56c2f3 13 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
mbed_official 577:15494b56c2f3 14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
mbed_official 577:15494b56c2f3 15 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
mbed_official 577:15494b56c2f3 16 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
mbed_official 577:15494b56c2f3 17 */
mbed_official 577:15494b56c2f3 18 .syntax unified
mbed_official 577:15494b56c2f3 19 .arch armv7-m
mbed_official 577:15494b56c2f3 20
mbed_official 577:15494b56c2f3 21 /* Memory Model
mbed_official 577:15494b56c2f3 22 The HEAP starts at the end of the DATA section and grows upward.
mbed_official 577:15494b56c2f3 23
mbed_official 577:15494b56c2f3 24 The STACK starts at the end of the RAM and grows downward.
mbed_official 577:15494b56c2f3 25
mbed_official 577:15494b56c2f3 26 The HEAP and stack STACK are only checked at compile time:
mbed_official 577:15494b56c2f3 27 (DATA_SIZE + HEAP_SIZE + STACK_SIZE) < RAM_SIZE
mbed_official 577:15494b56c2f3 28
mbed_official 577:15494b56c2f3 29 This is just a check for the bare minimum for the Heap+Stack area before
mbed_official 577:15494b56c2f3 30 aborting compilation, it is not the run time limit:
mbed_official 577:15494b56c2f3 31 Heap_Size + Stack_Size = 0x80 + 0x80 = 0x100
mbed_official 577:15494b56c2f3 32 */
mbed_official 577:15494b56c2f3 33 .section .stack
mbed_official 577:15494b56c2f3 34 .align 3
mbed_official 577:15494b56c2f3 35 #ifdef __STACK_SIZE
mbed_official 577:15494b56c2f3 36 .equ Stack_Size, __STACK_SIZE
mbed_official 577:15494b56c2f3 37 #else
mbed_official 577:15494b56c2f3 38 .equ Stack_Size, 0xc00
mbed_official 577:15494b56c2f3 39 #endif
mbed_official 577:15494b56c2f3 40 .globl __StackTop
mbed_official 577:15494b56c2f3 41 .globl __StackLimit
mbed_official 577:15494b56c2f3 42 __StackLimit:
mbed_official 577:15494b56c2f3 43 .space Stack_Size
mbed_official 577:15494b56c2f3 44 .size __StackLimit, . - __StackLimit
mbed_official 577:15494b56c2f3 45 __StackTop:
mbed_official 577:15494b56c2f3 46 .size __StackTop, . - __StackTop
mbed_official 577:15494b56c2f3 47
mbed_official 577:15494b56c2f3 48 .section .heap
mbed_official 577:15494b56c2f3 49 .align 3
mbed_official 577:15494b56c2f3 50 #ifdef __HEAP_SIZE
mbed_official 577:15494b56c2f3 51 .equ Heap_Size, __HEAP_SIZE
mbed_official 577:15494b56c2f3 52 #else
mbed_official 577:15494b56c2f3 53 .equ Heap_Size, 0x800
mbed_official 577:15494b56c2f3 54 #endif
mbed_official 577:15494b56c2f3 55 .globl __HeapBase
mbed_official 577:15494b56c2f3 56 .globl __HeapLimit
mbed_official 577:15494b56c2f3 57 __HeapBase:
mbed_official 577:15494b56c2f3 58 .space Heap_Size
mbed_official 577:15494b56c2f3 59 .size __HeapBase, . - __HeapBase
mbed_official 577:15494b56c2f3 60 __HeapLimit:
mbed_official 577:15494b56c2f3 61 .size __HeapLimit, . - __HeapLimit
mbed_official 577:15494b56c2f3 62
mbed_official 577:15494b56c2f3 63 .section .isr_vector
mbed_official 577:15494b56c2f3 64 .align 2
mbed_official 577:15494b56c2f3 65 .globl __isr_vector
mbed_official 577:15494b56c2f3 66 __isr_vector:
mbed_official 577:15494b56c2f3 67 .long __StackTop /* Top of Stack */
mbed_official 577:15494b56c2f3 68 .long Reset_Handler /* Reset Handler */
mbed_official 577:15494b56c2f3 69 .long NMI_Handler /* NMI Handler */
mbed_official 577:15494b56c2f3 70 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 577:15494b56c2f3 71 .long MemManage_Handler /* MPU Fault Handler */
mbed_official 577:15494b56c2f3 72 .long BusFault_Handler /* Bus Fault Handler */
mbed_official 577:15494b56c2f3 73 .long UsageFault_Handler /* Usage Fault Handler */
mbed_official 577:15494b56c2f3 74 .long 0 /* Reserved */
mbed_official 577:15494b56c2f3 75 .long 0 /* Reserved */
mbed_official 577:15494b56c2f3 76 .long 0 /* Reserved */
mbed_official 577:15494b56c2f3 77 .long 0 /* Reserved */
mbed_official 577:15494b56c2f3 78 .long SVC_Handler /* SVCall Handler */
mbed_official 577:15494b56c2f3 79 .long DebugMon_Handler /* Debug Monitor Handler */
mbed_official 577:15494b56c2f3 80 .long 0 /* Reserved */
mbed_official 577:15494b56c2f3 81 .long PendSV_Handler /* PendSV Handler */
mbed_official 577:15494b56c2f3 82 .long SysTick_Handler /* SysTick Handler */
mbed_official 577:15494b56c2f3 83
mbed_official 577:15494b56c2f3 84
mbed_official 577:15494b56c2f3 85 .long PIN_INT0_Handler /* All GPIO pin can be routed to PIN_INTx */
mbed_official 577:15494b56c2f3 86 .long PIN_INT1_Handler
mbed_official 577:15494b56c2f3 87 .long PIN_INT2_Handler
mbed_official 577:15494b56c2f3 88 .long PIN_INT3_Handler
mbed_official 577:15494b56c2f3 89 .long PIN_INT4_Handler
mbed_official 577:15494b56c2f3 90 .long PIN_INT5_Handler
mbed_official 577:15494b56c2f3 91 .long PIN_INT6_Handler
mbed_official 577:15494b56c2f3 92 .long PIN_INT7_Handler
mbed_official 577:15494b56c2f3 93 .long GINT0_Handler
mbed_official 577:15494b56c2f3 94 .long GINT1_Handler /* PIO0 (0:7) */
mbed_official 577:15494b56c2f3 95 .long 0
mbed_official 577:15494b56c2f3 96 .long 0
mbed_official 577:15494b56c2f3 97 .long OSTIMER_Handler
mbed_official 577:15494b56c2f3 98 .long 0
mbed_official 577:15494b56c2f3 99 .long SSP1_Handler /* SSP1 */
mbed_official 577:15494b56c2f3 100 .long I2C_Handler /* I2C */
mbed_official 577:15494b56c2f3 101 .long CT16B0_Handler /* 16-bit Timer0 */
mbed_official 577:15494b56c2f3 102 .long CT16B1_Handler /* 16-bit Timer1 */
mbed_official 577:15494b56c2f3 103 .long CT32B0_Handler /* 32-bit Timer0 */
mbed_official 577:15494b56c2f3 104 .long CT32B1_Handler /* 32-bit Timer1 */
mbed_official 577:15494b56c2f3 105 .long SSP0_Handler /* SSP0 */
mbed_official 577:15494b56c2f3 106 .long USART_Handler /* USART */
mbed_official 577:15494b56c2f3 107 .long USB_Handler /* USB IRQ */
mbed_official 577:15494b56c2f3 108 .long USB_FIQHandler /* USB FIQ */
mbed_official 577:15494b56c2f3 109 .long ADC_Handler /* A/D Converter */
mbed_official 577:15494b56c2f3 110 .long WDT_Handler /* Watchdog timer */
mbed_official 577:15494b56c2f3 111 .long BOD_Handler /* Brown Out Detect */
mbed_official 577:15494b56c2f3 112 .long FMC_Handler /* IP2111 Flash Memory Controller */
mbed_official 577:15494b56c2f3 113 .long OSCFAIL_Handler /* OSC FAIL */
mbed_official 577:15494b56c2f3 114 .long PVTCIRCUIT_Handler /* PVT CIRCUIT */
mbed_official 577:15494b56c2f3 115 .long USBWakeup_Handler /* USB wake up */
mbed_official 577:15494b56c2f3 116 .long 0
mbed_official 577:15494b56c2f3 117
mbed_official 577:15494b56c2f3 118 .size __isr_vector, . - __isr_vector
mbed_official 577:15494b56c2f3 119
mbed_official 577:15494b56c2f3 120 .text
mbed_official 577:15494b56c2f3 121 .thumb
mbed_official 577:15494b56c2f3 122 .thumb_func
mbed_official 577:15494b56c2f3 123 .align 2
mbed_official 577:15494b56c2f3 124 .globl Reset_Handler
mbed_official 577:15494b56c2f3 125 .type Reset_Handler, %function
mbed_official 577:15494b56c2f3 126 Reset_Handler:
mbed_official 577:15494b56c2f3 127 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 577:15494b56c2f3 128 * of copy from/to are specified by following symbols evaluated in
mbed_official 577:15494b56c2f3 129 * linker script.
mbed_official 577:15494b56c2f3 130 * _etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 577:15494b56c2f3 131 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 577:15494b56c2f3 132 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 577:15494b56c2f3 133
mbed_official 577:15494b56c2f3 134 ldr r1, =__etext
mbed_official 577:15494b56c2f3 135 ldr r2, =__data_start__
mbed_official 577:15494b56c2f3 136 ldr r3, =__data_end__
mbed_official 577:15494b56c2f3 137
mbed_official 577:15494b56c2f3 138 .Lflash_to_ram_loop:
mbed_official 577:15494b56c2f3 139 cmp r2, r3
mbed_official 577:15494b56c2f3 140 ittt lt
mbed_official 577:15494b56c2f3 141 ldrlt r0, [r1], #4
mbed_official 577:15494b56c2f3 142 strlt r0, [r2], #4
mbed_official 577:15494b56c2f3 143 blt .Lflash_to_ram_loop
mbed_official 577:15494b56c2f3 144
mbed_official 577:15494b56c2f3 145 ldr r0, =SystemInit
mbed_official 577:15494b56c2f3 146 blx r0
mbed_official 577:15494b56c2f3 147 ldr r0, =_start
mbed_official 577:15494b56c2f3 148 bx r0
mbed_official 577:15494b56c2f3 149 .pool
mbed_official 577:15494b56c2f3 150 .size Reset_Handler, . - Reset_Handler
mbed_official 577:15494b56c2f3 151
mbed_official 577:15494b56c2f3 152 .text
mbed_official 577:15494b56c2f3 153 /* Macro to define default handlers. Default handler
mbed_official 577:15494b56c2f3 154 * will be weak symbol and just dead loops. They can be
mbed_official 577:15494b56c2f3 155 * overwritten by other handlers */
mbed_official 577:15494b56c2f3 156 .macro def_default_handler handler_name
mbed_official 577:15494b56c2f3 157 .align 1
mbed_official 577:15494b56c2f3 158 .thumb_func
mbed_official 577:15494b56c2f3 159 .weak \handler_name
mbed_official 577:15494b56c2f3 160 .type \handler_name, %function
mbed_official 577:15494b56c2f3 161 \handler_name :
mbed_official 577:15494b56c2f3 162 b .
mbed_official 577:15494b56c2f3 163 .size \handler_name, . - \handler_name
mbed_official 577:15494b56c2f3 164 .endm
mbed_official 577:15494b56c2f3 165
mbed_official 577:15494b56c2f3 166 def_default_handler NMI_Handler
mbed_official 577:15494b56c2f3 167 def_default_handler HardFault_Handler
mbed_official 577:15494b56c2f3 168 def_default_handler MemManage_Handler
mbed_official 577:15494b56c2f3 169 def_default_handler BusFault_Handler
mbed_official 577:15494b56c2f3 170 def_default_handler UsageFault_Handler
mbed_official 577:15494b56c2f3 171 def_default_handler SVC_Handler
mbed_official 577:15494b56c2f3 172 def_default_handler DebugMon_Handler
mbed_official 577:15494b56c2f3 173 def_default_handler PendSV_Handler
mbed_official 577:15494b56c2f3 174 def_default_handler SysTick_Handler
mbed_official 577:15494b56c2f3 175 def_default_handler Default_Handler
mbed_official 577:15494b56c2f3 176
mbed_official 577:15494b56c2f3 177 .macro def_irq_default_handler handler_name
mbed_official 577:15494b56c2f3 178 .weak \handler_name
mbed_official 577:15494b56c2f3 179 .set \handler_name, Default_Handler
mbed_official 577:15494b56c2f3 180 .endm
mbed_official 577:15494b56c2f3 181
mbed_official 577:15494b56c2f3 182 def_irq_default_handler PIN_INT0_Handler
mbed_official 577:15494b56c2f3 183 def_irq_default_handler PIN_INT1_Handler
mbed_official 577:15494b56c2f3 184 def_irq_default_handler PIN_INT2_Handler
mbed_official 577:15494b56c2f3 185 def_irq_default_handler PIN_INT3_Handler
mbed_official 577:15494b56c2f3 186 def_irq_default_handler PIN_INT4_Handler
mbed_official 577:15494b56c2f3 187 def_irq_default_handler PIN_INT5_Handler
mbed_official 577:15494b56c2f3 188 def_irq_default_handler PIN_INT6_Handler
mbed_official 577:15494b56c2f3 189 def_irq_default_handler PIN_INT7_Handler
mbed_official 577:15494b56c2f3 190 def_irq_default_handler GINT0_Handler
mbed_official 577:15494b56c2f3 191 def_irq_default_handler GINT1_Handler
mbed_official 577:15494b56c2f3 192 def_irq_default_handler OSTIMER_Handler
mbed_official 577:15494b56c2f3 193 def_irq_default_handler SSP1_Handler
mbed_official 577:15494b56c2f3 194 def_irq_default_handler I2C_Handler
mbed_official 577:15494b56c2f3 195 def_irq_default_handler CT16B0_Handler
mbed_official 577:15494b56c2f3 196 def_irq_default_handler CT16B1_Handler
mbed_official 577:15494b56c2f3 197 def_irq_default_handler CT32B0_Handler
mbed_official 577:15494b56c2f3 198 def_irq_default_handler CT32B1_Handler
mbed_official 577:15494b56c2f3 199 def_irq_default_handler SSP0_Handler
mbed_official 577:15494b56c2f3 200 def_irq_default_handler USART_Handler
mbed_official 577:15494b56c2f3 201 def_irq_default_handler USB_Handler
mbed_official 577:15494b56c2f3 202 def_irq_default_handler USB_FIQHandler
mbed_official 577:15494b56c2f3 203 def_irq_default_handler ADC_Handler
mbed_official 577:15494b56c2f3 204 def_irq_default_handler WDT_Handler
mbed_official 577:15494b56c2f3 205 def_irq_default_handler BOD_Handler
mbed_official 577:15494b56c2f3 206 def_irq_default_handler FMC_Handler
mbed_official 577:15494b56c2f3 207 def_irq_default_handler OSCFAIL_Handler
mbed_official 577:15494b56c2f3 208 def_irq_default_handler PVTCIRCUIT_Handler
mbed_official 577:15494b56c2f3 209 def_irq_default_handler USBWakeup_Handler
mbed_official 577:15494b56c2f3 210 def_irq_default_handler DEF_IRQHandler
mbed_official 577:15494b56c2f3 211
mbed_official 577:15494b56c2f3 212 .end
mbed_official 577:15494b56c2f3 213