Skip to content

Commit 1dea16b

Browse files
authored
Merge pull request #13611 from alcheagle/stm32l071xx-fixes
Edit on Toolchain linker files for stm32L071xx target
2 parents efd385d + b997020 commit 1dea16b

File tree

5 files changed

+3508
-3542
lines changed

5 files changed

+3508
-3542
lines changed

targets/TARGET_STM/TARGET_STM32L0/TARGET_MCU_STM32L071xx/device/TOOLCHAIN_GCC_ARM/STM32L071xx.ld

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
3030
/* This value is normally defined by the tools
3131
to 0x1000 for bare metal and 0x400 for RTOS */
32-
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
32+
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
3333
#endif
3434

3535
/* Round up VECTORS_SIZE to 8 bytes */

targets/TARGET_STM/TARGET_STM32L0/TARGET_MCU_STM32L071xx/device/TOOLCHAIN_GCC_ARM/startup_stm32l071xx.S

+46-32
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
1-
/* mbed Microcontroller Library
2-
* SPDX-License-Identifier: BSD-3-Clause
3-
******************************************************************************
4-
*
5-
* Copyright (c) 2020 STMicroelectronics.
6-
* All rights reserved.
7-
*
8-
* This software component is licensed by ST under BSD 3-Clause license,
9-
* the "License"; You may not use this file except in compliance with the
10-
* License. You may obtain a copy of the License at:
11-
* opensource.org/licenses/BSD-3-Clause
12-
*
13-
******************************************************************************
14-
* @file startup_stm32l071xx.s
15-
* @author MCD Application Team
16-
* @brief STM32L071xx Devices vector table for GCC toolchain.
17-
* This module performs:
18-
* - Set the initial SP
19-
* - Set the initial PC == Reset_Handler,
20-
* - Set the vector table entries with the exceptions ISR address
21-
* - Branches to main in the C library (which eventually
22-
* calls main()).
23-
* After Reset the Cortex-M0+ processor is in Thread mode,
24-
* priority is Privileged, and the Stack is set to Main.
25-
******************************************************************************
26-
*/
1+
/**
2+
******************************************************************************
3+
* @file startup_stm32l071xx.s
4+
* @author MCD Application Team
5+
* @brief STM32L071xx Devices vector table for GCC toolchain.
6+
* This module performs:
7+
* - Set the initial SP
8+
* - Set the initial PC == Reset_Handler,
9+
* - Set the vector table entries with the exceptions ISR address
10+
* - Branches to main in the C library (which eventually
11+
* calls main()).
12+
* After Reset the Cortex-M0+ processor is in Thread mode,
13+
* priority is Privileged, and the Stack is set to Main.
14+
******************************************************************************
15+
*
16+
* Redistribution and use in source and binary forms, with or without modification,
17+
* are permitted provided that the following conditions are met:
18+
* 1. Redistributions of source code must retain the above copyright notice,
19+
* this list of conditions and the following disclaimer.
20+
* 2. Redistributions in binary form must reproduce the above copyright notice,
21+
* this list of conditions and the following disclaimer in the documentation
22+
* and/or other materials provided with the distribution.
23+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
24+
* may be used to endorse or promote products derived from this software
25+
* without specific prior written permission.
26+
*
27+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
*
38+
******************************************************************************
39+
*/
2740

2841
.syntax unified
2942
.cpu cortex-m0plus
@@ -48,9 +61,9 @@ defined in linker script */
4861
.section .text.Reset_Handler
4962
.weak Reset_Handler
5063
.type Reset_Handler, %function
51-
Reset_Handler:
52-
ldr r0, =_estack
53-
mov sp, r0 /* set stack pointer */
64+
Reset_Handler:
65+
ldr r0, =_estack
66+
mov sp, r0 /* set stack pointer */
5467

5568
/* Copy the data segment initializers from flash to SRAM */
5669
movs r1, #0
@@ -85,12 +98,13 @@ LoopFillZerobss:
8598
/* Call the clock system intitialization function.*/
8699
bl SystemInit
87100
/* Call static constructors */
88-
bl __libc_init_array
101+
//bl __libc_init_array
89102
/* Call the application's entry point.*/
90-
bl main
103+
//bl main
104+
bl _start
91105

92106
LoopForever:
93-
b LoopForever
107+
b LoopForever
94108

95109

96110
.size Reset_Handler, .-Reset_Handler

targets/TARGET_STM/TARGET_STM32L0/TARGET_MCU_STM32L071xx/device/cmsis_nvic.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define MBED_RAM_SIZE 0x5000 // 20 KB
3333
#endif
3434

35-
#define NVIC_NUM_VECTORS 32
35+
#define NVIC_NUM_VECTORS 48
3636
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
3737

3838
#endif

0 commit comments

Comments
 (0)