Skip to content

Commit a03f5ff

Browse files
Adding a new target
Adding STM32L071CXCTX as a generic target to be extended. This addition required to fix some issues on stml0 library
1 parent 297300e commit a03f5ff

File tree

15 files changed

+8275
-25
lines changed

15 files changed

+8275
-25
lines changed
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
;******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
2+
;* File Name : startup_stm32l073xx.s
3+
;* Author : MCD Application Team
4+
;* Version : V1.7.1
5+
;* Date : 25-November-2016
6+
;* Description : STM32l073xx Devices vector table for MDK-ARM toolchain.
7+
;* This module performs:
8+
;* - Set the initial SP
9+
;* - Set the initial PC == Reset_Handler
10+
;* - Set the vector table entries with the exceptions ISR address
11+
;* - Branches to __main in the C library (which eventually
12+
;* calls main()).
13+
;* After Reset the Cortex-M0+ processor is in Thread mode,
14+
;* priority is Privileged, and the Stack is set to Main.
15+
;*******************************************************************************
16+
;*
17+
;* Redistribution and use in source and binary forms, with or without modification,
18+
;* are permitted provided that the following conditions are met:
19+
;* 1. Redistributions of source code must retain the above copyright notice,
20+
;* this list of conditions and the following disclaimer.
21+
;* 2. Redistributions in binary form must reproduce the above copyright notice,
22+
;* this list of conditions and the following disclaimer in the documentation
23+
;* and/or other materials provided with the distribution.
24+
;* 3. Neither the name of STMicroelectronics nor the names of its contributors
25+
;* may be used to endorse or promote products derived from this software
26+
;* without specific prior written permission.
27+
;*
28+
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29+
;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30+
;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
31+
;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
32+
;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33+
;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
34+
;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35+
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36+
;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37+
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38+
;*
39+
;*******************************************************************************
40+
41+
PRESERVE8
42+
THUMB
43+
44+
45+
; Vector Table Mapped to Address 0 at Reset
46+
AREA RESET, DATA, READONLY
47+
EXPORT __Vectors
48+
EXPORT __Vectors_End
49+
EXPORT __Vectors_Size
50+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
51+
52+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
53+
DCD Reset_Handler ; Reset Handler
54+
DCD NMI_Handler ; NMI Handler
55+
DCD HardFault_Handler ; Hard Fault Handler
56+
DCD 0 ; Reserved
57+
DCD 0 ; Reserved
58+
DCD 0 ; Reserved
59+
DCD 0 ; Reserved
60+
DCD 0 ; Reserved
61+
DCD 0 ; Reserved
62+
DCD 0 ; Reserved
63+
DCD SVC_Handler ; SVCall Handler
64+
DCD 0 ; Reserved
65+
DCD 0 ; Reserved
66+
DCD PendSV_Handler ; PendSV Handler
67+
DCD SysTick_Handler ; SysTick Handler
68+
69+
; External Interrupts
70+
DCD WWDG_IRQHandler ; Window Watchdog
71+
DCD PVD_IRQHandler ; PVD through EXTI Line detect
72+
DCD RTC_IRQHandler ; RTC through EXTI Line
73+
DCD FLASH_IRQHandler ; FLASH
74+
DCD RCC_CRS_IRQHandler ; RCC and CRS
75+
DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
76+
DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
77+
DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
78+
DCD TSC_IRQHandler ; TSC
79+
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
80+
DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
81+
DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7
82+
DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2
83+
DCD LPTIM1_IRQHandler ; LPTIM1
84+
DCD USART4_5_IRQHandler ; USART4 and USART5
85+
DCD TIM2_IRQHandler ; TIM2
86+
DCD TIM3_IRQHandler ; TIM3
87+
DCD TIM6_DAC_IRQHandler ; TIM6 and DAC
88+
DCD TIM7_IRQHandler ; TIM7
89+
DCD 0 ; Reserved
90+
DCD TIM21_IRQHandler ; TIM21
91+
DCD I2C3_IRQHandler ; I2C3
92+
DCD TIM22_IRQHandler ; TIM22
93+
DCD I2C1_IRQHandler ; I2C1
94+
DCD I2C2_IRQHandler ; I2C2
95+
DCD SPI1_IRQHandler ; SPI1
96+
DCD SPI2_IRQHandler ; SPI2
97+
DCD USART1_IRQHandler ; USART1
98+
DCD USART2_IRQHandler ; USART2
99+
DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1
100+
DCD LCD_IRQHandler ; LCD
101+
DCD USB_IRQHandler ; USB
102+
103+
__Vectors_End
104+
105+
__Vectors_Size EQU __Vectors_End - __Vectors
106+
107+
AREA |.text|, CODE, READONLY
108+
109+
; Reset handler routine
110+
Reset_Handler PROC
111+
EXPORT Reset_Handler [WEAK]
112+
IMPORT __main
113+
IMPORT SystemInit
114+
LDR R0, =SystemInit
115+
BLX R0
116+
LDR R0, =__main
117+
BX R0
118+
ENDP
119+
120+
; Dummy Exception Handlers (infinite loops which can be modified)
121+
122+
NMI_Handler PROC
123+
EXPORT NMI_Handler [WEAK]
124+
B .
125+
ENDP
126+
HardFault_Handler\
127+
PROC
128+
EXPORT HardFault_Handler [WEAK]
129+
B .
130+
ENDP
131+
SVC_Handler PROC
132+
EXPORT SVC_Handler [WEAK]
133+
B .
134+
ENDP
135+
PendSV_Handler PROC
136+
EXPORT PendSV_Handler [WEAK]
137+
B .
138+
ENDP
139+
SysTick_Handler PROC
140+
EXPORT SysTick_Handler [WEAK]
141+
B .
142+
ENDP
143+
144+
Default_Handler PROC
145+
146+
EXPORT WWDG_IRQHandler [WEAK]
147+
EXPORT PVD_IRQHandler [WEAK]
148+
EXPORT RTC_IRQHandler [WEAK]
149+
EXPORT FLASH_IRQHandler [WEAK]
150+
EXPORT RCC_CRS_IRQHandler [WEAK]
151+
EXPORT EXTI0_1_IRQHandler [WEAK]
152+
EXPORT EXTI2_3_IRQHandler [WEAK]
153+
EXPORT EXTI4_15_IRQHandler [WEAK]
154+
EXPORT TSC_IRQHandler [WEAK]
155+
EXPORT DMA1_Channel1_IRQHandler [WEAK]
156+
EXPORT DMA1_Channel2_3_IRQHandler [WEAK]
157+
EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK]
158+
EXPORT ADC1_COMP_IRQHandler [WEAK]
159+
EXPORT LPTIM1_IRQHandler [WEAK]
160+
EXPORT USART4_5_IRQHandler [WEAK]
161+
EXPORT TIM2_IRQHandler [WEAK]
162+
EXPORT TIM3_IRQHandler [WEAK]
163+
EXPORT TIM6_DAC_IRQHandler [WEAK]
164+
EXPORT TIM7_IRQHandler [WEAK]
165+
EXPORT TIM21_IRQHandler [WEAK]
166+
EXPORT TIM22_IRQHandler [WEAK]
167+
EXPORT I2C1_IRQHandler [WEAK]
168+
EXPORT I2C2_IRQHandler [WEAK]
169+
EXPORT I2C3_IRQHandler [WEAK]
170+
EXPORT SPI1_IRQHandler [WEAK]
171+
EXPORT SPI2_IRQHandler [WEAK]
172+
EXPORT USART1_IRQHandler [WEAK]
173+
EXPORT USART2_IRQHandler [WEAK]
174+
EXPORT RNG_LPUART1_IRQHandler [WEAK]
175+
EXPORT LCD_IRQHandler [WEAK]
176+
EXPORT USB_IRQHandler [WEAK]
177+
178+
179+
WWDG_IRQHandler
180+
PVD_IRQHandler
181+
RTC_IRQHandler
182+
FLASH_IRQHandler
183+
RCC_CRS_IRQHandler
184+
EXTI0_1_IRQHandler
185+
EXTI2_3_IRQHandler
186+
EXTI4_15_IRQHandler
187+
TSC_IRQHandler
188+
DMA1_Channel1_IRQHandler
189+
DMA1_Channel2_3_IRQHandler
190+
DMA1_Channel4_5_6_7_IRQHandler
191+
ADC1_COMP_IRQHandler
192+
LPTIM1_IRQHandler
193+
USART4_5_IRQHandler
194+
TIM2_IRQHandler
195+
TIM3_IRQHandler
196+
TIM6_DAC_IRQHandler
197+
TIM7_IRQHandler
198+
TIM21_IRQHandler
199+
TIM22_IRQHandler
200+
I2C1_IRQHandler
201+
I2C2_IRQHandler
202+
I2C3_IRQHandler
203+
SPI1_IRQHandler
204+
SPI2_IRQHandler
205+
USART1_IRQHandler
206+
USART2_IRQHandler
207+
RNG_LPUART1_IRQHandler
208+
LCD_IRQHandler
209+
USB_IRQHandler
210+
211+
B .
212+
213+
ENDP
214+
215+
ALIGN
216+
END
217+
218+
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#! armcc -E
2+
; Scatter-Loading Description File
3+
;
4+
; SPDX-License-Identifier: BSD-3-Clause
5+
;******************************************************************************
6+
;* @attention
7+
;*
8+
;* Copyright (c) 2016-2020 STMicroelectronics.
9+
;* All rights reserved.
10+
;*
11+
;* This software component is licensed by ST under BSD 3-Clause license,
12+
;* the "License"; You may not use this file except in compliance with the
13+
;* License. You may obtain a copy of the License at:
14+
;* opensource.org/licenses/BSD-3-Clause
15+
;*
16+
;******************************************************************************
17+
18+
#include "../cmsis_nvic.h"
19+
20+
#if !defined(MBED_APP_START)
21+
#define MBED_APP_START MBED_ROM_START
22+
#endif
23+
24+
#if !defined(MBED_APP_SIZE)
25+
#define MBED_APP_SIZE MBED_ROM_SIZE
26+
#endif
27+
28+
#if !defined(MBED_BOOT_STACK_SIZE)
29+
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
30+
#define MBED_BOOT_STACK_SIZE 0x400
31+
#endif
32+
33+
/* Round up VECTORS_SIZE to 8 bytes */
34+
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
35+
36+
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
37+
38+
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
39+
*.o (RESET, +First)
40+
*(InRoot$$Sections)
41+
.ANY (+RO)
42+
}
43+
44+
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
45+
.ANY (+RW +ZI)
46+
}
47+
48+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
49+
}
50+
51+
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
52+
}
53+
}

0 commit comments

Comments
 (0)