Skip to content

Commit b60768a

Browse files
dojyorinfpistm
andcommitted
variant(H5): add Nucleo H503RB support
Signed-off-by: dojyorin <[email protected]> Co-authored-by: Frederic Pillon <[email protected]>
1 parent c793bc1 commit b60768a

File tree

4 files changed

+374
-0
lines changed

4 files changed

+374
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
125125
| :green_heart: | STM32G0B1RE | [Nucleo G0B1RE](https://www.st.com/en/evaluation-tools/nucleo-g0b1re.html) | *2.1.0* | |
126126
| :green_heart: | STM32G431RB | [Nucleo G431RB](https://www.st.com/en/evaluation-tools/nucleo-g431rb.html) | *1.7.0* | |
127127
| :green_heart: | STM32G474RE | [Nucleo G474RE](https://www.st.com/en/evaluation-tools/nucleo-g474re.html) | *1.7.0* | |
128+
| :yellow_heart: | STM32H503RB | [Nucleo H503RB](https://www.st.com/en/evaluation-tools/nucleo-h503rb.html) | **2.7.0** | |
128129
| :green_heart: | STM32L010RB | [Nucleo L010RB](https://www.st.com/en/evaluation-tools/nucleo-l010rb.html) | *2.1.0* | |
129130
| :green_heart: | STM32L053R8 | [Nucleo L053R8](http://www.st.com/en/evaluation-tools/nucleo-l053r8.html) | *0.1.0* | |
130131
| :green_heart: | STM32L073RZ | [Nucleo L073RZ](http://www.st.com/en/evaluation-tools/nucleo-l073rz.html) | *1.4.0* | |

boards.txt

+13
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,19 @@ Nucleo_64.menu.pnum.NUCLEO_G474RE.build.series=STM32G4xx
488488
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.product_line=STM32G474xx
489489
Nucleo_64.menu.pnum.NUCLEO_G474RE.build.variant=STM32G4xx/G473R(B-C-E)T_G474R(B-C-E)T_G483RET_G484RET
490490

491+
# NUCLEO H503RB
492+
Nucleo_64.menu.pnum.NUCLEO_H503RB=Nucleo H503RB
493+
Nucleo_64.menu.pnum.NUCLEO_H503RB.node=NOD_H503RB
494+
Nucleo_64.menu.pnum.NUCLEO_H503RB.upload.maximum_size=131072
495+
Nucleo_64.menu.pnum.NUCLEO_H503RB.upload.maximum_data_size=32768
496+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.mcu=cortex-m33
497+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.fpu=-mfpu=fpv4-sp-d16
498+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.float-abi=-mfloat-abi=hard
499+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.board=NUCLEO_H503RB
500+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.series=STM32H5xx
501+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.product_line=STM32H503xx
502+
Nucleo_64.menu.pnum.NUCLEO_H503RB.build.variant=STM32H5xx/H503RBT
503+
491504
# NUCLEO_L010RB board
492505
Nucleo_64.menu.pnum.NUCLEO_L010RB=Nucleo L010RB
493506
Nucleo_64.menu.pnum.NUCLEO_L010RB.node=NODE_L010RB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
14+
#if defined(ARDUINO_NUCLEO_H503RB)
15+
#include "pins_arduino.h"
16+
17+
// Digital PinName array
18+
const PinName digitalPin[] = {
19+
PB_15, // D0
20+
PB_14, // D1
21+
PA_10, // D2
22+
PB_3, // D3
23+
PB_5, // D4
24+
PB_4, // D5
25+
PB_10, // D6
26+
PA_8, // D7
27+
PC_7, // D8
28+
PC_6, // D9
29+
PC_9, // D10
30+
PA_7, // D11/A11
31+
PA_6, // D12/A12
32+
PA_5, // D13/A13
33+
PB_7, // D14
34+
PB_6, // D15
35+
// CN7 odd pins
36+
PC_10, // D16
37+
PC_12, // D17
38+
PA_13, // D18
39+
PA_14, // D19
40+
PA_15, // D20
41+
PC_13, // D21
42+
PC_14, // D22
43+
PC_15, // D23
44+
PH_0, // D24
45+
PH_1, // D25
46+
PC_2, // D26/A6
47+
PC_3, // D27/A7
48+
// CN7 even pins
49+
PC_11, // D28
50+
PD_2, // D29
51+
PA_0, // D30/A0
52+
PA_1, // D31/A1
53+
PA_2, // D32/A2
54+
PB_0, // D33/A3
55+
PC_1, // D34/A4
56+
PC_0, // D35/A5
57+
// CN10 odd pins are D0-D15
58+
// CN10 even pins
59+
PC_8, // D36
60+
PC_5, // D37/A8
61+
PA_12, // D38
62+
PA_11, // D39
63+
PB_12, // D40
64+
PB_2, // D41
65+
PB_1, // D42/A9
66+
PB_15, // D43
67+
PB_14, // D44
68+
PB_13, // D45
69+
PC_4, // D46/A10
70+
PB_8, // D47
71+
// Other
72+
PA_3, // D48/A14
73+
PA_4, // D49/A15
74+
PA_9 // D50 // USB_VBUS
75+
};
76+
77+
// Analog (Ax) pin number array
78+
const uint32_t analogInputPin[] = {
79+
30, // A0, PA0
80+
31, // A1, PA1
81+
32, // A2, PA2
82+
33, // A3, PB0
83+
34, // A4, PC1
84+
35, // A5, PC0
85+
26, // A6, PC2
86+
27, // A7, PC3
87+
37, // A8, PC5
88+
42, // A9, PB1
89+
46, // A10, PC4
90+
11, // A11, PA7
91+
12, // A12, PA6
92+
13, // A13, PA5
93+
48, // A14, PA3
94+
49 // A15, PA4
95+
};
96+
97+
#ifdef __cplusplus
98+
extern "C" {
99+
#endif
100+
101+
/**
102+
* @brief System Clock Configuration
103+
* @param None
104+
* @retval None
105+
*/
106+
WEAK void SystemClock_Config(void)
107+
{
108+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
109+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
110+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
111+
112+
/* Configure the main internal regulator output voltage */
113+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
114+
115+
while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}
116+
117+
/* Initializes the RCC Oscillators according to the specified parameters in the RCC_OscInitTypeDef structure */
118+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48 | RCC_OSCILLATORTYPE_HSE
119+
| RCC_OSCILLATORTYPE_CSI;
120+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
121+
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
122+
RCC_OscInitStruct.CSIState = RCC_CSI_ON;
123+
RCC_OscInitStruct.CSICalibrationValue = RCC_CSICALIBRATION_DEFAULT;
124+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
125+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLL1_SOURCE_HSE;
126+
RCC_OscInitStruct.PLL.PLLM = 12;
127+
RCC_OscInitStruct.PLL.PLLN = 250;
128+
RCC_OscInitStruct.PLL.PLLP = 2;
129+
RCC_OscInitStruct.PLL.PLLQ = 2;
130+
RCC_OscInitStruct.PLL.PLLR = 2;
131+
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1_VCIRANGE_1;
132+
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1_VCORANGE_WIDE;
133+
RCC_OscInitStruct.PLL.PLLFRACN = 0;
134+
135+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
136+
Error_Handler();
137+
}
138+
139+
/* Initializes the CPU, AHB and APB buses clocks */
140+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
141+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2
142+
| RCC_CLOCKTYPE_PCLK3;
143+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
144+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
145+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
146+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
147+
RCC_ClkInitStruct.APB3CLKDivider = RCC_HCLK_DIV1;
148+
149+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
150+
Error_Handler();
151+
}
152+
153+
/* Initializes the peripherals clock */
154+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPUART1 | RCC_PERIPHCLK_USB;
155+
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
156+
PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_CSI;
157+
158+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
159+
Error_Handler();
160+
}
161+
}
162+
163+
#ifdef __cplusplus
164+
}
165+
#endif
166+
167+
#endif /* ARDUINO_NUCLEO_H503RB */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
14+
#pragma once
15+
16+
/*----------------------------------------------------------------------------
17+
* STM32 pins number
18+
*----------------------------------------------------------------------------*/
19+
#define PB15 0
20+
#define PB14 1
21+
#define PA10 2
22+
#define PB3 3
23+
#define PB5 4
24+
#define PB4 5
25+
#define PB10 6
26+
#define PA8 7
27+
#define PC7 8
28+
#define PC6 9
29+
#define PC9 10
30+
#define PA7 PIN_A11
31+
#define PA6 PIN_A12
32+
#define PA5 PIN_A13
33+
#define PB7 14
34+
#define PB6 15
35+
// CN7 odd pins
36+
#define PC10 16
37+
#define PC12 17
38+
// PA13 and PA14 are shared with SWD signals connected to STLINK-V3EC.
39+
// It is not recommended to use them as I/O pins.
40+
// By default, they are used as SWD signals (SB40 and SB41 ON).
41+
#define PA13 18
42+
#define PA14 19
43+
#define PA15 20
44+
#define PC13 21
45+
#define PC14 22
46+
#define PC15 23
47+
#define PH0 24
48+
#define PH1 25
49+
#define PC2 PIN_A6
50+
#define PC3 PIN_A7
51+
// CN7 even pins
52+
#define PC11 28
53+
#define PD2 29
54+
#define PA0 PIN_A0
55+
#define PA1 PIN_A1
56+
#define PA2 PIN_A2
57+
#define PB0 PIN_A3
58+
#define PC1 PIN_A4
59+
#define PC0 PIN_A5
60+
// CN10 odd pins are D0-D15
61+
// CN10 even pins
62+
#define PC8 36
63+
#define PC5 PIN_A8
64+
#define PA12 38
65+
#define PA11 39
66+
#define PB12 40
67+
#define PB2 41
68+
#define PB1 PIN_A9
69+
// 43 is PB15 (0)
70+
// 44 is PB14 (1)
71+
#define PB13 45
72+
#define PC4 PIN_A10
73+
#define PB8 47
74+
// Other
75+
#define PA3 PIN_A14
76+
#define PA4 PIN_A15
77+
#define PA9 50 // USB_VBUS
78+
79+
// Alternate pins number
80+
#define PA0_ALT1 (PA0 | ALT1)
81+
#define PA0_ALT2 (PA0 | ALT2)
82+
#define PA1_ALT1 (PA1 | ALT1)
83+
#define PA2_ALT1 (PA2 | ALT1)
84+
#define PA3_ALT1 (PA3 | ALT1)
85+
#define PA4_ALT1 (PA4 | ALT1)
86+
#define PA5_ALT1 (PA5 | ALT1)
87+
#define PA7_ALT1 (PA7 | ALT1)
88+
#define PA7_ALT2 (PA7 | ALT2)
89+
#define PA8_ALT1 (PA8 | ALT1)
90+
#define PA8_ALT2 (PA8 | ALT2)
91+
#define PA9_ALT1 (PA9 | ALT1)
92+
#define PA10_ALT1 (PA10 | ALT1)
93+
#define PA11_ALT1 (PA11 | ALT1)
94+
#define PA12_ALT1 (PA12 | ALT1)
95+
#define PA13_ALT1 (PA13 | ALT1)
96+
#define PA14_ALT1 (PA14 | ALT1)
97+
#define PA14_ALT2 (PA14 | ALT2)
98+
#define PA15_ALT1 (PA15 | ALT1)
99+
#define PB0_ALT1 (PB0 | ALT1)
100+
#define PB1_ALT1 (PB1 | ALT1)
101+
#define PB1_ALT2 (PB1 | ALT2)
102+
#define PB2_ALT1 (PB2 | ALT1)
103+
#define PB3_ALT1 (PB3 | ALT1)
104+
#define PB4_ALT1 (PB4 | ALT1)
105+
#define PB4_ALT2 (PB4 | ALT2)
106+
#define PB5_ALT1 (PB5 | ALT1)
107+
#define PB6_ALT1 (PB6 | ALT1)
108+
#define PB6_ALT2 (PB6 | ALT2)
109+
#define PB7_ALT1 (PB7 | ALT1)
110+
#define PB13_ALT1 (PB13 | ALT1)
111+
#define PB14_ALT1 (PB14 | ALT1)
112+
#define PB15_ALT1 (PB15 | ALT1)
113+
#define PB15_ALT2 (PB15 | ALT2)
114+
#define PC1_ALT1 (PC1 | ALT1)
115+
#define PC2_ALT1 (PC2 | ALT1)
116+
#define PC3_ALT1 (PC3 | ALT1)
117+
#define PC6_ALT1 (PC6 | ALT1)
118+
#define PC7_ALT1 (PC7 | ALT1)
119+
#define PC8_ALT1 (PC8 | ALT1)
120+
#define PC9_ALT1 (PC9 | ALT1)
121+
#define PC12_ALT1 (PC12 | ALT1)
122+
123+
#define NUM_DIGITAL_PINS 51
124+
#define NUM_ANALOG_INPUTS 16
125+
126+
// On-board LED pin number
127+
#define LED_GREEN PA5
128+
#ifndef LED_BUILTIN
129+
#define LED_BUILTIN LED_GREEN
130+
#endif
131+
132+
// On-board user button
133+
#ifndef USER_BTN
134+
#define USER_BTN PC13
135+
#endif
136+
137+
// Timer Definitions
138+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
139+
#ifndef TIMER_TONE
140+
#define TIMER_TONE TIM6
141+
#endif
142+
#ifndef TIMER_SERVO
143+
#define TIMER_SERVO TIM7
144+
#endif
145+
146+
// UART Definitions
147+
#ifndef SERIAL_UART_INSTANCE
148+
#define SERIAL_UART_INSTANCE 3
149+
#endif
150+
151+
// Default pin used for generic 'Serial' instance
152+
// Mandatory for Firmata
153+
#ifndef PIN_SERIAL_RX
154+
#define PIN_SERIAL_RX PA_3_ALT1
155+
#endif
156+
#ifndef PIN_SERIAL_TX
157+
#define PIN_SERIAL_TX PA4
158+
#endif
159+
160+
#define HSE_VALUE 24000000UL /*!< Value of the External oscillator in Hz */
161+
162+
// Extra HAL modules
163+
#if !defined(HAL_DAC_MODULE_DISABLED)
164+
#define HAL_DAC_MODULE_ENABLED
165+
#endif
166+
167+
/*----------------------------------------------------------------------------
168+
* Arduino objects - C++ only
169+
*----------------------------------------------------------------------------*/
170+
171+
#ifdef __cplusplus
172+
// These serial port names are intended to allow libraries and architecture-neutral
173+
// sketches to automatically default to the correct port name for a particular type
174+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
175+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
176+
//
177+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
178+
//
179+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
180+
//
181+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
182+
//
183+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
184+
//
185+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
186+
// pins are NOT connected to anything by default.
187+
#ifndef SERIAL_PORT_MONITOR
188+
#define SERIAL_PORT_MONITOR Serial
189+
#endif
190+
#ifndef SERIAL_PORT_HARDWARE
191+
#define SERIAL_PORT_HARDWARE Serial
192+
#endif
193+
#endif

0 commit comments

Comments
 (0)