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_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/TOOLCHAIN_GCC_ARM/startup_stm32l053xx.s@489:119543c9f674
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 378:be043393235b 1 /**
mbed_official 378:be043393235b 2 ******************************************************************************
mbed_official 378:be043393235b 3 * @file startup_stm32l053xx.s
mbed_official 378:be043393235b 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.2.0
mbed_official 489:119543c9f674 6 * @date 06-February-2015
mbed_official 378:be043393235b 7 * @brief STM32L053xx Devices vector table for Atollic TrueSTUDIO toolchain.
mbed_official 378:be043393235b 8 * This module performs:
mbed_official 378:be043393235b 9 * - Set the initial SP
mbed_official 378:be043393235b 10 * - Set the initial PC == Reset_Handler,
mbed_official 378:be043393235b 11 * - Set the vector table entries with the exceptions ISR address
mbed_official 378:be043393235b 12 * - Branches to main in the C library (which eventually
mbed_official 378:be043393235b 13 * calls main()).
mbed_official 378:be043393235b 14 * After Reset the Cortex-M0+ processor is in Thread mode,
mbed_official 378:be043393235b 15 * priority is Privileged, and the Stack is set to Main.
mbed_official 378:be043393235b 16 ******************************************************************************
mbed_official 378:be043393235b 17 *
mbed_official 378:be043393235b 18 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 378:be043393235b 19 * are permitted provided that the following conditions are met:
mbed_official 378:be043393235b 20 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 378:be043393235b 21 * this list of conditions and the following disclaimer.
mbed_official 378:be043393235b 22 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 378:be043393235b 23 * this list of conditions and the following disclaimer in the documentation
mbed_official 378:be043393235b 24 * and/or other materials provided with the distribution.
mbed_official 378:be043393235b 25 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 378:be043393235b 26 * may be used to endorse or promote products derived from this software
mbed_official 378:be043393235b 27 * without specific prior written permission.
mbed_official 378:be043393235b 28 *
mbed_official 378:be043393235b 29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 378:be043393235b 30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 378:be043393235b 31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 378:be043393235b 32 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 378:be043393235b 33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 378:be043393235b 34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 378:be043393235b 35 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 378:be043393235b 36 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 378:be043393235b 37 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 378:be043393235b 38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 378:be043393235b 39 *
mbed_official 378:be043393235b 40 ******************************************************************************
mbed_official 378:be043393235b 41 */
mbed_official 378:be043393235b 42
mbed_official 378:be043393235b 43 .syntax unified
mbed_official 378:be043393235b 44 .cpu cortex-m0plus
mbed_official 378:be043393235b 45 .fpu softvfp
mbed_official 378:be043393235b 46 .thumb
mbed_official 378:be043393235b 47
mbed_official 378:be043393235b 48 .global g_pfnVectors
mbed_official 378:be043393235b 49 .global Default_Handler
mbed_official 378:be043393235b 50
mbed_official 378:be043393235b 51 /* start address for the initialization values of the .data section.
mbed_official 378:be043393235b 52 defined in linker script */
mbed_official 378:be043393235b 53 .word _sidata
mbed_official 378:be043393235b 54 /* start address for the .data section. defined in linker script */
mbed_official 378:be043393235b 55 .word _sdata
mbed_official 378:be043393235b 56 /* end address for the .data section. defined in linker script */
mbed_official 378:be043393235b 57 .word _edata
mbed_official 378:be043393235b 58 /* start address for the .bss section. defined in linker script */
mbed_official 378:be043393235b 59 .word _sbss
mbed_official 378:be043393235b 60 /* end address for the .bss section. defined in linker script */
mbed_official 378:be043393235b 61 .word _ebss
mbed_official 378:be043393235b 62
mbed_official 378:be043393235b 63 .section .text.Reset_Handler
mbed_official 378:be043393235b 64 .weak Reset_Handler
mbed_official 378:be043393235b 65 .type Reset_Handler, %function
mbed_official 378:be043393235b 66 Reset_Handler:
mbed_official 378:be043393235b 67 ldr r0, =_estack
mbed_official 378:be043393235b 68 mov sp, r0 /* set stack pointer */
mbed_official 378:be043393235b 69
mbed_official 378:be043393235b 70 /* Copy the data segment initializers from flash to SRAM */
mbed_official 378:be043393235b 71 movs r1, #0
mbed_official 378:be043393235b 72 b LoopCopyDataInit
mbed_official 378:be043393235b 73
mbed_official 378:be043393235b 74 CopyDataInit:
mbed_official 378:be043393235b 75 ldr r3, =_sidata
mbed_official 378:be043393235b 76 ldr r3, [r3, r1]
mbed_official 378:be043393235b 77 str r3, [r0, r1]
mbed_official 378:be043393235b 78 adds r1, r1, #4
mbed_official 378:be043393235b 79
mbed_official 378:be043393235b 80 LoopCopyDataInit:
mbed_official 378:be043393235b 81 ldr r0, =_sdata
mbed_official 378:be043393235b 82 ldr r3, =_edata
mbed_official 378:be043393235b 83 adds r2, r0, r1
mbed_official 378:be043393235b 84 cmp r2, r3
mbed_official 378:be043393235b 85 bcc CopyDataInit
mbed_official 378:be043393235b 86 ldr r2, =_sbss
mbed_official 378:be043393235b 87 b LoopFillZerobss
mbed_official 378:be043393235b 88 /* Zero fill the bss segment. */
mbed_official 378:be043393235b 89 FillZerobss:
mbed_official 378:be043393235b 90 movs r3, #0
mbed_official 378:be043393235b 91 str r3, [r2]
mbed_official 378:be043393235b 92 adds r2, r2, #4
mbed_official 378:be043393235b 93
mbed_official 378:be043393235b 94
mbed_official 378:be043393235b 95 LoopFillZerobss:
mbed_official 378:be043393235b 96 ldr r3, = _ebss
mbed_official 378:be043393235b 97 cmp r2, r3
mbed_official 378:be043393235b 98 bcc FillZerobss
mbed_official 378:be043393235b 99
mbed_official 378:be043393235b 100 /* Call the clock system intitialization function.*/
mbed_official 378:be043393235b 101 bl SystemInit
mbed_official 378:be043393235b 102 /* Call static constructors */
mbed_official 441:d2c15dda23c1 103 //bl __libc_init_array
mbed_official 378:be043393235b 104 /* Call the application's entry point.*/
mbed_official 441:d2c15dda23c1 105 //bl main
mbed_official 441:d2c15dda23c1 106 bl _start
mbed_official 378:be043393235b 107
mbed_official 378:be043393235b 108 LoopForever:
mbed_official 441:d2c15dda23c1 109 b LoopForever
mbed_official 378:be043393235b 110
mbed_official 378:be043393235b 111
mbed_official 378:be043393235b 112 .size Reset_Handler, .-Reset_Handler
mbed_official 378:be043393235b 113
mbed_official 378:be043393235b 114 /**
mbed_official 378:be043393235b 115 * @brief This is the code that gets called when the processor receives an
mbed_official 378:be043393235b 116 * unexpected interrupt. This simply enters an infinite loop, preserving
mbed_official 378:be043393235b 117 * the system state for examination by a debugger.
mbed_official 378:be043393235b 118 *
mbed_official 378:be043393235b 119 * @param None
mbed_official 378:be043393235b 120 * @retval : None
mbed_official 378:be043393235b 121 */
mbed_official 378:be043393235b 122 .section .text.Default_Handler,"ax",%progbits
mbed_official 378:be043393235b 123 Default_Handler:
mbed_official 378:be043393235b 124 Infinite_Loop:
mbed_official 378:be043393235b 125 b Infinite_Loop
mbed_official 378:be043393235b 126 .size Default_Handler, .-Default_Handler
mbed_official 378:be043393235b 127 /******************************************************************************
mbed_official 378:be043393235b 128 *
mbed_official 378:be043393235b 129 * The minimal vector table for a Cortex M0. Note that the proper constructs
mbed_official 378:be043393235b 130 * must be placed on this to ensure that it ends up at physical address
mbed_official 378:be043393235b 131 * 0x0000.0000.
mbed_official 378:be043393235b 132 *
mbed_official 378:be043393235b 133 ******************************************************************************/
mbed_official 378:be043393235b 134 .section .isr_vector,"a",%progbits
mbed_official 378:be043393235b 135 .type g_pfnVectors, %object
mbed_official 378:be043393235b 136 .size g_pfnVectors, .-g_pfnVectors
mbed_official 378:be043393235b 137
mbed_official 378:be043393235b 138
mbed_official 378:be043393235b 139 g_pfnVectors:
mbed_official 378:be043393235b 140 .word _estack
mbed_official 378:be043393235b 141 .word Reset_Handler
mbed_official 378:be043393235b 142 .word NMI_Handler
mbed_official 378:be043393235b 143 .word HardFault_Handler
mbed_official 378:be043393235b 144 .word 0
mbed_official 378:be043393235b 145 .word 0
mbed_official 378:be043393235b 146 .word 0
mbed_official 378:be043393235b 147 .word 0
mbed_official 378:be043393235b 148 .word 0
mbed_official 378:be043393235b 149 .word 0
mbed_official 378:be043393235b 150 .word 0
mbed_official 378:be043393235b 151 .word SVC_Handler
mbed_official 378:be043393235b 152 .word DebugMon_Handler
mbed_official 378:be043393235b 153 .word 0
mbed_official 378:be043393235b 154 .word PendSV_Handler
mbed_official 378:be043393235b 155 .word SysTick_Handler
mbed_official 378:be043393235b 156 .word WWDG_IRQHandler /* Window WatchDog */
mbed_official 378:be043393235b 157 .word PVD_IRQHandler /* PVD through EXTI Line detection */
mbed_official 378:be043393235b 158 .word RTC_IRQHandler /* RTC through the EXTI line */
mbed_official 378:be043393235b 159 .word FLASH_IRQHandler /* FLASH */
mbed_official 378:be043393235b 160 .word RCC_CRS_IRQHandler /* RCC and CRS */
mbed_official 378:be043393235b 161 .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */
mbed_official 378:be043393235b 162 .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */
mbed_official 378:be043393235b 163 .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */
mbed_official 378:be043393235b 164 .word TSC_IRQHandler /* TSC */
mbed_official 378:be043393235b 165 .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */
mbed_official 378:be043393235b 166 .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */
mbed_official 378:be043393235b 167 .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/
mbed_official 378:be043393235b 168 .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */
mbed_official 378:be043393235b 169 .word LPTIM1_IRQHandler /* LPTIM1 */
mbed_official 378:be043393235b 170 .word 0 /* Reserved */
mbed_official 378:be043393235b 171 .word TIM2_IRQHandler /* TIM2 */
mbed_official 378:be043393235b 172 .word 0 /* Reserved */
mbed_official 378:be043393235b 173 .word TIM6_DAC_IRQHandler /* TIM6 and DAC */
mbed_official 378:be043393235b 174 .word 0 /* Reserved */
mbed_official 378:be043393235b 175 .word 0 /* Reserved */
mbed_official 378:be043393235b 176 .word TIM21_IRQHandler /* TIM21 */
mbed_official 378:be043393235b 177 .word 0 /* Reserved */
mbed_official 378:be043393235b 178 .word TIM22_IRQHandler /* TIM22 */
mbed_official 378:be043393235b 179 .word I2C1_IRQHandler /* I2C1 */
mbed_official 378:be043393235b 180 .word I2C2_IRQHandler /* I2C2 */
mbed_official 378:be043393235b 181 .word SPI1_IRQHandler /* SPI1 */
mbed_official 378:be043393235b 182 .word SPI2_IRQHandler /* SPI2 */
mbed_official 378:be043393235b 183 .word USART1_IRQHandler /* USART1 */
mbed_official 378:be043393235b 184 .word USART2_IRQHandler /* USART2 */
mbed_official 378:be043393235b 185 .word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */
mbed_official 378:be043393235b 186 .word LCD_IRQHandler /* LCD */
mbed_official 378:be043393235b 187 .word USB_IRQHandler /* USB */
mbed_official 378:be043393235b 188
mbed_official 378:be043393235b 189 /*******************************************************************************
mbed_official 378:be043393235b 190 *
mbed_official 378:be043393235b 191 * Provide weak aliases for each Exception handler to the Default_Handler.
mbed_official 378:be043393235b 192 * As they are weak aliases, any function with the same name will override
mbed_official 378:be043393235b 193 * this definition.
mbed_official 378:be043393235b 194 *
mbed_official 378:be043393235b 195 *******************************************************************************/
mbed_official 378:be043393235b 196
mbed_official 378:be043393235b 197 .weak NMI_Handler
mbed_official 378:be043393235b 198 .thumb_set NMI_Handler,Default_Handler
mbed_official 378:be043393235b 199
mbed_official 378:be043393235b 200 .weak HardFault_Handler
mbed_official 378:be043393235b 201 .thumb_set HardFault_Handler,Default_Handler
mbed_official 378:be043393235b 202
mbed_official 378:be043393235b 203 .weak SVC_Handler
mbed_official 378:be043393235b 204 .thumb_set SVC_Handler,Default_Handler
mbed_official 378:be043393235b 205
mbed_official 378:be043393235b 206 .weak DebugMon_Handler
mbed_official 378:be043393235b 207 .thumb_set DebugMon_Handler,Default_Handler
mbed_official 378:be043393235b 208
mbed_official 378:be043393235b 209 .weak PendSV_Handler
mbed_official 378:be043393235b 210 .thumb_set PendSV_Handler,Default_Handler
mbed_official 378:be043393235b 211
mbed_official 378:be043393235b 212 .weak SysTick_Handler
mbed_official 378:be043393235b 213 .thumb_set SysTick_Handler,Default_Handler
mbed_official 378:be043393235b 214
mbed_official 378:be043393235b 215 .weak WWDG_IRQHandler
mbed_official 378:be043393235b 216 .thumb_set WWDG_IRQHandler,Default_Handler
mbed_official 378:be043393235b 217
mbed_official 378:be043393235b 218 .weak PVD_IRQHandler
mbed_official 378:be043393235b 219 .thumb_set PVD_IRQHandler,Default_Handler
mbed_official 378:be043393235b 220
mbed_official 378:be043393235b 221 .weak RTC_IRQHandler
mbed_official 378:be043393235b 222 .thumb_set RTC_IRQHandler,Default_Handler
mbed_official 378:be043393235b 223
mbed_official 378:be043393235b 224 .weak FLASH_IRQHandler
mbed_official 378:be043393235b 225 .thumb_set FLASH_IRQHandler,Default_Handler
mbed_official 378:be043393235b 226
mbed_official 378:be043393235b 227 .weak RCC_CRS_IRQHandler
mbed_official 378:be043393235b 228 .thumb_set RCC_CRS_IRQHandler,Default_Handler
mbed_official 378:be043393235b 229
mbed_official 378:be043393235b 230 .weak EXTI0_1_IRQHandler
mbed_official 378:be043393235b 231 .thumb_set EXTI0_1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 232
mbed_official 378:be043393235b 233 .weak EXTI2_3_IRQHandler
mbed_official 378:be043393235b 234 .thumb_set EXTI2_3_IRQHandler,Default_Handler
mbed_official 378:be043393235b 235
mbed_official 378:be043393235b 236 .weak EXTI4_15_IRQHandler
mbed_official 378:be043393235b 237 .thumb_set EXTI4_15_IRQHandler,Default_Handler
mbed_official 378:be043393235b 238
mbed_official 378:be043393235b 239 .weak TSC_IRQHandler
mbed_official 378:be043393235b 240 .thumb_set TSC_IRQHandler,Default_Handler
mbed_official 378:be043393235b 241
mbed_official 378:be043393235b 242 .weak DMA1_Channel1_IRQHandler
mbed_official 378:be043393235b 243 .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 244
mbed_official 378:be043393235b 245 .weak DMA1_Channel2_3_IRQHandler
mbed_official 378:be043393235b 246 .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler
mbed_official 378:be043393235b 247
mbed_official 378:be043393235b 248 .weak DMA1_Channel4_5_6_7_IRQHandler
mbed_official 378:be043393235b 249 .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler
mbed_official 378:be043393235b 250
mbed_official 378:be043393235b 251 .weak ADC1_COMP_IRQHandler
mbed_official 378:be043393235b 252 .thumb_set ADC1_COMP_IRQHandler,Default_Handler
mbed_official 378:be043393235b 253
mbed_official 378:be043393235b 254 .weak LPTIM1_IRQHandler
mbed_official 378:be043393235b 255 .thumb_set LPTIM1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 256
mbed_official 378:be043393235b 257 .weak TIM2_IRQHandler
mbed_official 378:be043393235b 258 .thumb_set TIM2_IRQHandler,Default_Handler
mbed_official 378:be043393235b 259
mbed_official 378:be043393235b 260 .weak TIM6_DAC_IRQHandler
mbed_official 378:be043393235b 261 .thumb_set TIM6_DAC_IRQHandler,Default_Handler
mbed_official 378:be043393235b 262
mbed_official 378:be043393235b 263 .weak TIM21_IRQHandler
mbed_official 378:be043393235b 264 .thumb_set TIM21_IRQHandler,Default_Handler
mbed_official 378:be043393235b 265
mbed_official 378:be043393235b 266 .weak TIM22_IRQHandler
mbed_official 378:be043393235b 267 .thumb_set TIM22_IRQHandler,Default_Handler
mbed_official 378:be043393235b 268
mbed_official 378:be043393235b 269 .weak I2C1_IRQHandler
mbed_official 378:be043393235b 270 .thumb_set I2C1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 271
mbed_official 378:be043393235b 272 .weak I2C2_IRQHandler
mbed_official 378:be043393235b 273 .thumb_set I2C2_IRQHandler,Default_Handler
mbed_official 378:be043393235b 274
mbed_official 378:be043393235b 275 .weak SPI1_IRQHandler
mbed_official 378:be043393235b 276 .thumb_set SPI1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 277
mbed_official 378:be043393235b 278 .weak SPI2_IRQHandler
mbed_official 378:be043393235b 279 .thumb_set SPI2_IRQHandler,Default_Handler
mbed_official 378:be043393235b 280
mbed_official 378:be043393235b 281 .weak USART1_IRQHandler
mbed_official 378:be043393235b 282 .thumb_set USART1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 283
mbed_official 378:be043393235b 284 .weak USART2_IRQHandler
mbed_official 378:be043393235b 285 .thumb_set USART2_IRQHandler,Default_Handler
mbed_official 378:be043393235b 286
mbed_official 378:be043393235b 287 .weak RNG_LPUART1_IRQHandler
mbed_official 378:be043393235b 288 .thumb_set RNG_LPUART1_IRQHandler,Default_Handler
mbed_official 378:be043393235b 289
mbed_official 378:be043393235b 290 .weak LCD_IRQHandler
mbed_official 378:be043393235b 291 .thumb_set LCD_IRQHandler,Default_Handler
mbed_official 378:be043393235b 292
mbed_official 378:be043393235b 293 .weak USB_IRQHandler
mbed_official 378:be043393235b 294 .thumb_set USB_IRQHandler,Default_Handler
mbed_official 378:be043393235b 295
mbed_official 378:be043393235b 296
mbed_official 378:be043393235b 297
mbed_official 378:be043393235b 298 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
mbed_official 378:be043393235b 299