mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
AnnaBridge
Date:
Wed Feb 20 22:31:08 2019 +0000
Revision:
189:f392fc9709a3
Parent:
186:707f6e361f3e
mbed library release version 165

Who changed what in which revision?

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