Skip to content

Commit eb00129

Browse files
JohnK1987Jan Kamidra
andauthored
Add basic source files for MCU H503xB+H563xI + configuration for Nucleo H503RB+H563ZI (ARMmbed#294)
* add targets H503xB and H563xI * add STM32H5 basic stettings and drivers * Necessary modification in STM32 family drivers for STM32H5 family * targets.json5 modified for STM32H503xB and STM32H563xI * Prototype Upload methods for Nucleo boards of STM32H5 family * fix typo * typo fix * Add images for H5 targets * cmsis_mcu_desc fix * targets.json fix * merge all clock files to one * Enable Mbed upload method * fix mcu_family_target * fix for clock settings * move - device remove list to family level * fix targets.json --------- Co-authored-by: Jan Kamidra <[email protected]>
1 parent 71cb812 commit eb00129

33 files changed

+5315
-8
lines changed

targets/TARGET_STM/TARGET_STM32H5/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
5+
add_subdirectory(TARGET_STM32H503xB EXCLUDE_FROM_ALL)
6+
add_subdirectory(TARGET_STM32H563xI EXCLUDE_FROM_ALL)
57

68
add_library(mbed-stm32h5 INTERFACE)
79

810
target_sources(mbed-stm32h5
911
INTERFACE
12+
gpio_irq_device.c
13+
serial_device.c
14+
clock_cfg/system_clock.c
1015
)
1116

1217
target_include_directories(mbed-stm32h5
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
/* mbed Microcontroller Library
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2015-2023 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+
*/
15+
16+
#ifndef MBED_PERIPHERALNAMES_H
17+
#define MBED_PERIPHERALNAMES_H
18+
19+
#include "cmsis.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
ADC_1 = (int)ADC1_BASE,
27+
#if ADC2_BASE
28+
ADC_2 = (int)ADC2_BASE,
29+
#endif
30+
#if ADC3_BASE
31+
ADC_3 = (int)ADC3_BASE
32+
#endif
33+
} ADCName;
34+
35+
typedef enum {
36+
DAC_1 = DAC1_BASE,
37+
#if DAC2_BASE
38+
DAC_2 = DAC2_BASE,
39+
#endif
40+
} DACName;
41+
42+
typedef enum {
43+
UART_1 = (int)USART1_BASE,
44+
UART_2 = (int)USART2_BASE,
45+
UART_3 = (int)USART3_BASE,
46+
#if UART4_BASE
47+
UART_4 = (int)UART4_BASE,
48+
#endif
49+
#if UART5_BASE
50+
UART_5 = (int)UART5_BASE,
51+
#endif
52+
#if USART6_BASE
53+
UART_6 = (int)USART6_BASE,
54+
#endif
55+
#if UART7_BASE
56+
UART_7 = (int)UART7_BASE,
57+
#endif
58+
#if UART8_BASE
59+
UART_8 = (int)UART8_BASE,
60+
#endif
61+
#if UART9_BASE
62+
UART_9 = (int)UART9_BASE,
63+
#endif
64+
#if USART10_BASE
65+
UART_10 = (int)USART10_BASE,
66+
#endif
67+
#if USART11_BASE
68+
UART_11 = (int)USART11_BASE,
69+
#endif
70+
#if UART12_BASE
71+
UART_12 = (int)UART12_BASE,
72+
#endif
73+
LPUART_1 = (int)LPUART1_BASE
74+
} UARTName;
75+
76+
#define DEVICE_SPI_COUNT 6
77+
typedef enum {
78+
SPI_1 = (int)SPI1_BASE,
79+
SPI_2 = (int)SPI2_BASE,
80+
SPI_3 = (int)SPI3_BASE,
81+
#if SPI4_BASE
82+
SPI_4 = (int)SPI4_BASE,
83+
#endif
84+
#if SPI5_BASE
85+
SPI_5 = (int)SPI5_BASE,
86+
#endif
87+
#if SPI6_BASE
88+
SPI_6 = (int)SPI6_BASE
89+
#endif
90+
} SPIName;
91+
92+
typedef enum {
93+
I2C_1 = (int)I2C1_BASE,
94+
I2C_2 = (int)I2C2_BASE,
95+
#if I2C3_BASE
96+
I2C_3 = (int)I2C3_BASE,
97+
#endif
98+
#if I2C4_BASE
99+
I2C_4 = (int)I2C4_BASE,
100+
#endif
101+
} I2CName;
102+
103+
typedef enum {
104+
#if HRTIM1_BASE
105+
PWM_I = (int)HRTIM1_BASE,
106+
#endif
107+
#if TIM1_BASE
108+
PWM_1 = (int)TIM1_BASE,
109+
#endif
110+
#if TIM2_BASE
111+
PWM_2 = (int)TIM2_BASE,
112+
#endif
113+
#if TIM3_BASE
114+
PWM_3 = (int)TIM3_BASE,
115+
#endif
116+
#if TIM4_BASE
117+
PWM_4 = (int)TIM4_BASE,
118+
#endif
119+
#if TIM5_BASE
120+
PWM_5 = (int)TIM5_BASE,
121+
#endif
122+
#if TIM6_BASE
123+
PWM_6 = (int)TIM6_BASE,
124+
#endif
125+
#if TIM7_BASE
126+
PWM_7 = (int)TIM7_BASE,
127+
#endif
128+
#if TIM8_BASE
129+
PWM_8 = (int)TIM8_BASE,
130+
#endif
131+
#if TIM9_BASE
132+
PWM_9 = (int)TIM9_BASE,
133+
#endif
134+
#if TIM10_BASE
135+
PWM_10 = (int)TIM10_BASE,
136+
#endif
137+
#if TIM11_BASE
138+
PWM_11 = (int)TIM11_BASE,
139+
#endif
140+
#if TIM12_BASE
141+
PWM_12 = (int)TIM12_BASE,
142+
#endif
143+
#if TIM13_BASE
144+
PWM_13 = (int)TIM13_BASE,
145+
#endif
146+
#if TIM14_BASE
147+
PWM_14 = (int)TIM14_BASE,
148+
#endif
149+
#if TIM15_BASE
150+
PWM_15 = (int)TIM15_BASE,
151+
#endif
152+
#if TIM16_BASE
153+
PWM_16 = (int)TIM16_BASE,
154+
#endif
155+
#if TIM17_BASE
156+
PWM_17 = (int)TIM17_BASE,
157+
#endif
158+
#if TIM23_BASE
159+
PWM_23 = (int)TIM23_BASE,
160+
#endif
161+
#if TIM24_BASE
162+
PWM_24 = (int)TIM24_BASE,
163+
#endif
164+
} PWMName;
165+
166+
typedef enum {
167+
CAN_1 = (int)FDCAN1_BASE,
168+
#if FDCAN2_BASE
169+
CAN_2 = (int)FDCAN2_BASE,
170+
#endif
171+
#if FDCAN3_BASE
172+
CAN_3 = (int)FDCAN3_BASE,
173+
#endif
174+
} CANName;
175+
176+
#if defined OCTOSPI1_R_BASE
177+
typedef enum {
178+
OSPI_1 = (int)OCTOSPI1_R_BASE,
179+
} OSPIName;
180+
#endif
181+
182+
typedef enum {
183+
#if defined USB_DRD_FS_BASE
184+
USB_FS = (int)USB_DRD_FS_BASE
185+
#else
186+
USB_FS = (int)USB_DRD_BASE
187+
#endif
188+
} USBName;
189+
190+
191+
#ifdef __cplusplus
192+
}
193+
#endif
194+
195+
#endif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) 2023 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(TARGET_NUCLEO_H503RB EXCLUDE_FROM_ALL)
5+
6+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
7+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32h503xx.S)
8+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/STM32H503xB.ld)
9+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32h503xx.S)
11+
set(LINKER_FILE TOOLCHAIN_ARM/stm32h503xB.sct)
12+
endif()
13+
14+
add_library(mbed-stm32h503xb INTERFACE)
15+
16+
target_sources(mbed-stm32h503xb
17+
INTERFACE
18+
${STARTUP_FILE}
19+
)
20+
21+
target_include_directories(mbed-stm32h503xb
22+
INTERFACE
23+
.
24+
)
25+
26+
mbed_set_linker_script(mbed-stm32h503xb ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
27+
28+
target_link_libraries(mbed-stm32h503xb INTERFACE mbed-stm32h5)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2023 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(mbed-nucleo-h503rb INTERFACE)
5+
6+
target_sources(mbed-nucleo-h503rb
7+
INTERFACE
8+
PeripheralPins.c
9+
)
10+
11+
target_include_directories(mbed-nucleo-h503rb
12+
INTERFACE
13+
.
14+
)
15+
16+
target_link_libraries(mbed-nucleo-h503rb INTERFACE mbed-stm32h503xb)

0 commit comments

Comments
 (0)