Skip to content

Commit d5adca1

Browse files
author
Andrea Gilardoni
committed
Edit on Toolchain linker files
Previous one were not working, using nucleol073RZ files
1 parent 0db72d0 commit d5adca1

File tree

4 files changed

+4894
-3592
lines changed

4 files changed

+4894
-3592
lines changed

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 67 additions & 61 deletions
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_stm32l073xx.s
4+
* @author MCD Application Team
5+
* @brief STM32L073xx Devices vector table for Atollic TrueSTUDIO 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
@@ -40,17 +53,13 @@ defined in linker script */
4053
.word _sdata
4154
/* end address for the .data section. defined in linker script */
4255
.word _edata
43-
/* start address for the .bss section. defined in linker script */
44-
.word _sbss
45-
/* end address for the .bss section. defined in linker script */
46-
.word _ebss
4756

4857
.section .text.Reset_Handler
4958
.weak Reset_Handler
5059
.type Reset_Handler, %function
51-
Reset_Handler:
52-
ldr r0, =_estack
53-
mov sp, r0 /* set stack pointer */
60+
Reset_Handler:
61+
ldr r0, =_estack
62+
mov sp, r0 /* set stack pointer */
5463

5564
/* Copy the data segment initializers from flash to SRAM */
5665
movs r1, #0
@@ -68,29 +77,17 @@ LoopCopyDataInit:
6877
adds r2, r0, r1
6978
cmp r2, r3
7079
bcc CopyDataInit
71-
ldr r2, =_sbss
72-
b LoopFillZerobss
73-
/* Zero fill the bss segment. */
74-
FillZerobss:
75-
movs r3, #0
76-
str r3, [r2]
77-
adds r2, r2, #4
78-
79-
80-
LoopFillZerobss:
81-
ldr r3, = _ebss
82-
cmp r2, r3
83-
bcc FillZerobss
8480

8581
/* Call the clock system intitialization function.*/
8682
bl SystemInit
8783
/* Call static constructors */
88-
bl __libc_init_array
84+
//bl __libc_init_array
8985
/* Call the application's entry point.*/
90-
bl main
86+
//bl main
87+
bl _start
9188

9289
LoopForever:
93-
b LoopForever
90+
b LoopForever
9491

9592

9693
.size Reset_Handler, .-Reset_Handler
@@ -141,11 +138,11 @@ g_pfnVectors:
141138
.word PVD_IRQHandler /* PVD through EXTI Line detection */
142139
.word RTC_IRQHandler /* RTC through the EXTI line */
143140
.word FLASH_IRQHandler /* FLASH */
144-
.word RCC_IRQHandler /* RCC */
141+
.word RCC_CRS_IRQHandler /* RCC and CRS */
145142
.word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */
146143
.word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */
147144
.word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */
148-
.word 0 /* Reserved */
145+
.word TSC_IRQHandler /* TSC */
149146
.word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */
150147
.word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */
151148
.word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/
@@ -154,7 +151,7 @@ g_pfnVectors:
154151
.word USART4_5_IRQHandler /* USART4 and USART 5 */
155152
.word TIM2_IRQHandler /* TIM2 */
156153
.word TIM3_IRQHandler /* TIM3 */
157-
.word TIM6_IRQHandler /* TIM6 and DAC */
154+
.word TIM6_DAC_IRQHandler /* TIM6 and DAC */
158155
.word TIM7_IRQHandler /* TIM7 */
159156
.word 0 /* Reserved */
160157
.word TIM21_IRQHandler /* TIM21 */
@@ -166,9 +163,9 @@ g_pfnVectors:
166163
.word SPI2_IRQHandler /* SPI2 */
167164
.word USART1_IRQHandler /* USART1 */
168165
.word USART2_IRQHandler /* USART2 */
169-
.word LPUART1_IRQHandler /* LPUART1 */
170-
.word 0 /* Reserved */
171-
.word 0 /* Reserved */
166+
.word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */
167+
.word LCD_IRQHandler /* LCD */
168+
.word USB_IRQHandler /* USB */
172169

173170
/*******************************************************************************
174171
*
@@ -205,8 +202,8 @@ g_pfnVectors:
205202
.weak FLASH_IRQHandler
206203
.thumb_set FLASH_IRQHandler,Default_Handler
207204

208-
.weak RCC_IRQHandler
209-
.thumb_set RCC_IRQHandler,Default_Handler
205+
.weak RCC_CRS_IRQHandler
206+
.thumb_set RCC_CRS_IRQHandler,Default_Handler
210207

211208
.weak EXTI0_1_IRQHandler
212209
.thumb_set EXTI0_1_IRQHandler,Default_Handler
@@ -217,6 +214,9 @@ g_pfnVectors:
217214
.weak EXTI4_15_IRQHandler
218215
.thumb_set EXTI4_15_IRQHandler,Default_Handler
219216

217+
.weak TSC_IRQHandler
218+
.thumb_set TSC_IRQHandler,Default_Handler
219+
220220
.weak DMA1_Channel1_IRQHandler
221221
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
222222

@@ -241,8 +241,8 @@ g_pfnVectors:
241241
.weak TIM3_IRQHandler
242242
.thumb_set TIM3_IRQHandler,Default_Handler
243243

244-
.weak TIM6_IRQHandler
245-
.thumb_set TIM6_IRQHandler,Default_Handler
244+
.weak TIM6_DAC_IRQHandler
245+
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
246246

247247
.weak TIM7_IRQHandler
248248
.thumb_set TIM7_IRQHandler,Default_Handler
@@ -274,8 +274,14 @@ g_pfnVectors:
274274
.weak USART2_IRQHandler
275275
.thumb_set USART2_IRQHandler,Default_Handler
276276

277-
.weak LPUART1_IRQHandler
278-
.thumb_set LPUART1_IRQHandler,Default_Handler
277+
.weak RNG_LPUART1_IRQHandler
278+
.thumb_set RNG_LPUART1_IRQHandler,Default_Handler
279+
280+
.weak LCD_IRQHandler
281+
.thumb_set LCD_IRQHandler,Default_Handler
282+
283+
.weak USB_IRQHandler
284+
.thumb_set USB_IRQHandler,Default_Handler
279285

280286

281287

0 commit comments

Comments
 (0)