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:
Mon Sep 28 10:45:10 2015 +0100
Revision:
630:825f75ca301e
Synchronized with git revision 54fbe4144faf309c37205a5d39fa665daa919f10

Full URL: https://github.com/mbedmicro/mbed/commit/54fbe4144faf309c37205a5d39fa665daa919f10/

NUCLEO_F031K6 : Add new target

Who changed what in which revision?

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