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.
targets/cmsis/TARGET_ARM_SSG/TARGET_MPS2_M7/TOOLCHAIN_GCC_ARM/startup_ARMCM7.s@580:3c14cb9b87c5, 2015-07-02 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Jul 02 16:15:09 2015 +0100
- Revision:
- 580:3c14cb9b87c5
Synchronized with git revision 213caf296f26963a7bea129b8ec4f33bbd1e6588
Full URL: https://github.com/mbedmicro/mbed/commit/213caf296f26963a7bea129b8ec4f33bbd1e6588/
commit of mps2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 580:3c14cb9b87c5 | 1 | /* File: startup_ARMCM7.S |
mbed_official | 580:3c14cb9b87c5 | 2 | * Purpose: startup file for Cortex-M7 devices. Should use with |
mbed_official | 580:3c14cb9b87c5 | 3 | * GCC for ARM Embedded Processors |
mbed_official | 580:3c14cb9b87c5 | 4 | * Version: V1.00 |
mbed_official | 580:3c14cb9b87c5 | 5 | * Date: 22 August 2014 |
mbed_official | 580:3c14cb9b87c5 | 6 | * |
mbed_official | 580:3c14cb9b87c5 | 7 | */ |
mbed_official | 580:3c14cb9b87c5 | 8 | /* Copyright (c) 2011 - 2014 ARM LIMITED |
mbed_official | 580:3c14cb9b87c5 | 9 | |
mbed_official | 580:3c14cb9b87c5 | 10 | All rights reserved. |
mbed_official | 580:3c14cb9b87c5 | 11 | Redistribution and use in source and binary forms, with or without |
mbed_official | 580:3c14cb9b87c5 | 12 | modification, are permitted provided that the following conditions are met: |
mbed_official | 580:3c14cb9b87c5 | 13 | - Redistributions of source code must retain the above copyright |
mbed_official | 580:3c14cb9b87c5 | 14 | notice, this list of conditions and the following disclaimer. |
mbed_official | 580:3c14cb9b87c5 | 15 | - Redistributions in binary form must reproduce the above copyright |
mbed_official | 580:3c14cb9b87c5 | 16 | notice, this list of conditions and the following disclaimer in the |
mbed_official | 580:3c14cb9b87c5 | 17 | documentation and/or other materials provided with the distribution. |
mbed_official | 580:3c14cb9b87c5 | 18 | - Neither the name of ARM nor the names of its contributors may be used |
mbed_official | 580:3c14cb9b87c5 | 19 | to endorse or promote products derived from this software without |
mbed_official | 580:3c14cb9b87c5 | 20 | specific prior written permission. |
mbed_official | 580:3c14cb9b87c5 | 21 | * |
mbed_official | 580:3c14cb9b87c5 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 580:3c14cb9b87c5 | 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 580:3c14cb9b87c5 | 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
mbed_official | 580:3c14cb9b87c5 | 25 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE |
mbed_official | 580:3c14cb9b87c5 | 26 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
mbed_official | 580:3c14cb9b87c5 | 27 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
mbed_official | 580:3c14cb9b87c5 | 28 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
mbed_official | 580:3c14cb9b87c5 | 29 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
mbed_official | 580:3c14cb9b87c5 | 30 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
mbed_official | 580:3c14cb9b87c5 | 31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
mbed_official | 580:3c14cb9b87c5 | 32 | POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 580:3c14cb9b87c5 | 33 | ---------------------------------------------------------------------------*/ |
mbed_official | 580:3c14cb9b87c5 | 34 | |
mbed_official | 580:3c14cb9b87c5 | 35 | |
mbed_official | 580:3c14cb9b87c5 | 36 | .syntax unified |
mbed_official | 580:3c14cb9b87c5 | 37 | .arch armv7-m |
mbed_official | 580:3c14cb9b87c5 | 38 | |
mbed_official | 580:3c14cb9b87c5 | 39 | .section .stack |
mbed_official | 580:3c14cb9b87c5 | 40 | .align 3 |
mbed_official | 580:3c14cb9b87c5 | 41 | #ifdef __STACK_SIZE |
mbed_official | 580:3c14cb9b87c5 | 42 | .equ Stack_Size, __STACK_SIZE |
mbed_official | 580:3c14cb9b87c5 | 43 | #else |
mbed_official | 580:3c14cb9b87c5 | 44 | .equ Stack_Size, 0x00000400 |
mbed_official | 580:3c14cb9b87c5 | 45 | #endif |
mbed_official | 580:3c14cb9b87c5 | 46 | .globl __StackTop |
mbed_official | 580:3c14cb9b87c5 | 47 | .globl __StackLimit |
mbed_official | 580:3c14cb9b87c5 | 48 | __StackLimit: |
mbed_official | 580:3c14cb9b87c5 | 49 | .space Stack_Size |
mbed_official | 580:3c14cb9b87c5 | 50 | .size __StackLimit, . - __StackLimit |
mbed_official | 580:3c14cb9b87c5 | 51 | __StackTop: |
mbed_official | 580:3c14cb9b87c5 | 52 | .size __StackTop, . - __StackTop |
mbed_official | 580:3c14cb9b87c5 | 53 | |
mbed_official | 580:3c14cb9b87c5 | 54 | .section .heap |
mbed_official | 580:3c14cb9b87c5 | 55 | .align 3 |
mbed_official | 580:3c14cb9b87c5 | 56 | #ifdef __HEAP_SIZE |
mbed_official | 580:3c14cb9b87c5 | 57 | .equ Heap_Size, __HEAP_SIZE |
mbed_official | 580:3c14cb9b87c5 | 58 | #else |
mbed_official | 580:3c14cb9b87c5 | 59 | .equ Heap_Size, 0x00000C00 |
mbed_official | 580:3c14cb9b87c5 | 60 | #endif |
mbed_official | 580:3c14cb9b87c5 | 61 | .globl __HeapBase |
mbed_official | 580:3c14cb9b87c5 | 62 | .globl __HeapLimit |
mbed_official | 580:3c14cb9b87c5 | 63 | __HeapBase: |
mbed_official | 580:3c14cb9b87c5 | 64 | .if Heap_Size |
mbed_official | 580:3c14cb9b87c5 | 65 | .space Heap_Size |
mbed_official | 580:3c14cb9b87c5 | 66 | .endif |
mbed_official | 580:3c14cb9b87c5 | 67 | .size __HeapBase, . - __HeapBase |
mbed_official | 580:3c14cb9b87c5 | 68 | __HeapLimit: |
mbed_official | 580:3c14cb9b87c5 | 69 | .size __HeapLimit, . - __HeapLimit |
mbed_official | 580:3c14cb9b87c5 | 70 | |
mbed_official | 580:3c14cb9b87c5 | 71 | .section .vectors |
mbed_official | 580:3c14cb9b87c5 | 72 | .align 2 |
mbed_official | 580:3c14cb9b87c5 | 73 | .globl __Vectors |
mbed_official | 580:3c14cb9b87c5 | 74 | __Vectors: |
mbed_official | 580:3c14cb9b87c5 | 75 | .long __StackTop /* Top of Stack */ |
mbed_official | 580:3c14cb9b87c5 | 76 | .long Reset_Handler /* Reset Handler */ |
mbed_official | 580:3c14cb9b87c5 | 77 | .long NMI_Handler /* NMI Handler */ |
mbed_official | 580:3c14cb9b87c5 | 78 | .long HardFault_Handler /* Hard Fault Handler */ |
mbed_official | 580:3c14cb9b87c5 | 79 | .long MemManage_Handler /* MPU Fault Handler */ |
mbed_official | 580:3c14cb9b87c5 | 80 | .long BusFault_Handler /* Bus Fault Handler */ |
mbed_official | 580:3c14cb9b87c5 | 81 | .long UsageFault_Handler /* Usage Fault Handler */ |
mbed_official | 580:3c14cb9b87c5 | 82 | .long 0 /* Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 83 | .long 0 /* Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 84 | .long 0 /* Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 85 | .long 0 /* Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 86 | .long SVC_Handler /* SVCall Handler */ |
mbed_official | 580:3c14cb9b87c5 | 87 | .long DebugMon_Handler /* Debug Monitor Handler */ |
mbed_official | 580:3c14cb9b87c5 | 88 | .long 0 /* Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 89 | .long PendSV_Handler /* PendSV Handler */ |
mbed_official | 580:3c14cb9b87c5 | 90 | .long SysTick_Handler /* SysTick Handler */ |
mbed_official | 580:3c14cb9b87c5 | 91 | |
mbed_official | 580:3c14cb9b87c5 | 92 | /* External interrupts */ |
mbed_official | 580:3c14cb9b87c5 | 93 | .long WDT_IRQHandler /* 0: Watchdog Timer */ |
mbed_official | 580:3c14cb9b87c5 | 94 | .long RTC_IRQHandler /* 1: Real Time Clock */ |
mbed_official | 580:3c14cb9b87c5 | 95 | .long TIM0_IRQHandler /* 2: Timer0 / Timer1 */ |
mbed_official | 580:3c14cb9b87c5 | 96 | .long TIM2_IRQHandler /* 3: Timer2 / Timer3 */ |
mbed_official | 580:3c14cb9b87c5 | 97 | .long MCIA_IRQHandler /* 4: MCIa */ |
mbed_official | 580:3c14cb9b87c5 | 98 | .long MCIB_IRQHandler /* 5: MCIb */ |
mbed_official | 580:3c14cb9b87c5 | 99 | .long UART0_IRQHandler /* 6: UART0 - DUT FPGA */ |
mbed_official | 580:3c14cb9b87c5 | 100 | .long UART1_IRQHandler /* 7: UART1 - DUT FPGA */ |
mbed_official | 580:3c14cb9b87c5 | 101 | .long UART2_IRQHandler /* 8: UART2 - DUT FPGA */ |
mbed_official | 580:3c14cb9b87c5 | 102 | .long UART4_IRQHandler /* 9: UART4 - not connected */ |
mbed_official | 580:3c14cb9b87c5 | 103 | .long AACI_IRQHandler /* 10: AACI / AC97 */ |
mbed_official | 580:3c14cb9b87c5 | 104 | .long CLCD_IRQHandler /* 11: CLCD Combined Interrupt */ |
mbed_official | 580:3c14cb9b87c5 | 105 | .long ENET_IRQHandler /* 12: Ethernet */ |
mbed_official | 580:3c14cb9b87c5 | 106 | .long USBDC_IRQHandler /* 13: USB Device */ |
mbed_official | 580:3c14cb9b87c5 | 107 | .long USBHC_IRQHandler /* 14: USB Host Controller */ |
mbed_official | 580:3c14cb9b87c5 | 108 | .long CHLCD_IRQHandler /* 15: Character LCD */ |
mbed_official | 580:3c14cb9b87c5 | 109 | .long FLEXRAY_IRQHandler /* 16: Flexray */ |
mbed_official | 580:3c14cb9b87c5 | 110 | .long CAN_IRQHandler /* 17: CAN */ |
mbed_official | 580:3c14cb9b87c5 | 111 | .long LIN_IRQHandler /* 18: LIN */ |
mbed_official | 580:3c14cb9b87c5 | 112 | .long I2C_IRQHandler /* 19: I2C ADC/DAC */ |
mbed_official | 580:3c14cb9b87c5 | 113 | .long 0 /* 20: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 114 | .long 0 /* 21: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 115 | .long 0 /* 22: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 116 | .long 0 /* 23: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 117 | .long 0 /* 24: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 118 | .long 0 /* 25: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 119 | .long 0 /* 26: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 120 | .long 0 /* 27: Reserved */ |
mbed_official | 580:3c14cb9b87c5 | 121 | .long CPU_CLCD_IRQHandler /* 28: Reserved - CPU FPGA CLCD */ |
mbed_official | 580:3c14cb9b87c5 | 122 | .long 0 /* 29: Reserved - CPU FPGA */ |
mbed_official | 580:3c14cb9b87c5 | 123 | .long UART3_IRQHandler /* 30: UART3 - CPU FPGA */ |
mbed_official | 580:3c14cb9b87c5 | 124 | .long SPI_IRQHandler /* 31: SPI Touchscreen - CPU FPGA */ |
mbed_official | 580:3c14cb9b87c5 | 125 | |
mbed_official | 580:3c14cb9b87c5 | 126 | .size __Vectors, . - __Vectors |
mbed_official | 580:3c14cb9b87c5 | 127 | |
mbed_official | 580:3c14cb9b87c5 | 128 | .text |
mbed_official | 580:3c14cb9b87c5 | 129 | .thumb |
mbed_official | 580:3c14cb9b87c5 | 130 | .thumb_func |
mbed_official | 580:3c14cb9b87c5 | 131 | .align 2 |
mbed_official | 580:3c14cb9b87c5 | 132 | .globl Reset_Handler |
mbed_official | 580:3c14cb9b87c5 | 133 | .type Reset_Handler, %function |
mbed_official | 580:3c14cb9b87c5 | 134 | Reset_Handler: |
mbed_official | 580:3c14cb9b87c5 | 135 | /* Firstly it copies data from read only memory to RAM. There are two schemes |
mbed_official | 580:3c14cb9b87c5 | 136 | * to copy. One can copy more than one sections. Another can only copy |
mbed_official | 580:3c14cb9b87c5 | 137 | * one section. The former scheme needs more instructions and read-only |
mbed_official | 580:3c14cb9b87c5 | 138 | * data to implement than the latter. |
mbed_official | 580:3c14cb9b87c5 | 139 | * Macro __STARTUP_COPY_MULTIPLE is used to choose between two schemes. */ |
mbed_official | 580:3c14cb9b87c5 | 140 | |
mbed_official | 580:3c14cb9b87c5 | 141 | #ifdef __STARTUP_COPY_MULTIPLE |
mbed_official | 580:3c14cb9b87c5 | 142 | /* Multiple sections scheme. |
mbed_official | 580:3c14cb9b87c5 | 143 | * |
mbed_official | 580:3c14cb9b87c5 | 144 | * Between symbol address __copy_table_start__ and __copy_table_end__, |
mbed_official | 580:3c14cb9b87c5 | 145 | * there are array of triplets, each of which specify: |
mbed_official | 580:3c14cb9b87c5 | 146 | * offset 0: LMA of start of a section to copy from |
mbed_official | 580:3c14cb9b87c5 | 147 | * offset 4: VMA of start of a section to copy to |
mbed_official | 580:3c14cb9b87c5 | 148 | * offset 8: size of the section to copy. Must be multiply of 4 |
mbed_official | 580:3c14cb9b87c5 | 149 | * |
mbed_official | 580:3c14cb9b87c5 | 150 | * All addresses must be aligned to 4 bytes boundary. |
mbed_official | 580:3c14cb9b87c5 | 151 | */ |
mbed_official | 580:3c14cb9b87c5 | 152 | ldr r4, =__copy_table_start__ |
mbed_official | 580:3c14cb9b87c5 | 153 | ldr r5, =__copy_table_end__ |
mbed_official | 580:3c14cb9b87c5 | 154 | |
mbed_official | 580:3c14cb9b87c5 | 155 | .L_loop0: |
mbed_official | 580:3c14cb9b87c5 | 156 | cmp r4, r5 |
mbed_official | 580:3c14cb9b87c5 | 157 | bge .L_loop0_done |
mbed_official | 580:3c14cb9b87c5 | 158 | ldr r1, [r4] |
mbed_official | 580:3c14cb9b87c5 | 159 | ldr r2, [r4, #4] |
mbed_official | 580:3c14cb9b87c5 | 160 | ldr r3, [r4, #8] |
mbed_official | 580:3c14cb9b87c5 | 161 | |
mbed_official | 580:3c14cb9b87c5 | 162 | .L_loop0_0: |
mbed_official | 580:3c14cb9b87c5 | 163 | subs r3, #4 |
mbed_official | 580:3c14cb9b87c5 | 164 | ittt ge |
mbed_official | 580:3c14cb9b87c5 | 165 | ldrge r0, [r1, r3] |
mbed_official | 580:3c14cb9b87c5 | 166 | strge r0, [r2, r3] |
mbed_official | 580:3c14cb9b87c5 | 167 | bge .L_loop0_0 |
mbed_official | 580:3c14cb9b87c5 | 168 | |
mbed_official | 580:3c14cb9b87c5 | 169 | adds r4, #12 |
mbed_official | 580:3c14cb9b87c5 | 170 | b .L_loop0 |
mbed_official | 580:3c14cb9b87c5 | 171 | |
mbed_official | 580:3c14cb9b87c5 | 172 | .L_loop0_done: |
mbed_official | 580:3c14cb9b87c5 | 173 | #else |
mbed_official | 580:3c14cb9b87c5 | 174 | /* Single section scheme. |
mbed_official | 580:3c14cb9b87c5 | 175 | * |
mbed_official | 580:3c14cb9b87c5 | 176 | * The ranges of copy from/to are specified by following symbols |
mbed_official | 580:3c14cb9b87c5 | 177 | * __etext: LMA of start of the section to copy from. Usually end of text |
mbed_official | 580:3c14cb9b87c5 | 178 | * __data_start__: VMA of start of the section to copy to |
mbed_official | 580:3c14cb9b87c5 | 179 | * __data_end__: VMA of end of the section to copy to |
mbed_official | 580:3c14cb9b87c5 | 180 | * |
mbed_official | 580:3c14cb9b87c5 | 181 | * All addresses must be aligned to 4 bytes boundary. |
mbed_official | 580:3c14cb9b87c5 | 182 | */ |
mbed_official | 580:3c14cb9b87c5 | 183 | ldr r1, =__etext |
mbed_official | 580:3c14cb9b87c5 | 184 | ldr r2, =__data_start__ |
mbed_official | 580:3c14cb9b87c5 | 185 | ldr r3, =__data_end__ |
mbed_official | 580:3c14cb9b87c5 | 186 | |
mbed_official | 580:3c14cb9b87c5 | 187 | .L_loop1: |
mbed_official | 580:3c14cb9b87c5 | 188 | cmp r2, r3 |
mbed_official | 580:3c14cb9b87c5 | 189 | ittt lt |
mbed_official | 580:3c14cb9b87c5 | 190 | ldrlt r0, [r1], #4 |
mbed_official | 580:3c14cb9b87c5 | 191 | strlt r0, [r2], #4 |
mbed_official | 580:3c14cb9b87c5 | 192 | blt .L_loop1 |
mbed_official | 580:3c14cb9b87c5 | 193 | #endif /*__STARTUP_COPY_MULTIPLE */ |
mbed_official | 580:3c14cb9b87c5 | 194 | |
mbed_official | 580:3c14cb9b87c5 | 195 | /* This part of work usually is done in C library startup code. Otherwise, |
mbed_official | 580:3c14cb9b87c5 | 196 | * define this macro to enable it in this startup. |
mbed_official | 580:3c14cb9b87c5 | 197 | * |
mbed_official | 580:3c14cb9b87c5 | 198 | * There are two schemes too. One can clear multiple BSS sections. Another |
mbed_official | 580:3c14cb9b87c5 | 199 | * can only clear one section. The former is more size expensive than the |
mbed_official | 580:3c14cb9b87c5 | 200 | * latter. |
mbed_official | 580:3c14cb9b87c5 | 201 | * |
mbed_official | 580:3c14cb9b87c5 | 202 | * Define macro __STARTUP_CLEAR_BSS_MULTIPLE to choose the former. |
mbed_official | 580:3c14cb9b87c5 | 203 | * Otherwise efine macro __STARTUP_CLEAR_BSS to choose the later. |
mbed_official | 580:3c14cb9b87c5 | 204 | */ |
mbed_official | 580:3c14cb9b87c5 | 205 | #ifdef __STARTUP_CLEAR_BSS_MULTIPLE |
mbed_official | 580:3c14cb9b87c5 | 206 | /* Multiple sections scheme. |
mbed_official | 580:3c14cb9b87c5 | 207 | * |
mbed_official | 580:3c14cb9b87c5 | 208 | * Between symbol address __copy_table_start__ and __copy_table_end__, |
mbed_official | 580:3c14cb9b87c5 | 209 | * there are array of tuples specifying: |
mbed_official | 580:3c14cb9b87c5 | 210 | * offset 0: Start of a BSS section |
mbed_official | 580:3c14cb9b87c5 | 211 | * offset 4: Size of this BSS section. Must be multiply of 4 |
mbed_official | 580:3c14cb9b87c5 | 212 | */ |
mbed_official | 580:3c14cb9b87c5 | 213 | ldr r3, =__zero_table_start__ |
mbed_official | 580:3c14cb9b87c5 | 214 | ldr r4, =__zero_table_end__ |
mbed_official | 580:3c14cb9b87c5 | 215 | |
mbed_official | 580:3c14cb9b87c5 | 216 | .L_loop2: |
mbed_official | 580:3c14cb9b87c5 | 217 | cmp r3, r4 |
mbed_official | 580:3c14cb9b87c5 | 218 | bge .L_loop2_done |
mbed_official | 580:3c14cb9b87c5 | 219 | ldr r1, [r3] |
mbed_official | 580:3c14cb9b87c5 | 220 | ldr r2, [r3, #4] |
mbed_official | 580:3c14cb9b87c5 | 221 | movs r0, 0 |
mbed_official | 580:3c14cb9b87c5 | 222 | |
mbed_official | 580:3c14cb9b87c5 | 223 | .L_loop2_0: |
mbed_official | 580:3c14cb9b87c5 | 224 | subs r2, #4 |
mbed_official | 580:3c14cb9b87c5 | 225 | itt ge |
mbed_official | 580:3c14cb9b87c5 | 226 | strge r0, [r1, r2] |
mbed_official | 580:3c14cb9b87c5 | 227 | bge .L_loop2_0 |
mbed_official | 580:3c14cb9b87c5 | 228 | |
mbed_official | 580:3c14cb9b87c5 | 229 | adds r3, #8 |
mbed_official | 580:3c14cb9b87c5 | 230 | b .L_loop2 |
mbed_official | 580:3c14cb9b87c5 | 231 | .L_loop2_done: |
mbed_official | 580:3c14cb9b87c5 | 232 | #elif defined (__STARTUP_CLEAR_BSS) |
mbed_official | 580:3c14cb9b87c5 | 233 | /* Single BSS section scheme. |
mbed_official | 580:3c14cb9b87c5 | 234 | * |
mbed_official | 580:3c14cb9b87c5 | 235 | * The BSS section is specified by following symbols |
mbed_official | 580:3c14cb9b87c5 | 236 | * __bss_start__: start of the BSS section. |
mbed_official | 580:3c14cb9b87c5 | 237 | * __bss_end__: end of the BSS section. |
mbed_official | 580:3c14cb9b87c5 | 238 | * |
mbed_official | 580:3c14cb9b87c5 | 239 | * Both addresses must be aligned to 4 bytes boundary. |
mbed_official | 580:3c14cb9b87c5 | 240 | */ |
mbed_official | 580:3c14cb9b87c5 | 241 | ldr r1, =__bss_start__ |
mbed_official | 580:3c14cb9b87c5 | 242 | ldr r2, =__bss_end__ |
mbed_official | 580:3c14cb9b87c5 | 243 | |
mbed_official | 580:3c14cb9b87c5 | 244 | movs r0, 0 |
mbed_official | 580:3c14cb9b87c5 | 245 | .L_loop3: |
mbed_official | 580:3c14cb9b87c5 | 246 | cmp r1, r2 |
mbed_official | 580:3c14cb9b87c5 | 247 | itt lt |
mbed_official | 580:3c14cb9b87c5 | 248 | strlt r0, [r1], #4 |
mbed_official | 580:3c14cb9b87c5 | 249 | blt .L_loop3 |
mbed_official | 580:3c14cb9b87c5 | 250 | #endif /* __STARTUP_CLEAR_BSS_MULTIPLE || __STARTUP_CLEAR_BSS */ |
mbed_official | 580:3c14cb9b87c5 | 251 | |
mbed_official | 580:3c14cb9b87c5 | 252 | #ifndef __NO_SYSTEM_INIT |
mbed_official | 580:3c14cb9b87c5 | 253 | bl SystemInit |
mbed_official | 580:3c14cb9b87c5 | 254 | #endif |
mbed_official | 580:3c14cb9b87c5 | 255 | |
mbed_official | 580:3c14cb9b87c5 | 256 | #ifndef __START |
mbed_official | 580:3c14cb9b87c5 | 257 | #define __START _start |
mbed_official | 580:3c14cb9b87c5 | 258 | #endif |
mbed_official | 580:3c14cb9b87c5 | 259 | bl __START |
mbed_official | 580:3c14cb9b87c5 | 260 | |
mbed_official | 580:3c14cb9b87c5 | 261 | .pool |
mbed_official | 580:3c14cb9b87c5 | 262 | .size Reset_Handler, . - Reset_Handler |
mbed_official | 580:3c14cb9b87c5 | 263 | |
mbed_official | 580:3c14cb9b87c5 | 264 | .align 1 |
mbed_official | 580:3c14cb9b87c5 | 265 | .thumb_func |
mbed_official | 580:3c14cb9b87c5 | 266 | .weak Default_Handler |
mbed_official | 580:3c14cb9b87c5 | 267 | .type Default_Handler, %function |
mbed_official | 580:3c14cb9b87c5 | 268 | Default_Handler: |
mbed_official | 580:3c14cb9b87c5 | 269 | b . |
mbed_official | 580:3c14cb9b87c5 | 270 | .size Default_Handler, . - Default_Handler |
mbed_official | 580:3c14cb9b87c5 | 271 | |
mbed_official | 580:3c14cb9b87c5 | 272 | /* Macro to define default handlers. Default handler |
mbed_official | 580:3c14cb9b87c5 | 273 | * will be weak symbol and just dead loops. They can be |
mbed_official | 580:3c14cb9b87c5 | 274 | * overwritten by other handlers */ |
mbed_official | 580:3c14cb9b87c5 | 275 | .macro def_irq_handler handler_name |
mbed_official | 580:3c14cb9b87c5 | 276 | .weak \handler_name |
mbed_official | 580:3c14cb9b87c5 | 277 | .set \handler_name, Default_Handler |
mbed_official | 580:3c14cb9b87c5 | 278 | .endm |
mbed_official | 580:3c14cb9b87c5 | 279 | |
mbed_official | 580:3c14cb9b87c5 | 280 | def_irq_handler NMI_Handler |
mbed_official | 580:3c14cb9b87c5 | 281 | def_irq_handler HardFault_Handler |
mbed_official | 580:3c14cb9b87c5 | 282 | def_irq_handler MemManage_Handler |
mbed_official | 580:3c14cb9b87c5 | 283 | def_irq_handler BusFault_Handler |
mbed_official | 580:3c14cb9b87c5 | 284 | def_irq_handler UsageFault_Handler |
mbed_official | 580:3c14cb9b87c5 | 285 | def_irq_handler SVC_Handler |
mbed_official | 580:3c14cb9b87c5 | 286 | def_irq_handler DebugMon_Handler |
mbed_official | 580:3c14cb9b87c5 | 287 | def_irq_handler PendSV_Handler |
mbed_official | 580:3c14cb9b87c5 | 288 | def_irq_handler SysTick_Handler |
mbed_official | 580:3c14cb9b87c5 | 289 | |
mbed_official | 580:3c14cb9b87c5 | 290 | def_irq_handler WDT_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 291 | def_irq_handler RTC_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 292 | def_irq_handler TIM0_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 293 | def_irq_handler TIM2_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 294 | def_irq_handler MCIA_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 295 | def_irq_handler MCIB_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 296 | def_irq_handler UART0_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 297 | def_irq_handler UART1_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 298 | def_irq_handler UART2_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 299 | def_irq_handler UART3_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 300 | def_irq_handler UART4_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 301 | def_irq_handler AACI_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 302 | def_irq_handler CLCD_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 303 | def_irq_handler ENET_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 304 | def_irq_handler USBDC_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 305 | def_irq_handler USBHC_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 306 | def_irq_handler CHLCD_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 307 | def_irq_handler FLEXRAY_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 308 | def_irq_handler CAN_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 309 | def_irq_handler LIN_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 310 | def_irq_handler I2C_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 311 | def_irq_handler CPU_CLCD_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 312 | def_irq_handler SPI_IRQHandler |
mbed_official | 580:3c14cb9b87c5 | 313 | |
mbed_official | 580:3c14cb9b87c5 | 314 | .end |