Skip to content

Commit bb565fd

Browse files
askuricfpistm
authored andcommitted
variant(f4): add Nucleo F410RB
Signed-off-by: gospar <[email protected]>
1 parent 61b4df8 commit bb565fd

File tree

5 files changed

+307
-0
lines changed

5 files changed

+307
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
136136
| :green_heart: | STM32F302R8 | [Nucleo F302R8](http://www.st.com/en/evaluation-tools/nucleo-f302r8.html) | *1.1.0* | |
137137
| :green_heart: | STM32F303RE | [Nucleo F303RE](http://www.st.com/en/evaluation-tools/nucleo-f303re.html) | *0.1.0* | |
138138
| :green_heart: | STM32F401RE | [Nucleo F401RE](http://www.st.com/en/evaluation-tools/nucleo-f401re.html) | *0.2.1* | |
139+
| :yellow_heart: | STM32F410RB | [Nucleo F410RB](http://www.st.com/en/evaluation-tools/nucleo-f410rb.html) | **2.11.0** | |
139140
| :green_heart: | STM32F411RE | [Nucleo F411RE](http://www.st.com/en/evaluation-tools/nucleo-f411re.html) | *0.2.1* | |
140141
| :green_heart: | STM32F446RE | [Nucleo F446RE](http://www.st.com/en/evaluation-tools/nucleo-f446re.html) | *1.1.1* | |
141142
| :green_heart: | STM32G070RB | [Nucleo G070RB](https://www.st.com/en/evaluation-tools/nucleo-g070rb.html) | *2.3.0* | |

boards.txt

+15
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,21 @@ Nucleo_64.menu.pnum.NUCLEO_F401RE.build.variant=STM32F4xx/F401R(B-C-D-E)T
586586
Nucleo_64.menu.pnum.NUCLEO_F401RE.openocd.target=stm32f4x
587587
Nucleo_64.menu.pnum.NUCLEO_F401RE.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F4xx/STM32F401.svd
588588

589+
# NUCLEO_F410RB board
590+
Nucleo_64.menu.pnum.NUCLEO_F410RB=Nucleo F410RB
591+
Nucleo_64.menu.pnum.NUCLEO_F410RB.node="NOD_F410RB,NUCLEO"
592+
Nucleo_64.menu.pnum.NUCLEO_F410RB.upload.maximum_size=131072
593+
Nucleo_64.menu.pnum.NUCLEO_F410RB.upload.maximum_data_size=32768
594+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.mcu=cortex-m4
595+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.fpu=-mfpu=fpv4-sp-d16
596+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.float-abi=-mfloat-abi=hard
597+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.board=NUCLEO_F410RB
598+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.series=STM32F4xx
599+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.product_line=STM32F410Rx
600+
Nucleo_64.menu.pnum.NUCLEO_F410RB.build.variant=STM32F4xx/F410R(8-B)(I-T)
601+
Nucleo_64.menu.pnum.NUCLEO_F410RB.openocd.target=stm32f4x
602+
Nucleo_64.menu.pnum.NUCLEO_F410RB.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F4xx/STM32F410.svd
603+
589604
# NUCLEO_F411RE board
590605
Nucleo_64.menu.pnum.NUCLEO_F411RE=Nucleo F411RE
591606
Nucleo_64.menu.pnum.NUCLEO_F411RE.node="NODE_F411RE,NUCLEO"

variants/STM32F4xx/F410R(8-B)(I-T)/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2222
generic_clock.c
2323
PeripheralPins.c
2424
variant_generic.cpp
25+
variant_NUCLEO_F410RB.cpp
2526
)
2627
target_link_libraries(variant_bin PUBLIC variant_usage)
2728

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2025, 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+
#if defined(ARDUINO_NUCLEO_F410RB)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PA_3,
19+
PA_2,
20+
PA_10,
21+
PB_3,
22+
PB_5,
23+
PB_4,
24+
PB_10,
25+
PA_8,
26+
PA_9,
27+
PC_7,
28+
PB_6,
29+
PA_7,
30+
PA_6,
31+
PA_5,
32+
PB_9,
33+
PB_8,
34+
// ST Morpho
35+
// CN7 Left Side
36+
PC_10,
37+
PC_12,
38+
NC, //D18 - BOOT0
39+
PA_13,
40+
PA_14,
41+
PA_15,
42+
PB_7,
43+
PC_13,
44+
PC_14,
45+
PC_15,
46+
PH_0,
47+
PH_1,
48+
PC_2,
49+
PC_3,
50+
// CN7 Right Side
51+
PC_11,
52+
PB_11,
53+
// CN10 Left Side
54+
PC_9,
55+
// CN10 Right side
56+
PC_8,
57+
PC_6,
58+
PC_5,
59+
PA_12,
60+
PA_11,
61+
PB_12,
62+
NC, //D39
63+
PB_2,
64+
PB_1,
65+
PB_15,
66+
PB_14,
67+
PB_13,
68+
PC_4,
69+
PA_0,
70+
PA_1,
71+
PA_4,
72+
PB_0,
73+
PC_1,
74+
PC_0
75+
};
76+
77+
// Analog (Ax) pin number array
78+
const uint32_t analogInputPin[] = {
79+
46, //A0
80+
47, //A1
81+
48, //A2
82+
49, //A3
83+
50, //A4
84+
51, //A5
85+
11, //A6
86+
12, //A7
87+
13, //A8
88+
28, //A9
89+
29, //A10
90+
35, //A11
91+
41, //A12
92+
45, //A13
93+
0, //A14
94+
1 //A15
95+
};
96+
97+
#ifdef __cplusplus
98+
extern "C" {
99+
#endif
100+
/**
101+
* @brief System Clock Configuration
102+
* SYSCLK = 100MHz for ARDUINO_NUCLEO_F410RB
103+
* @param None
104+
* @retval None
105+
*/
106+
void SystemClock_Config(void)
107+
{
108+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
109+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
110+
111+
/** Configure the main internal regulator output voltage
112+
*/
113+
__HAL_RCC_PWR_CLK_ENABLE();
114+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
115+
116+
/** Initializes the RCC Oscillators according to the specified parameters
117+
* in the RCC_OscInitTypeDef structure.
118+
*/
119+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
120+
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS;
121+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
122+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
123+
RCC_OscInitStruct.PLL.PLLM = 4;
124+
RCC_OscInitStruct.PLL.PLLN = 100;
125+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
126+
RCC_OscInitStruct.PLL.PLLQ = 4;
127+
RCC_OscInitStruct.PLL.PLLR = 2;
128+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
129+
Error_Handler();
130+
}
131+
132+
/** Initializes the CPU, AHB and APB buses clocks
133+
*/
134+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
135+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
136+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
137+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
138+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
139+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
140+
141+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) {
142+
Error_Handler();
143+
}
144+
}
145+
146+
147+
#ifdef __cplusplus
148+
}
149+
#endif
150+
#endif /* ARDUINO_GENERIC_* */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2025, 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+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PA3 PIN_A14
19+
#define PA2 PIN_A15
20+
#define PA10 2
21+
#define PB3 3
22+
#define PB5 4
23+
#define PB4 5
24+
#define PB10 6
25+
#define PA8 7
26+
#define PA9 8
27+
#define PC7 9
28+
#define PB6 10
29+
#define PA7 PIN_A6
30+
#define PA6 PIN_A7
31+
#define PA5 PIN_A8 // LD2
32+
#define PB9 14
33+
#define PB8 15
34+
// ST Morpho
35+
// CN7 Left Side
36+
#define PC10 16
37+
#define PC12 17
38+
// 18 is NC - BOOT0
39+
#define PA13 19 // SWD
40+
#define PA14 20 // SWD
41+
#define PA15 21
42+
#define PB7 22
43+
#define PC13 23 // USER_BTN
44+
#define PC14 24
45+
#define PC15 25
46+
#define PH0 26
47+
#define PH1 27
48+
#define PC2 PIN_A9
49+
#define PC3 PIN_A10
50+
// CN7 Right Side
51+
#define PC11 30
52+
#define PB11 31
53+
// CN10 Left Side
54+
#define PC9 32
55+
// CN10 Right side
56+
#define PC8 33
57+
#define PC6 34
58+
#define PC5 PIN_A11
59+
#define PA12 36
60+
#define PA11 37
61+
#define PB12 38
62+
// 39 is NC
63+
#define PB2 40
64+
#define PB1 PIN_A12
65+
#define PB15 42
66+
#define PB14 43
67+
#define PB13 44
68+
#define PC4 PIN_A13
69+
#define PA0 PIN_A0
70+
#define PA1 PIN_A1
71+
#define PA4 PIN_A2
72+
#define PB0 PIN_A3
73+
#define PC1 PIN_A4
74+
#define PC0 PIN_A5
75+
76+
// Alternate pins number
77+
#define PA2_ALT1 = (PA2 | ALT1)
78+
#define PA3_ALT1 = (PA3 | ALT1)
79+
#define PB9_ALT1 = (PB9 | ALT1)
80+
81+
#define NUM_DIGITAL_PINS 52
82+
#define NUM_ANALOG_INPUTS 16
83+
84+
// On-board LED pin number
85+
#ifndef LED_BUILTIN
86+
#define LED_BUILTIN PA5
87+
#endif
88+
89+
// On-board user button
90+
#ifndef USER_BTN
91+
#define USER_BTN PC13
92+
#endif
93+
94+
95+
// Timer Definitions
96+
// Use TIM9/TIM11 when possible as servo and tone don't need GPIO output pin
97+
#ifndef TIMER_TONE
98+
#define TIMER_TONE TIM6
99+
#endif
100+
#ifndef TIMER_SERVO
101+
#define TIMER_SERVO TIM11
102+
#endif
103+
104+
// UART Definitions
105+
#ifndef SERIAL_UART_INSTANCE
106+
#define SERIAL_UART_INSTANCE 2 //Connected to ST-Link
107+
#endif
108+
109+
// Default pin used for 'Serial' instance (ex: ST-Link)
110+
// Mandatory for Firmata
111+
#ifndef PIN_SERIAL_RX
112+
#define PIN_SERIAL_RX PA3
113+
#endif
114+
#ifndef PIN_SERIAL_TX
115+
#define PIN_SERIAL_TX PA2
116+
#endif
117+
118+
/*----------------------------------------------------------------------------
119+
* Arduino objects - C++ only
120+
*----------------------------------------------------------------------------*/
121+
122+
#ifdef __cplusplus
123+
// These serial port names are intended to allow libraries and architecture-neutral
124+
// sketches to automatically default to the correct port name for a particular type
125+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
126+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
127+
//
128+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
129+
//
130+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
131+
//
132+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
133+
//
134+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
135+
//
136+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
137+
// pins are NOT connected to anything by default.
138+
#define SERIAL_PORT_MONITOR Serial
139+
#define SERIAL_PORT_HARDWARE Serial
140+
#endif

0 commit comments

Comments
 (0)