Skip to content

Commit c6d814e

Browse files
authored
Merge pull request #15215 from jeromecoutant/PR_STM32L4_ADD
STM32 : add MCU_STM32L4P5xG and MCU_STM32L412xB support
2 parents f515608 + 12757de commit c6d814e

File tree

19 files changed

+3775
-0
lines changed

19 files changed

+3775
-0
lines changed

targets/TARGET_STM/TARGET_STM32L4/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
add_subdirectory(TARGET_STM32L412xB EXCLUDE_FROM_ALL)
45
add_subdirectory(TARGET_STM32L432xC EXCLUDE_FROM_ALL)
56
add_subdirectory(TARGET_STM32L433xC EXCLUDE_FROM_ALL)
67
add_subdirectory(TARGET_STM32L443xC EXCLUDE_FROM_ALL)
@@ -10,6 +11,7 @@ add_subdirectory(TARGET_STM32L475xG EXCLUDE_FROM_ALL)
1011
add_subdirectory(TARGET_STM32L476xG EXCLUDE_FROM_ALL)
1112
add_subdirectory(TARGET_STM32L486xG EXCLUDE_FROM_ALL)
1213
add_subdirectory(TARGET_STM32L496xG EXCLUDE_FROM_ALL)
14+
add_subdirectory(TARGET_STM32L4P5xG EXCLUDE_FROM_ALL)
1315
add_subdirectory(TARGET_STM32L4R5xI EXCLUDE_FROM_ALL)
1416
add_subdirectory(TARGET_STM32L4R9xI EXCLUDE_FROM_ALL)
1517
add_subdirectory(TARGET_STM32L4S5xI EXCLUDE_FROM_ALL)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
5+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l412xx.S)
6+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32l412xb.ld)
7+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
8+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l412xx.S)
9+
set(LINKER_FILE TOOLCHAIN_ARM/stm32l412xb.sct)
10+
endif()
11+
12+
add_library(mbed-stm32l412xb INTERFACE)
13+
14+
target_include_directories(mbed-stm32l412xb
15+
INTERFACE
16+
.
17+
)
18+
19+
target_sources(mbed-stm32l412xb
20+
INTERFACE
21+
${STARTUP_FILE}
22+
)
23+
24+
mbed_set_linker_script(mbed-stm32l412xb ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
25+
26+
target_link_libraries(mbed-stm32l412xb INTERFACE mbed-stm32l4)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
;*******************************************************************************
2+
;* File Name : startup_stm32l412xx.s
3+
;* Author : MCD Application Team
4+
;* Description : STM32L412xx Ultra Low Power devices vector table for MDK-ARM toolchain.
5+
;* This module performs:
6+
;* - Set the initial SP
7+
;* - Set the initial PC == Reset_Handler
8+
;* - Set the vector table entries with the exceptions ISR address
9+
;* - Branches to __main in the C library (which eventually
10+
;* calls main()).
11+
;* After Reset the Cortex-M4 processor is in Thread mode,
12+
;* priority is Privileged, and the Stack is set to Main.
13+
;*******************************************************************************
14+
;*
15+
;* <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
16+
;* All rights reserved.</center></h2>
17+
;*
18+
;* This software component is licensed by ST under Apache License, Version 2.0,
19+
;* the "License"; You may not use this file except in compliance with the
20+
;* License. You may obtain a copy of the License at:
21+
;* opensource.org/licenses/Apache-2.0
22+
;*
23+
;*******************************************************************************
24+
;* <<< Use Configuration Wizard in Context Menu >>>
25+
PRESERVE8
26+
THUMB
27+
28+
29+
; Vector Table Mapped to Address 0 at Reset
30+
AREA RESET, DATA, READONLY
31+
EXPORT __Vectors
32+
EXPORT __Vectors_End
33+
EXPORT __Vectors_Size
34+
35+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
36+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
37+
DCD Reset_Handler ; Reset Handler
38+
DCD NMI_Handler ; NMI Handler
39+
DCD HardFault_Handler ; Hard Fault Handler
40+
DCD MemManage_Handler ; MPU Fault Handler
41+
DCD BusFault_Handler ; Bus Fault Handler
42+
DCD UsageFault_Handler ; Usage Fault Handler
43+
DCD 0 ; Reserved
44+
DCD 0 ; Reserved
45+
DCD 0 ; Reserved
46+
DCD 0 ; Reserved
47+
DCD SVC_Handler ; SVCall Handler
48+
DCD DebugMon_Handler ; Debug Monitor Handler
49+
DCD 0 ; Reserved
50+
DCD PendSV_Handler ; PendSV Handler
51+
DCD SysTick_Handler ; SysTick Handler
52+
53+
; External Interrupts
54+
DCD WWDG_IRQHandler ; Window WatchDog
55+
DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection
56+
DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line
57+
DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line
58+
DCD FLASH_IRQHandler ; FLASH
59+
DCD RCC_IRQHandler ; RCC
60+
DCD EXTI0_IRQHandler ; EXTI Line0
61+
DCD EXTI1_IRQHandler ; EXTI Line1
62+
DCD EXTI2_IRQHandler ; EXTI Line2
63+
DCD EXTI3_IRQHandler ; EXTI Line3
64+
DCD EXTI4_IRQHandler ; EXTI Line4
65+
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
66+
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
67+
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
68+
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
69+
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
70+
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
71+
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
72+
DCD ADC1_2_IRQHandler ; ADC1&2
73+
DCD 0 ; Reserved
74+
DCD 0 ; Reserved
75+
DCD 0 ; Reserved
76+
DCD 0 ; Reserved
77+
DCD EXTI9_5_IRQHandler ; External Line[9:5]s
78+
DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15
79+
DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16
80+
DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation
81+
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
82+
DCD TIM2_IRQHandler ; TIM2
83+
DCD 0 ; Reserved
84+
DCD 0 ; Reserved
85+
DCD I2C1_EV_IRQHandler ; I2C1 Event
86+
DCD I2C1_ER_IRQHandler ; I2C1 Error
87+
DCD I2C2_EV_IRQHandler ; I2C2 Event
88+
DCD I2C2_ER_IRQHandler ; I2C2 Error
89+
DCD SPI1_IRQHandler ; SPI1
90+
DCD SPI2_IRQHandler ; SPI2
91+
DCD USART1_IRQHandler ; USART1
92+
DCD USART2_IRQHandler ; USART2
93+
DCD USART3_IRQHandler ; USART3
94+
DCD EXTI15_10_IRQHandler ; External Line[15:10]
95+
DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line
96+
DCD 0 ; Reserved
97+
DCD 0 ; Reserved
98+
DCD 0 ; Reserved
99+
DCD 0 ; Reserved
100+
DCD 0 ; Reserved
101+
DCD 0 ; Reserved
102+
DCD 0 ; Reserved
103+
DCD 0 ; Reserved
104+
DCD 0 ; Reserved
105+
DCD 0 ; Reserved
106+
DCD 0 ; Reserved
107+
DCD 0 ; Reserved
108+
DCD TIM6_IRQHandler ; TIM6
109+
DCD 0 ; Reserved
110+
DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1
111+
DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2
112+
DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3
113+
DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4
114+
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5
115+
DCD 0 ; Reserved
116+
DCD 0 ; Reserved
117+
DCD 0 ; Reserved
118+
DCD COMP_IRQHandler ; COMP Interrupt
119+
DCD LPTIM1_IRQHandler ; LP TIM1 interrupt
120+
DCD LPTIM2_IRQHandler ; LP TIM2 interrupt
121+
DCD USB_IRQHandler ; USB FS
122+
DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6
123+
DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7
124+
DCD LPUART1_IRQHandler ; LP UART1 interrupt
125+
DCD QUADSPI_IRQHandler ; Quad SPI global interrupt
126+
DCD I2C3_EV_IRQHandler ; I2C3 event
127+
DCD I2C3_ER_IRQHandler ; I2C3 error
128+
DCD 0 ; Reserved
129+
DCD 0 ; Reserved
130+
DCD 0 ; Reserved
131+
DCD TSC_IRQHandler ; Touch Sense Controller global interrupt
132+
DCD 0 ; Reserved
133+
DCD 0 ; Reserved
134+
DCD RNG_IRQHandler ; RNG global interrupt
135+
DCD FPU_IRQHandler ; FPU
136+
DCD CRS_IRQHandler ; CRS interrupt
137+
138+
__Vectors_End
139+
140+
__Vectors_Size EQU __Vectors_End - __Vectors
141+
142+
AREA |.text|, CODE, READONLY
143+
144+
; Reset handler
145+
Reset_Handler PROC
146+
EXPORT Reset_Handler [WEAK]
147+
IMPORT SystemInit
148+
IMPORT __main
149+
150+
LDR R0, =SystemInit
151+
BLX R0
152+
LDR R0, =__main
153+
BX R0
154+
ENDP
155+
156+
; Dummy Exception Handlers (infinite loops which can be modified)
157+
158+
NMI_Handler PROC
159+
EXPORT NMI_Handler [WEAK]
160+
B .
161+
ENDP
162+
HardFault_Handler\
163+
PROC
164+
EXPORT HardFault_Handler [WEAK]
165+
B .
166+
ENDP
167+
MemManage_Handler\
168+
PROC
169+
EXPORT MemManage_Handler [WEAK]
170+
B .
171+
ENDP
172+
BusFault_Handler\
173+
PROC
174+
EXPORT BusFault_Handler [WEAK]
175+
B .
176+
ENDP
177+
UsageFault_Handler\
178+
PROC
179+
EXPORT UsageFault_Handler [WEAK]
180+
B .
181+
ENDP
182+
SVC_Handler PROC
183+
EXPORT SVC_Handler [WEAK]
184+
B .
185+
ENDP
186+
DebugMon_Handler\
187+
PROC
188+
EXPORT DebugMon_Handler [WEAK]
189+
B .
190+
ENDP
191+
PendSV_Handler PROC
192+
EXPORT PendSV_Handler [WEAK]
193+
B .
194+
ENDP
195+
SysTick_Handler PROC
196+
EXPORT SysTick_Handler [WEAK]
197+
B .
198+
ENDP
199+
200+
Default_Handler PROC
201+
202+
EXPORT WWDG_IRQHandler [WEAK]
203+
EXPORT PVD_PVM_IRQHandler [WEAK]
204+
EXPORT TAMP_STAMP_IRQHandler [WEAK]
205+
EXPORT RTC_WKUP_IRQHandler [WEAK]
206+
EXPORT FLASH_IRQHandler [WEAK]
207+
EXPORT RCC_IRQHandler [WEAK]
208+
EXPORT EXTI0_IRQHandler [WEAK]
209+
EXPORT EXTI1_IRQHandler [WEAK]
210+
EXPORT EXTI2_IRQHandler [WEAK]
211+
EXPORT EXTI3_IRQHandler [WEAK]
212+
EXPORT EXTI4_IRQHandler [WEAK]
213+
EXPORT DMA1_Channel1_IRQHandler [WEAK]
214+
EXPORT DMA1_Channel2_IRQHandler [WEAK]
215+
EXPORT DMA1_Channel3_IRQHandler [WEAK]
216+
EXPORT DMA1_Channel4_IRQHandler [WEAK]
217+
EXPORT DMA1_Channel5_IRQHandler [WEAK]
218+
EXPORT DMA1_Channel6_IRQHandler [WEAK]
219+
EXPORT DMA1_Channel7_IRQHandler [WEAK]
220+
EXPORT ADC1_2_IRQHandler [WEAK]
221+
EXPORT EXTI9_5_IRQHandler [WEAK]
222+
EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK]
223+
EXPORT TIM1_UP_TIM16_IRQHandler [WEAK]
224+
EXPORT TIM1_TRG_COM_IRQHandler [WEAK]
225+
EXPORT TIM1_CC_IRQHandler [WEAK]
226+
EXPORT TIM2_IRQHandler [WEAK]
227+
EXPORT I2C1_EV_IRQHandler [WEAK]
228+
EXPORT I2C1_ER_IRQHandler [WEAK]
229+
EXPORT I2C2_EV_IRQHandler [WEAK]
230+
EXPORT I2C2_ER_IRQHandler [WEAK]
231+
EXPORT SPI1_IRQHandler [WEAK]
232+
EXPORT SPI2_IRQHandler [WEAK]
233+
EXPORT USART1_IRQHandler [WEAK]
234+
EXPORT USART2_IRQHandler [WEAK]
235+
EXPORT USART3_IRQHandler [WEAK]
236+
EXPORT EXTI15_10_IRQHandler [WEAK]
237+
EXPORT RTC_Alarm_IRQHandler [WEAK]
238+
EXPORT TIM6_IRQHandler [WEAK]
239+
EXPORT DMA2_Channel1_IRQHandler [WEAK]
240+
EXPORT DMA2_Channel2_IRQHandler [WEAK]
241+
EXPORT DMA2_Channel3_IRQHandler [WEAK]
242+
EXPORT DMA2_Channel4_IRQHandler [WEAK]
243+
EXPORT DMA2_Channel5_IRQHandler [WEAK]
244+
EXPORT COMP_IRQHandler [WEAK]
245+
EXPORT LPTIM1_IRQHandler [WEAK]
246+
EXPORT LPTIM2_IRQHandler [WEAK]
247+
EXPORT USB_IRQHandler [WEAK]
248+
EXPORT DMA2_Channel6_IRQHandler [WEAK]
249+
EXPORT DMA2_Channel7_IRQHandler [WEAK]
250+
EXPORT LPUART1_IRQHandler [WEAK]
251+
EXPORT QUADSPI_IRQHandler [WEAK]
252+
EXPORT I2C3_EV_IRQHandler [WEAK]
253+
EXPORT I2C3_ER_IRQHandler [WEAK]
254+
EXPORT TSC_IRQHandler [WEAK]
255+
EXPORT RNG_IRQHandler [WEAK]
256+
EXPORT FPU_IRQHandler [WEAK]
257+
EXPORT CRS_IRQHandler [WEAK]
258+
259+
WWDG_IRQHandler
260+
PVD_PVM_IRQHandler
261+
TAMP_STAMP_IRQHandler
262+
RTC_WKUP_IRQHandler
263+
FLASH_IRQHandler
264+
RCC_IRQHandler
265+
EXTI0_IRQHandler
266+
EXTI1_IRQHandler
267+
EXTI2_IRQHandler
268+
EXTI3_IRQHandler
269+
EXTI4_IRQHandler
270+
DMA1_Channel1_IRQHandler
271+
DMA1_Channel2_IRQHandler
272+
DMA1_Channel3_IRQHandler
273+
DMA1_Channel4_IRQHandler
274+
DMA1_Channel5_IRQHandler
275+
DMA1_Channel6_IRQHandler
276+
DMA1_Channel7_IRQHandler
277+
ADC1_2_IRQHandler
278+
EXTI9_5_IRQHandler
279+
TIM1_BRK_TIM15_IRQHandler
280+
TIM1_UP_TIM16_IRQHandler
281+
TIM1_TRG_COM_IRQHandler
282+
TIM1_CC_IRQHandler
283+
TIM2_IRQHandler
284+
I2C1_EV_IRQHandler
285+
I2C1_ER_IRQHandler
286+
I2C2_EV_IRQHandler
287+
I2C2_ER_IRQHandler
288+
SPI1_IRQHandler
289+
SPI2_IRQHandler
290+
USART1_IRQHandler
291+
USART2_IRQHandler
292+
USART3_IRQHandler
293+
EXTI15_10_IRQHandler
294+
RTC_Alarm_IRQHandler
295+
TIM6_IRQHandler
296+
DMA2_Channel1_IRQHandler
297+
DMA2_Channel2_IRQHandler
298+
DMA2_Channel3_IRQHandler
299+
DMA2_Channel4_IRQHandler
300+
DMA2_Channel5_IRQHandler
301+
COMP_IRQHandler
302+
LPTIM1_IRQHandler
303+
LPTIM2_IRQHandler
304+
USB_IRQHandler
305+
DMA2_Channel6_IRQHandler
306+
DMA2_Channel7_IRQHandler
307+
LPUART1_IRQHandler
308+
QUADSPI_IRQHandler
309+
I2C3_EV_IRQHandler
310+
I2C3_ER_IRQHandler
311+
TSC_IRQHandler
312+
RNG_IRQHandler
313+
FPU_IRQHandler
314+
CRS_IRQHandler
315+
316+
B .
317+
318+
ENDP
319+
320+
ALIGN
321+
322+
;*******************************************************************************
323+
; User Stack and Heap initialization
324+
;*******************************************************************************
325+
326+
END
327+
328+
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****

0 commit comments

Comments
 (0)