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
Parent:
targets/cmsis/TARGET_NXP/TARGET_LPC82X/TARGET_LPC824/TOOLCHAIN_GCC_ARM/startup_LPC824.s@514:7668256dbe61
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 365:7ced7d9d5ffe 1 /* File: startup_ARMCM0.S
mbed_official 365:7ced7d9d5ffe 2 * Purpose: startup file for Cortex-M0 devices. Should use with
mbed_official 365:7ced7d9d5ffe 3 * GCC for ARM Embedded Processors
mbed_official 365:7ced7d9d5ffe 4 * Version: V1.2
mbed_official 365:7ced7d9d5ffe 5 * Date: 15 Nov 2011
mbed_official 365:7ced7d9d5ffe 6 *
mbed_official 365:7ced7d9d5ffe 7 * Copyright (c) 2011, ARM Limited
mbed_official 365:7ced7d9d5ffe 8 * All rights reserved.
mbed_official 365:7ced7d9d5ffe 9 *
mbed_official 365:7ced7d9d5ffe 10 * Redistribution and use in source and binary forms, with or without
mbed_official 365:7ced7d9d5ffe 11 * modification, are permitted provided that the following conditions are met:
mbed_official 365:7ced7d9d5ffe 12 * Redistributions of source code must retain the above copyright
mbed_official 365:7ced7d9d5ffe 13 notice, this list of conditions and the following disclaimer.
mbed_official 365:7ced7d9d5ffe 14 * Redistributions in binary form must reproduce the above copyright
mbed_official 365:7ced7d9d5ffe 15 notice, this list of conditions and the following disclaimer in the
mbed_official 365:7ced7d9d5ffe 16 documentation and/or other materials provided with the distribution.
mbed_official 365:7ced7d9d5ffe 17 * Neither the name of the ARM Limited nor the
mbed_official 365:7ced7d9d5ffe 18 names of its contributors may be used to endorse or promote products
mbed_official 365:7ced7d9d5ffe 19 derived from this software without specific prior written permission.
mbed_official 365:7ced7d9d5ffe 20 *
mbed_official 365:7ced7d9d5ffe 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 365:7ced7d9d5ffe 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 365:7ced7d9d5ffe 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 365:7ced7d9d5ffe 24 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED BE LIABLE FOR ANY
mbed_official 365:7ced7d9d5ffe 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 365:7ced7d9d5ffe 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 365:7ced7d9d5ffe 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
mbed_official 365:7ced7d9d5ffe 28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 365:7ced7d9d5ffe 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 365:7ced7d9d5ffe 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 365:7ced7d9d5ffe 31 */
mbed_official 365:7ced7d9d5ffe 32 .syntax unified
mbed_official 365:7ced7d9d5ffe 33 .arch armv6-m
mbed_official 365:7ced7d9d5ffe 34
mbed_official 365:7ced7d9d5ffe 35 /* Memory Model
mbed_official 365:7ced7d9d5ffe 36 The HEAP starts at the end of the DATA section and grows upward.
mbed_official 365:7ced7d9d5ffe 37
mbed_official 365:7ced7d9d5ffe 38 The STACK starts at the end of the RAM and grows downward.
mbed_official 365:7ced7d9d5ffe 39
mbed_official 365:7ced7d9d5ffe 40 The HEAP and stack STACK are only checked at compile time:
mbed_official 365:7ced7d9d5ffe 41 (DATA_SIZE + HEAP_SIZE + STACK_SIZE) < RAM_SIZE
mbed_official 365:7ced7d9d5ffe 42
mbed_official 365:7ced7d9d5ffe 43 This is just a check for the bare minimum for the Heap+Stack area before
mbed_official 365:7ced7d9d5ffe 44 aborting compilation, it is not the run time limit:
mbed_official 365:7ced7d9d5ffe 45 Heap_Size + Stack_Size = 0x80 + 0x80 = 0x100
mbed_official 365:7ced7d9d5ffe 46 */
mbed_official 365:7ced7d9d5ffe 47 .section .stack
mbed_official 365:7ced7d9d5ffe 48 .align 3
mbed_official 365:7ced7d9d5ffe 49 #ifdef __STACK_SIZE
mbed_official 365:7ced7d9d5ffe 50 .equ Stack_Size, __STACK_SIZE
mbed_official 365:7ced7d9d5ffe 51 #else
mbed_official 365:7ced7d9d5ffe 52 .equ Stack_Size, 0x80
mbed_official 365:7ced7d9d5ffe 53 #endif
mbed_official 365:7ced7d9d5ffe 54 .globl __StackTop
mbed_official 365:7ced7d9d5ffe 55 .globl __StackLimit
mbed_official 365:7ced7d9d5ffe 56 __StackLimit:
mbed_official 365:7ced7d9d5ffe 57 .space Stack_Size
mbed_official 365:7ced7d9d5ffe 58 .size __StackLimit, . - __StackLimit
mbed_official 365:7ced7d9d5ffe 59 __StackTop:
mbed_official 365:7ced7d9d5ffe 60 .size __StackTop, . - __StackTop
mbed_official 365:7ced7d9d5ffe 61
mbed_official 365:7ced7d9d5ffe 62 .section .heap
mbed_official 365:7ced7d9d5ffe 63 .align 3
mbed_official 365:7ced7d9d5ffe 64 #ifdef __HEAP_SIZE
mbed_official 365:7ced7d9d5ffe 65 .equ Heap_Size, __HEAP_SIZE
mbed_official 365:7ced7d9d5ffe 66 #else
mbed_official 365:7ced7d9d5ffe 67 .equ Heap_Size, 0x80
mbed_official 365:7ced7d9d5ffe 68 #endif
mbed_official 365:7ced7d9d5ffe 69 .globl __HeapBase
mbed_official 365:7ced7d9d5ffe 70 .globl __HeapLimit
mbed_official 365:7ced7d9d5ffe 71 __HeapBase:
mbed_official 365:7ced7d9d5ffe 72 .space Heap_Size
mbed_official 365:7ced7d9d5ffe 73 .size __HeapBase, . - __HeapBase
mbed_official 365:7ced7d9d5ffe 74 __HeapLimit:
mbed_official 365:7ced7d9d5ffe 75 .size __HeapLimit, . - __HeapLimit
mbed_official 365:7ced7d9d5ffe 76
mbed_official 365:7ced7d9d5ffe 77 .section .isr_vector
mbed_official 365:7ced7d9d5ffe 78 .align 2
mbed_official 365:7ced7d9d5ffe 79 .globl __isr_vector
mbed_official 365:7ced7d9d5ffe 80 __isr_vector:
mbed_official 365:7ced7d9d5ffe 81 .long __StackTop /* Top of Stack */
mbed_official 365:7ced7d9d5ffe 82 .long Reset_Handler /* Reset Handler */
mbed_official 365:7ced7d9d5ffe 83 .long NMI_Handler /* NMI Handler */
mbed_official 365:7ced7d9d5ffe 84 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 365:7ced7d9d5ffe 85 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 86 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 87 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 88 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 89 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 90 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 91 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 92 .long SVC_Handler /* SVCall Handler */
mbed_official 365:7ced7d9d5ffe 93 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 94 .long 0 /* Reserved */
mbed_official 365:7ced7d9d5ffe 95 .long PendSV_Handler /* PendSV Handler */
mbed_official 365:7ced7d9d5ffe 96 .long SysTick_Handler /* SysTick Handler */
mbed_official 365:7ced7d9d5ffe 97
mbed_official 365:7ced7d9d5ffe 98 /* LPC824 interrupts */
mbed_official 365:7ced7d9d5ffe 99 .long SPI0_IRQHandler // SPI0 controller
mbed_official 365:7ced7d9d5ffe 100 .long SPI1_IRQHandler // SPI1 controller
mbed_official 514:7668256dbe61 101 .long 0 // Reserved
mbed_official 365:7ced7d9d5ffe 102 .long UART0_IRQHandler // UART0
mbed_official 365:7ced7d9d5ffe 103 .long UART1_IRQHandler // UART1
mbed_official 365:7ced7d9d5ffe 104 .long UART2_IRQHandler // UART2
mbed_official 514:7668256dbe61 105 .long 0 // Reserved
mbed_official 514:7668256dbe61 106 .long I2C1_IRQHandler // I2C ch1 controller
mbed_official 514:7668256dbe61 107 .long I2C0_IRQHandler // I2C ch0 controller
mbed_official 365:7ced7d9d5ffe 108 .long SCT_IRQHandler // Smart Counter Timer
mbed_official 365:7ced7d9d5ffe 109 .long MRT_IRQHandler // Multi-Rate Timer
mbed_official 365:7ced7d9d5ffe 110 .long CMP_IRQHandler // Comparator
mbed_official 365:7ced7d9d5ffe 111 .long WDT_IRQHandler // PIO1 (0:11)
mbed_official 365:7ced7d9d5ffe 112 .long BOD_IRQHandler // Brown Out Detect
mbed_official 514:7668256dbe61 113 .long Flash_IRQHandler // Flash interrupt
mbed_official 365:7ced7d9d5ffe 114 .long WKT_IRQHandler // Wakeup timer
mbed_official 514:7668256dbe61 115 .long ADC_SEQA_IRQHandler // ADC sequence A completion
mbed_official 514:7668256dbe61 116 .long ADC_SEQB_IRQHandler // ADC sequence B completion
mbed_official 514:7668256dbe61 117 .long ADC_THCMP_IRQHandler // ADC threshold compare
mbed_official 514:7668256dbe61 118 .long ADC_OVR_IRQHandler // ADC overrun
mbed_official 514:7668256dbe61 119 .long DMA_IRQHandler // DMA interrupt
mbed_official 514:7668256dbe61 120 .long I2C2_IRQHandler // I2C2 controller
mbed_official 514:7668256dbe61 121 .long I2C3_IRQHandler // I2C3 controller
mbed_official 514:7668256dbe61 122 .long 0 // Reserved
mbed_official 365:7ced7d9d5ffe 123 .long PININT0_IRQHandler // PIO INT0
mbed_official 365:7ced7d9d5ffe 124 .long PININT1_IRQHandler // PIO INT1
mbed_official 365:7ced7d9d5ffe 125 .long PININT2_IRQHandler // PIO INT2
mbed_official 365:7ced7d9d5ffe 126 .long PININT3_IRQHandler // PIO INT3
mbed_official 365:7ced7d9d5ffe 127 .long PININT4_IRQHandler // PIO INT4
mbed_official 365:7ced7d9d5ffe 128 .long PININT5_IRQHandler // PIO INT5
mbed_official 365:7ced7d9d5ffe 129 .long PININT6_IRQHandler // PIO INT6
mbed_official 365:7ced7d9d5ffe 130 .long PININT7_IRQHandler // PIO INT7
mbed_official 365:7ced7d9d5ffe 131
mbed_official 365:7ced7d9d5ffe 132 .size __isr_vector, . - __isr_vector
mbed_official 365:7ced7d9d5ffe 133
mbed_official 365:7ced7d9d5ffe 134 .section .text.Reset_Handler
mbed_official 365:7ced7d9d5ffe 135 .thumb
mbed_official 365:7ced7d9d5ffe 136 .thumb_func
mbed_official 365:7ced7d9d5ffe 137 .align 2
mbed_official 365:7ced7d9d5ffe 138 .globl Reset_Handler
mbed_official 365:7ced7d9d5ffe 139 .type Reset_Handler, %function
mbed_official 365:7ced7d9d5ffe 140 Reset_Handler:
mbed_official 365:7ced7d9d5ffe 141 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 365:7ced7d9d5ffe 142 * of copy from/to are specified by following symbols evaluated in
mbed_official 365:7ced7d9d5ffe 143 * linker script.
mbed_official 365:7ced7d9d5ffe 144 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 365:7ced7d9d5ffe 145 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 365:7ced7d9d5ffe 146 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 365:7ced7d9d5ffe 147
mbed_official 365:7ced7d9d5ffe 148 ldr r1, =__etext
mbed_official 365:7ced7d9d5ffe 149 ldr r2, =__data_start__
mbed_official 365:7ced7d9d5ffe 150 ldr r3, =__data_end__
mbed_official 365:7ced7d9d5ffe 151
mbed_official 365:7ced7d9d5ffe 152 subs r3, r2
mbed_official 365:7ced7d9d5ffe 153 ble .Lflash_to_ram_loop_end
mbed_official 365:7ced7d9d5ffe 154
mbed_official 365:7ced7d9d5ffe 155 movs r4, 0
mbed_official 365:7ced7d9d5ffe 156 .Lflash_to_ram_loop:
mbed_official 365:7ced7d9d5ffe 157 ldr r0, [r1,r4]
mbed_official 365:7ced7d9d5ffe 158 str r0, [r2,r4]
mbed_official 365:7ced7d9d5ffe 159 adds r4, 4
mbed_official 365:7ced7d9d5ffe 160 cmp r4, r3
mbed_official 365:7ced7d9d5ffe 161 blt .Lflash_to_ram_loop
mbed_official 365:7ced7d9d5ffe 162 .Lflash_to_ram_loop_end:
mbed_official 365:7ced7d9d5ffe 163
mbed_official 365:7ced7d9d5ffe 164 ldr r0, =SystemInit
mbed_official 365:7ced7d9d5ffe 165 blx r0
mbed_official 365:7ced7d9d5ffe 166 ldr r0, =_start
mbed_official 365:7ced7d9d5ffe 167 bx r0
mbed_official 365:7ced7d9d5ffe 168 .pool
mbed_official 365:7ced7d9d5ffe 169 .size Reset_Handler, . - Reset_Handler
mbed_official 365:7ced7d9d5ffe 170
mbed_official 365:7ced7d9d5ffe 171 .text
mbed_official 365:7ced7d9d5ffe 172 /* Macro to define default handlers. Default handler
mbed_official 365:7ced7d9d5ffe 173 * will be weak symbol and just dead loops. They can be
mbed_official 365:7ced7d9d5ffe 174 * overwritten by other handlers */
mbed_official 365:7ced7d9d5ffe 175 .macro def_default_handler handler_name
mbed_official 365:7ced7d9d5ffe 176 .align 1
mbed_official 365:7ced7d9d5ffe 177 .thumb_func
mbed_official 365:7ced7d9d5ffe 178 .weak \handler_name
mbed_official 365:7ced7d9d5ffe 179 .type \handler_name, %function
mbed_official 365:7ced7d9d5ffe 180 \handler_name :
mbed_official 365:7ced7d9d5ffe 181 b .
mbed_official 365:7ced7d9d5ffe 182 .size \handler_name, . - \handler_name
mbed_official 365:7ced7d9d5ffe 183 .endm
mbed_official 365:7ced7d9d5ffe 184
mbed_official 365:7ced7d9d5ffe 185 def_default_handler NMI_Handler
mbed_official 365:7ced7d9d5ffe 186 def_default_handler HardFault_Handler
mbed_official 365:7ced7d9d5ffe 187 def_default_handler SVC_Handler
mbed_official 365:7ced7d9d5ffe 188 def_default_handler PendSV_Handler
mbed_official 365:7ced7d9d5ffe 189 def_default_handler SysTick_Handler
mbed_official 365:7ced7d9d5ffe 190 def_default_handler Default_Handler
mbed_official 365:7ced7d9d5ffe 191
mbed_official 365:7ced7d9d5ffe 192 .macro def_irq_default_handler handler_name
mbed_official 365:7ced7d9d5ffe 193 .weak \handler_name
mbed_official 365:7ced7d9d5ffe 194 .set \handler_name, Default_Handler
mbed_official 365:7ced7d9d5ffe 195 .endm
mbed_official 514:7668256dbe61 196
mbed_official 365:7ced7d9d5ffe 197 def_irq_default_handler SPI0_IRQHandler
mbed_official 365:7ced7d9d5ffe 198 def_irq_default_handler SPI1_IRQHandler
mbed_official 365:7ced7d9d5ffe 199 def_irq_default_handler UART0_IRQHandler
mbed_official 365:7ced7d9d5ffe 200 def_irq_default_handler UART1_IRQHandler
mbed_official 365:7ced7d9d5ffe 201 def_irq_default_handler UART2_IRQHandler
mbed_official 514:7668256dbe61 202 def_irq_default_handler I2C0_IRQHandler
mbed_official 514:7668256dbe61 203 def_irq_default_handler I2C1_IRQHandler
mbed_official 514:7668256dbe61 204 def_irq_default_handler I2C2_IRQHandler
mbed_official 514:7668256dbe61 205 def_irq_default_handler I2C3_IRQHandler
mbed_official 365:7ced7d9d5ffe 206 def_irq_default_handler SCT_IRQHandler
mbed_official 365:7ced7d9d5ffe 207 def_irq_default_handler MRT_IRQHandler
mbed_official 365:7ced7d9d5ffe 208 def_irq_default_handler CMP_IRQHandler
mbed_official 365:7ced7d9d5ffe 209 def_irq_default_handler WDT_IRQHandler
mbed_official 365:7ced7d9d5ffe 210 def_irq_default_handler BOD_IRQHandler
mbed_official 514:7668256dbe61 211 def_irq_default_handler Flash_IRQHandler
mbed_official 365:7ced7d9d5ffe 212 def_irq_default_handler WKT_IRQHandler
mbed_official 514:7668256dbe61 213 def_irq_default_handler ADC_SEQA_IRQHandler
mbed_official 514:7668256dbe61 214 def_irq_default_handler ADC_SEQB_IRQHandler
mbed_official 514:7668256dbe61 215 def_irq_default_handler ADC_THCMP_IRQHandler
mbed_official 514:7668256dbe61 216 def_irq_default_handler ADC_OVR_IRQHandler
mbed_official 514:7668256dbe61 217 def_irq_default_handler DMA_IRQHandler
mbed_official 365:7ced7d9d5ffe 218 def_irq_default_handler PININT0_IRQHandler
mbed_official 365:7ced7d9d5ffe 219 def_irq_default_handler PININT1_IRQHandler
mbed_official 365:7ced7d9d5ffe 220 def_irq_default_handler PININT2_IRQHandler
mbed_official 365:7ced7d9d5ffe 221 def_irq_default_handler PININT3_IRQHandler
mbed_official 365:7ced7d9d5ffe 222 def_irq_default_handler PININT4_IRQHandler
mbed_official 365:7ced7d9d5ffe 223 def_irq_default_handler PININT5_IRQHandler
mbed_official 365:7ced7d9d5ffe 224 def_irq_default_handler PININT6_IRQHandler
mbed_official 514:7668256dbe61 225 def_irq_default_handler PININT7_IRQHandler
mbed_official 365:7ced7d9d5ffe 226
mbed_official 365:7ced7d9d5ffe 227 .end
mbed_official 365:7ced7d9d5ffe 228