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_Freescale/TARGET_K20XX/TARGET_K20D50M/TOOLCHAIN_GCC_ARM/startup_MK20D5.s@523:d25d72bcc348
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 445:3312ed629f01 1 /* File: startup_MK20D5.s
mbed_official 445:3312ed629f01 2 * Purpose: startup file for Cortex-M4 devices. Should use with
mbed_official 445:3312ed629f01 3 * GCC for ARM Embedded Processors
mbed_official 445:3312ed629f01 4 * Version: V1.3
mbed_official 445:3312ed629f01 5 * Date: 08 Feb 2012
mbed_official 445:3312ed629f01 6 *
mbed_official 445:3312ed629f01 7 * Copyright (c) 2015, ARM Limited
mbed_official 445:3312ed629f01 8 * All rights reserved.
mbed_official 445:3312ed629f01 9 *
mbed_official 445:3312ed629f01 10 * Redistribution and use in source and binary forms, with or without
mbed_official 445:3312ed629f01 11 * modification, are permitted provided that the following conditions are met:
mbed_official 445:3312ed629f01 12 * Redistributions of source code must retain the above copyright
mbed_official 445:3312ed629f01 13 notice, this list of conditions and the following disclaimer.
mbed_official 445:3312ed629f01 14 * Redistributions in binary form must reproduce the above copyright
mbed_official 445:3312ed629f01 15 notice, this list of conditions and the following disclaimer in the
mbed_official 445:3312ed629f01 16 documentation and/or other materials provided with the distribution.
mbed_official 445:3312ed629f01 17 * Neither the name of the ARM Limited nor the
mbed_official 445:3312ed629f01 18 names of its contributors may be used to endorse or promote products
mbed_official 445:3312ed629f01 19 derived from this software without specific prior written permission.
mbed_official 445:3312ed629f01 20 *
mbed_official 445:3312ed629f01 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 445:3312ed629f01 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 445:3312ed629f01 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 445:3312ed629f01 24 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED BE LIABLE FOR ANY
mbed_official 445:3312ed629f01 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 445:3312ed629f01 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 445:3312ed629f01 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
mbed_official 445:3312ed629f01 28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 445:3312ed629f01 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 445:3312ed629f01 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 445:3312ed629f01 31 */
mbed_official 445:3312ed629f01 32 .syntax unified
mbed_official 445:3312ed629f01 33 .arch armv7-m
mbed_official 445:3312ed629f01 34
mbed_official 445:3312ed629f01 35 .section .stack
mbed_official 445:3312ed629f01 36 .align 3
mbed_official 445:3312ed629f01 37 #ifdef __STACK_SIZE
mbed_official 445:3312ed629f01 38 .equ Stack_Size, __STACK_SIZE
mbed_official 445:3312ed629f01 39 #else
mbed_official 445:3312ed629f01 40 .equ Stack_Size, 0x400
mbed_official 445:3312ed629f01 41 #endif
mbed_official 445:3312ed629f01 42 .globl __StackTop
mbed_official 445:3312ed629f01 43 .globl __StackLimit
mbed_official 445:3312ed629f01 44 __StackLimit:
mbed_official 445:3312ed629f01 45 .space Stack_Size
mbed_official 445:3312ed629f01 46 .size __StackLimit, . - __StackLimit
mbed_official 445:3312ed629f01 47 __StackTop:
mbed_official 445:3312ed629f01 48 .size __StackTop, . - __StackTop
mbed_official 445:3312ed629f01 49
mbed_official 445:3312ed629f01 50 .section .heap
mbed_official 445:3312ed629f01 51 .align 3
mbed_official 445:3312ed629f01 52 #ifdef __HEAP_SIZE
mbed_official 445:3312ed629f01 53 .equ Heap_Size, __HEAP_SIZE
mbed_official 445:3312ed629f01 54 #else
mbed_official 445:3312ed629f01 55 .equ Heap_Size, 0xC00
mbed_official 445:3312ed629f01 56 #endif
mbed_official 445:3312ed629f01 57 .globl __HeapBase
mbed_official 445:3312ed629f01 58 .globl __HeapLimit
mbed_official 445:3312ed629f01 59 __HeapBase:
mbed_official 445:3312ed629f01 60 .if Heap_Size
mbed_official 445:3312ed629f01 61 .space Heap_Size
mbed_official 445:3312ed629f01 62 .endif
mbed_official 445:3312ed629f01 63 .size __HeapBase, . - __HeapBase
mbed_official 445:3312ed629f01 64 __HeapLimit:
mbed_official 445:3312ed629f01 65 .size __HeapLimit, . - __HeapLimit
mbed_official 445:3312ed629f01 66
mbed_official 445:3312ed629f01 67 .section .isr_vector
mbed_official 445:3312ed629f01 68 .align 2
mbed_official 445:3312ed629f01 69 .globl __isr_vector
mbed_official 445:3312ed629f01 70 __isr_vector:
mbed_official 445:3312ed629f01 71 .long __StackTop /* Top of Stack */
mbed_official 445:3312ed629f01 72 .long Reset_Handler /* Reset Handler */
mbed_official 445:3312ed629f01 73 .long NMI_Handler /* NMI Handler */
mbed_official 445:3312ed629f01 74 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 445:3312ed629f01 75 .long MemManage_Handler /* MPU Fault Handler */
mbed_official 445:3312ed629f01 76 .long BusFault_Handler /* Bus Fault Handler */
mbed_official 445:3312ed629f01 77 .long UsageFault_Handler /* Usage Fault Handler */
mbed_official 445:3312ed629f01 78 .long 0 /* Reserved */
mbed_official 445:3312ed629f01 79 .long 0 /* Reserved */
mbed_official 445:3312ed629f01 80 .long 0 /* Reserved */
mbed_official 445:3312ed629f01 81 .long 0 /* Reserved */
mbed_official 445:3312ed629f01 82 .long SVC_Handler /* SVCall Handler */
mbed_official 445:3312ed629f01 83 .long DebugMon_Handler /* Debug Monitor Handler */
mbed_official 445:3312ed629f01 84 .long 0 /* Reserved */
mbed_official 445:3312ed629f01 85 .long PendSV_Handler /* PendSV Handler */
mbed_official 445:3312ed629f01 86 .long SysTick_Handler /* SysTick Handler */
mbed_official 445:3312ed629f01 87
mbed_official 445:3312ed629f01 88 /* External interrupts */
mbed_official 445:3312ed629f01 89 .long DMA0_IRQHandler /* 0: Watchdog Timer */
mbed_official 445:3312ed629f01 90 .long DMA1_IRQHandler /* 1: Real Time Clock */
mbed_official 445:3312ed629f01 91 .long DMA2_IRQHandler /* 2: Timer0 / Timer1 */
mbed_official 445:3312ed629f01 92 .long DMA3_IRQHandler /* 3: Timer2 / Timer3 */
mbed_official 445:3312ed629f01 93 .long DMA_Error_IRQHandler /* 4: MCIa */
mbed_official 445:3312ed629f01 94 .long 0 /* 5: MCIb */
mbed_official 445:3312ed629f01 95 .long FTFL_IRQHandler /* 6: UART0 - DUT FPGA */
mbed_official 445:3312ed629f01 96 .long Read_Collision_IRQHandler /* 7: UART1 - DUT FPGA */
mbed_official 445:3312ed629f01 97 .long LVD_LVW_IRQHandler /* 8: UART2 - DUT FPGA */
mbed_official 445:3312ed629f01 98 .long LLW_IRQHandler /* 9: UART4 - not connected */
mbed_official 445:3312ed629f01 99 .long Watchdog_IRQHandler /* 10: AACI / AC97 */
mbed_official 445:3312ed629f01 100 .long I2C0_IRQHandler /* 11: CLCD Combined Interrupt */
mbed_official 445:3312ed629f01 101 .long SPI0_IRQHandler /* 12: Ethernet */
mbed_official 445:3312ed629f01 102 .long I2S0_Tx_IRQHandler /* 13: USB Device */
mbed_official 445:3312ed629f01 103 .long I2S0_Rx_IRQHandler /* 14: USB Host Controller */
mbed_official 445:3312ed629f01 104 .long UART0_LON_IRQHandler /* 15: Character LCD */
mbed_official 445:3312ed629f01 105 .long UART0_RX_TX_IRQHandler /* 16: Flexray */
mbed_official 445:3312ed629f01 106 .long UART0_ERR_IRQHandler /* 17: CAN */
mbed_official 445:3312ed629f01 107 .long UART1_RX_TX_IRQHandler /* 18: LIN */
mbed_official 445:3312ed629f01 108 .long UART1_ERR_IRQHandler /* 19: I2C ADC/DAC */
mbed_official 445:3312ed629f01 109 .long UART2_RX_TX_IRQHandler /* 20: Reserved */
mbed_official 445:3312ed629f01 110 .long UART2_ERR_IRQHandler /* 21: Reserved */
mbed_official 445:3312ed629f01 111 .long ADC0_IRQHandler /* 22: Reserved */
mbed_official 445:3312ed629f01 112 .long CMP0_IRQHandler /* 23: Reserved */
mbed_official 445:3312ed629f01 113 .long CMP1_IRQHandler /* 24: Reserved */
mbed_official 445:3312ed629f01 114 .long FTM0_IRQHandler /* 25: Reserved */
mbed_official 445:3312ed629f01 115 .long FTM1_IRQHandler /* 26: Reserved */
mbed_official 445:3312ed629f01 116 .long CMT_IRQHandler /* 27: Reserved */
mbed_official 445:3312ed629f01 117 .long RTC_IRQHandler /* 28: Reserved - CPU FPGA CLCD */
mbed_official 445:3312ed629f01 118 .long RTC_Seconds_IRQHandler /* 29: Reserved - CPU FPGA */
mbed_official 445:3312ed629f01 119 .long PIT0_IRQHandler /* 30: UART3 - CPU FPGA */
mbed_official 445:3312ed629f01 120 .long PIT1_IRQHandler /* 31: SPI Touchscreen - CPU FPGA */
mbed_official 445:3312ed629f01 121 .long PIT2_IRQHandler
mbed_official 445:3312ed629f01 122 .long PIT3_IRQHandler
mbed_official 445:3312ed629f01 123 .long PDB0_IRQHandler
mbed_official 445:3312ed629f01 124 .long USB0_IRQHandler
mbed_official 445:3312ed629f01 125 .long USBDCD_IRQHandler
mbed_official 445:3312ed629f01 126 .long TSI0_IRQHandler
mbed_official 445:3312ed629f01 127 .long MCG_IRQHandler
mbed_official 445:3312ed629f01 128 .long LPTimer_IRQHandler
mbed_official 445:3312ed629f01 129 .long PORTA_IRQHandler
mbed_official 445:3312ed629f01 130 .long PORTB_IRQHandler
mbed_official 445:3312ed629f01 131 .long PORTC_IRQHandler
mbed_official 445:3312ed629f01 132 .long PORTD_IRQHandler
mbed_official 445:3312ed629f01 133 .long PORTE_IRQHandler
mbed_official 445:3312ed629f01 134 .long SWI_IRQHandler
mbed_official 445:3312ed629f01 135 .size __isr_vector, . - __isr_vector
mbed_official 445:3312ed629f01 136
mbed_official 445:3312ed629f01 137 .section .text.Reset_Handler
mbed_official 445:3312ed629f01 138 .thumb
mbed_official 445:3312ed629f01 139 .thumb_func
mbed_official 445:3312ed629f01 140 .align 2
mbed_official 445:3312ed629f01 141 .globl Reset_Handler
mbed_official 445:3312ed629f01 142 .type Reset_Handler, %function
mbed_official 445:3312ed629f01 143 Reset_Handler:
mbed_official 445:3312ed629f01 144 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 445:3312ed629f01 145 * of copy from/to are specified by following symbols evaluated in
mbed_official 445:3312ed629f01 146 * linker script.
mbed_official 445:3312ed629f01 147 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 445:3312ed629f01 148 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 445:3312ed629f01 149 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 445:3312ed629f01 150
mbed_official 445:3312ed629f01 151 ldr r1, =__etext
mbed_official 445:3312ed629f01 152 ldr r2, =__data_start__
mbed_official 445:3312ed629f01 153 ldr r3, =__data_end__
mbed_official 445:3312ed629f01 154
mbed_official 445:3312ed629f01 155 .Lflash_to_ram_loop:
mbed_official 445:3312ed629f01 156 cmp r2, r3
mbed_official 445:3312ed629f01 157 ittt lt
mbed_official 445:3312ed629f01 158 ldrlt r0, [r1], #4
mbed_official 445:3312ed629f01 159 strlt r0, [r2], #4
mbed_official 445:3312ed629f01 160 blt .Lflash_to_ram_loop
mbed_official 445:3312ed629f01 161
mbed_official 445:3312ed629f01 162 .Lflash_to_ram_loop_end:
mbed_official 445:3312ed629f01 163
mbed_official 445:3312ed629f01 164 ldr r0, =SystemInit
mbed_official 445:3312ed629f01 165 blx r0
mbed_official 445:3312ed629f01 166 ldr r0, =_start
mbed_official 445:3312ed629f01 167 bx r0
mbed_official 445:3312ed629f01 168 .pool
mbed_official 445:3312ed629f01 169 .size Reset_Handler, . - Reset_Handler
mbed_official 445:3312ed629f01 170
mbed_official 445:3312ed629f01 171 .text
mbed_official 445:3312ed629f01 172 /* Macro to define default handlers. Default handler
mbed_official 445:3312ed629f01 173 * will be weak symbol and just dead loops. They can be
mbed_official 445:3312ed629f01 174 * overwritten by other handlers */
mbed_official 445:3312ed629f01 175 .macro def_default_handler handler_name
mbed_official 445:3312ed629f01 176 .align 1
mbed_official 445:3312ed629f01 177 .thumb_func
mbed_official 445:3312ed629f01 178 .weak \handler_name
mbed_official 445:3312ed629f01 179 .type \handler_name, %function
mbed_official 445:3312ed629f01 180 \handler_name :
mbed_official 445:3312ed629f01 181 b .
mbed_official 445:3312ed629f01 182 .size \handler_name, . - \handler_name
mbed_official 445:3312ed629f01 183 .endm
mbed_official 445:3312ed629f01 184
mbed_official 445:3312ed629f01 185 def_default_handler NMI_Handler
mbed_official 445:3312ed629f01 186 def_default_handler HardFault_Handler
mbed_official 445:3312ed629f01 187 def_default_handler MemManage_Handler
mbed_official 445:3312ed629f01 188 def_default_handler BusFault_Handler
mbed_official 445:3312ed629f01 189 def_default_handler UsageFault_Handler
mbed_official 445:3312ed629f01 190 def_default_handler SVC_Handler
mbed_official 445:3312ed629f01 191 def_default_handler DebugMon_Handler
mbed_official 445:3312ed629f01 192 def_default_handler PendSV_Handler
mbed_official 445:3312ed629f01 193 def_default_handler SysTick_Handler
mbed_official 445:3312ed629f01 194 def_default_handler Default_Handler
mbed_official 445:3312ed629f01 195
mbed_official 445:3312ed629f01 196 .macro def_irq_default_handler handler_name
mbed_official 445:3312ed629f01 197 .weak \handler_name
mbed_official 445:3312ed629f01 198 .set \handler_name, Default_Handler
mbed_official 445:3312ed629f01 199 .endm
mbed_official 445:3312ed629f01 200
mbed_official 445:3312ed629f01 201 def_irq_default_handler DMA0_IRQHandler
mbed_official 445:3312ed629f01 202 def_irq_default_handler DMA1_IRQHandler
mbed_official 445:3312ed629f01 203 def_irq_default_handler DMA2_IRQHandler
mbed_official 445:3312ed629f01 204 def_irq_default_handler DMA3_IRQHandler
mbed_official 445:3312ed629f01 205 def_irq_default_handler DMA_Error_IRQHandler
mbed_official 445:3312ed629f01 206 def_irq_default_handler FTFL_IRQHandler
mbed_official 445:3312ed629f01 207 def_irq_default_handler Read_Collision_IRQHandler
mbed_official 445:3312ed629f01 208 def_irq_default_handler LVD_LVW_IRQHandler
mbed_official 445:3312ed629f01 209 def_irq_default_handler LLW_IRQHandler
mbed_official 445:3312ed629f01 210 def_irq_default_handler Watchdog_IRQHandler
mbed_official 445:3312ed629f01 211 def_irq_default_handler I2C0_IRQHandler
mbed_official 445:3312ed629f01 212 def_irq_default_handler SPI0_IRQHandler
mbed_official 445:3312ed629f01 213 def_irq_default_handler I2S0_Tx_IRQHandler
mbed_official 445:3312ed629f01 214 def_irq_default_handler I2S0_Rx_IRQHandler
mbed_official 445:3312ed629f01 215 def_irq_default_handler UART0_LON_IRQHandler
mbed_official 445:3312ed629f01 216 def_irq_default_handler UART0_RX_TX_IRQHandler
mbed_official 445:3312ed629f01 217 def_irq_default_handler UART0_ERR_IRQHandler
mbed_official 445:3312ed629f01 218 def_irq_default_handler UART1_RX_TX_IRQHandler
mbed_official 445:3312ed629f01 219 def_irq_default_handler UART1_ERR_IRQHandler
mbed_official 445:3312ed629f01 220 def_irq_default_handler UART2_RX_TX_IRQHandler
mbed_official 445:3312ed629f01 221 def_irq_default_handler UART2_ERR_IRQHandler
mbed_official 445:3312ed629f01 222 def_irq_default_handler ADC0_IRQHandler
mbed_official 445:3312ed629f01 223 def_irq_default_handler CMP0_IRQHandler
mbed_official 445:3312ed629f01 224 def_irq_default_handler CMP1_IRQHandler
mbed_official 445:3312ed629f01 225 def_irq_default_handler FTM0_IRQHandler
mbed_official 445:3312ed629f01 226 def_irq_default_handler FTM1_IRQHandler
mbed_official 445:3312ed629f01 227 def_irq_default_handler CMT_IRQHandler
mbed_official 445:3312ed629f01 228 def_irq_default_handler RTC_IRQHandler
mbed_official 445:3312ed629f01 229 def_irq_default_handler RTC_Seconds_IRQHandler
mbed_official 445:3312ed629f01 230 def_irq_default_handler PIT0_IRQHandler
mbed_official 445:3312ed629f01 231 def_irq_default_handler PIT1_IRQHandler
mbed_official 445:3312ed629f01 232 def_irq_default_handler PIT2_IRQHandler
mbed_official 445:3312ed629f01 233 def_irq_default_handler PIT3_IRQHandler
mbed_official 445:3312ed629f01 234 def_irq_default_handler PDB0_IRQHandler
mbed_official 445:3312ed629f01 235 def_irq_default_handler USB0_IRQHandler
mbed_official 445:3312ed629f01 236 def_irq_default_handler USBDCD_IRQHandler
mbed_official 445:3312ed629f01 237 def_irq_default_handler TSI0_IRQHandler
mbed_official 445:3312ed629f01 238 def_irq_default_handler MCG_IRQHandler
mbed_official 445:3312ed629f01 239 def_irq_default_handler LPTimer_IRQHandler
mbed_official 445:3312ed629f01 240 def_irq_default_handler PORTA_IRQHandler
mbed_official 445:3312ed629f01 241 def_irq_default_handler PORTB_IRQHandler
mbed_official 445:3312ed629f01 242 def_irq_default_handler PORTC_IRQHandler
mbed_official 445:3312ed629f01 243 def_irq_default_handler PORTD_IRQHandler
mbed_official 445:3312ed629f01 244 def_irq_default_handler PORTE_IRQHandler
mbed_official 445:3312ed629f01 245 def_irq_default_handler SWI_IRQHandler
mbed_official 445:3312ed629f01 246 def_irq_default_handler DEF_IRQHandler
mbed_official 445:3312ed629f01 247
mbed_official 445:3312ed629f01 248 /* Flash protection region, placed at 0x400 */
mbed_official 445:3312ed629f01 249 .text
mbed_official 445:3312ed629f01 250 .thumb
mbed_official 445:3312ed629f01 251 .align 2
mbed_official 445:3312ed629f01 252 .section .kinetis_flash_config_field,"a",%progbits
mbed_official 445:3312ed629f01 253 kinetis_flash_config:
mbed_official 445:3312ed629f01 254 .long 0xffffffff
mbed_official 445:3312ed629f01 255 .long 0xffffffff
mbed_official 445:3312ed629f01 256 .long 0xffffffff
mbed_official 445:3312ed629f01 257 .long 0xfffffffe
mbed_official 445:3312ed629f01 258
mbed_official 445:3312ed629f01 259 .end