Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2487a19

Browse files
committed
variant(f3): add Nucleo-F334R8 support
Signed-off-by: Aymane Bahssain <aymane.bahssain@st.com>
1 parente881e8c commit2487a19

File tree

4 files changed

+340
-0
lines changed

4 files changed

+340
-0
lines changed

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
139139
|:green_heart:| STM32F103RB|[Nucleo F103RB](http://www.st.com/en/evaluation-tools/nucleo-f103rb.html)|*0.2.0*||
140140
|:green_heart:| STM32F302R8|[Nucleo F302R8](http://www.st.com/en/evaluation-tools/nucleo-f302r8.html)|*1.1.0*||
141141
|:green_heart:| STM32F303RE|[Nucleo F303RE](http://www.st.com/en/evaluation-tools/nucleo-f303re.html)|*0.1.0*||
142+
|:yellow_heart:| STM32F334R8|[Nucleo-F334R8](https://www.st.com/en/evaluation-tools/nucleo-f334r8.html)|**2.12.0**||
142143
|:green_heart:| STM32F401RE|[Nucleo F401RE](http://www.st.com/en/evaluation-tools/nucleo-f401re.html)|*0.2.1*||
143144
|:green_heart:| STM32F410RB|[Nucleo F410RB](http://www.st.com/en/evaluation-tools/nucleo-f410rb.html)|*2.11.0*||
144145
|:green_heart:| STM32F411RE|[Nucleo F411RE](http://www.st.com/en/evaluation-tools/nucleo-f411re.html)|*0.2.1*||

‎boards.txt‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,21 @@ Nucleo_64.menu.pnum.NUCLEO_F303RE.build.variant=STM32F3xx/F303R(D-E)T
601601
Nucleo_64.menu.pnum.NUCLEO_F303RE.openocd.target=stm32f3x
602602
Nucleo_64.menu.pnum.NUCLEO_F303RE.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F303.svd
603603

604+
# NUCLEO_F334R8 board
605+
Nucleo_64.menu.pnum.NUCLEO_F334R8=Nucleo F334R8
606+
Nucleo_64.menu.pnum.NUCLEO_F334R8.node=NODE_F334R8
607+
Nucleo_64.menu.pnum.NUCLEO_F334R8.upload.maximum_size=65536
608+
Nucleo_64.menu.pnum.NUCLEO_F334R8.upload.maximum_data_size=12288
609+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.mcu=cortex-m4
610+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.fpu=-mfpu=fpv4-sp-d16
611+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.float-abi=-mfloat-abi=hard
612+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.board=NUCLEO_F334R8
613+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.series=STM32F3xx
614+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.product_line=STM32F334x8
615+
Nucleo_64.menu.pnum.NUCLEO_F334R8.build.variant=STM32F3xx/F303R(6-8)T_F334R(6-8)T
616+
Nucleo_64.menu.pnum.NUCLEO_F334R8.openocd.target=stm32f3x
617+
Nucleo_64.menu.pnum.NUCLEO_F334R8.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32F3xx/STM32F334.svd
618+
604619
# NUCLEO_F401RE board
605620
Nucleo_64.menu.pnum.NUCLEO_F401RE=Nucleo F401RE
606621
Nucleo_64.menu.pnum.NUCLEO_F401RE.node="NODE_F401RE,NUCLEO"
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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_F334R8)
14+
#include"pins_arduino.h"
15+
16+
// Pin number
17+
const PinName digitalPin[] = {
18+
PA_3,//D0/A19
19+
PA_2,//D1/A20
20+
PA_10,//D2
21+
PB_3,//D3
22+
PB_5,//D4
23+
PB_4,//D5
24+
PB_10,//D6
25+
PA_8,//D7
26+
PA_9,//D8
27+
PC_7,//D9
28+
PB_6,//D10
29+
PA_7,//D11/A16
30+
PA_6,//D12/A17
31+
PA_5,//D13/A18
32+
PB_9,//D14
33+
PB_8,//D15
34+
// ST Morpho
35+
// CN7 Left Side
36+
PC_10,//D16
37+
PC_12,//D17
38+
NC,//D18 - BOOT0
39+
PA_13,//D19
40+
PA_14,//D20
41+
PA_15,//D21
42+
PB_7,//D22
43+
PC_13,//D23
44+
PC_14,//D24
45+
PC_15,//D25
46+
PF_0,//D26
47+
PF_1,//D27
48+
PC_2,//D28/A6
49+
PC_3,//D29/A7
50+
// CN7 Right Side
51+
PC_11,//D30
52+
PD_2,//D31
53+
// CN10 Left Side
54+
PC_9,//D32
55+
// CN10 Right side
56+
PC_8,//D33
57+
PC_6,//D34
58+
PC_5,//D35/A8
59+
PA_12,//D36
60+
PA_11,//D37
61+
PB_12,//D38/A9
62+
PB_11,//D39
63+
PB_2,//D40/A10
64+
PB_1,//D41/A11
65+
PB_15,//D42/A12
66+
PB_14,//D43/A13
67+
PB_13,//D44/A14
68+
PC_4,//D45/A15
69+
PA_0,//D46/A0
70+
PA_1,//D47/A1
71+
PA_4,//D48/A2
72+
PB_0,//D49/A3
73+
PC_1,//D50/A4
74+
PC_0//D51/A5
75+
};
76+
77+
// Analog (Ax) pin number array
78+
constuint32_t analogInputPin[] = {
79+
46,//A0
80+
47,//A1
81+
48,//A2
82+
49,//A3
83+
50,//A4
84+
51,//A5
85+
28,//A6
86+
29,//A7
87+
35,//A8
88+
38,//A9
89+
40,//A10
90+
41,//A11
91+
42,//A12
92+
43,//A13
93+
44,//A13
94+
45,//A15
95+
11,//A16
96+
12,//A17
97+
13,//A18
98+
0,//A19
99+
1,//A20
100+
};
101+
102+
// ----------------------------------------------------------------------------
103+
104+
#ifdef __cplusplus
105+
extern"C" {
106+
#endif
107+
108+
/**
109+
* @brief System Clock Configuration
110+
* @param None
111+
* @retval None
112+
*/
113+
WEAKvoidSystemClock_Config(void)
114+
{
115+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
116+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
117+
118+
/** Initializes the RCC Oscillators according to the specified parameters
119+
* in the RCC_OscInitTypeDef structure.
120+
*/
121+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
122+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
123+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
124+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
125+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
126+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
127+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
128+
Error_Handler();
129+
}
130+
131+
/** Initializes the CPU, AHB and APB buses clocks
132+
*/
133+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
134+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
135+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
136+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
137+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
138+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
139+
140+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
141+
Error_Handler();
142+
}
143+
}
144+
145+
#ifdef __cplusplus
146+
}
147+
#endif
148+
149+
#endif/* ARDUINO_NUCLEO_F303RE*/
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
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+
19+
// Right Side
20+
// CN9
21+
#definePA3 PIN_A19
22+
#definePA2 PIN_A20
23+
#definePA10 2
24+
#definePB3 3
25+
#definePB5 4
26+
#definePB4 5
27+
#definePB10 6
28+
#definePA8 7
29+
// CN5
30+
#definePA9 8
31+
#definePC7 9
32+
#definePB6 10
33+
#definePA7 PIN_A16
34+
#definePA6 PIN_A17
35+
#definePA5 PIN_A18
36+
#definePB9 14
37+
#definePB8 15
38+
// Left Side
39+
// ST Morpho
40+
// CN7 Left Side
41+
#definePC10 16
42+
#definePC12 17
43+
//18 // BOOT0 NC NC
44+
#definePA13 19
45+
#definePA14 20
46+
#definePA15 21
47+
#definePB7 22
48+
#definePC13 23
49+
#definePC14 24
50+
#definePC15 25
51+
#definePF0 26
52+
#definePF1 27
53+
#definePC2 PIN_A6
54+
#definePC3 PIN_A7
55+
// CN7 Right Side
56+
#definePC11 30
57+
#definePD2 31
58+
// CN10 Left Side
59+
#definePC9 32
60+
// CN10 Right side
61+
#definePC8 33
62+
#definePC6 34
63+
#definePC5 PIN_A8
64+
#definePA12 36
65+
#definePA11 37
66+
#definePB12 PIN_A9
67+
#definePB11 39
68+
#definePB2 PIN_A10
69+
#definePB1 PIN_A11
70+
#definePB15 PIN_A12
71+
#definePB14 PIN_A13
72+
#definePB13 PIN_A14
73+
#definePC4 PIN_A15
74+
75+
#definePA0 PIN_A0
76+
#definePA1 PIN_A1
77+
#definePA4 PIN_A2
78+
#definePB0 PIN_A3
79+
#definePC1 PIN_A4
80+
#definePC0 PIN_A5
81+
82+
83+
// Alternate pins number
84+
#definePA1_ALT1 (PA1 | ALT1)
85+
#definePA2_ALT1 (PA2 | ALT1)
86+
#definePA3_ALT1 (PA3 | ALT1)
87+
#definePA6_ALT1 (PA6 | ALT1)
88+
#definePA7_ALT1 (PA7 | ALT1)
89+
#definePA7_ALT2 (PA7 | ALT2)
90+
#definePA9_ALT1 (PA9 | ALT1)
91+
#definePA10_ALT1 (PA10 | ALT1)
92+
#definePA11_ALT1 (PA11 | ALT1)
93+
#definePA12_ALT1 (PA12 | ALT1)
94+
#definePB0_ALT1 (PB0 | ALT1)
95+
#definePB1_ALT1 (PB1 | ALT1)
96+
#definePB4_ALT1 (PB4 | ALT1)
97+
#definePB5_ALT1 (PB5 | ALT1)
98+
#definePB7_ALT1 (PB7 | ALT1)
99+
#definePB14_ALT1 (PB14 | ALT1)
100+
#definePB15_ALT1 (PB15 | ALT1)
101+
#definePB15_ALT2 (PB15 | ALT2)
102+
#definePC0_ALT1 (PC0 | ALT1)
103+
#definePC1_ALT1 (PC1 | ALT1)
104+
#definePC2_ALT1 (PC2 | ALT1)
105+
#definePC3_ALT1 (PC3 | ALT1)
106+
107+
#defineNUM_DIGITAL_PINS 52
108+
#defineNUM_ANALOG_INPUTS 21
109+
110+
// On-board LED pin number
111+
#ifndefLED_BUILTIN
112+
#defineLED_BUILTIN LED_GREEN
113+
#endif
114+
#defineLED_GREEN PA5
115+
116+
// On-board user button
117+
#ifndefUSER_BTN
118+
#defineUSER_BTN PC13
119+
#endif
120+
121+
// Timer Definitions
122+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
123+
#ifndefTIMER_TONE
124+
#defineTIMER_TONE TIM6
125+
#endif
126+
#ifndefTIMER_SERVO
127+
#defineTIMER_SERVO TIM7
128+
#endif
129+
130+
// UART Definitions
131+
#ifndefSERIAL_UART_INSTANCE
132+
#defineSERIAL_UART_INSTANCE 2 //Connected to ST-Link
133+
#endif
134+
135+
// Default pin used for 'Serial' instance (ex: ST-Link)
136+
// Mandatory for Firmata
137+
#ifndefPIN_SERIAL_RX
138+
#definePIN_SERIAL_RX PA3
139+
#endif
140+
#ifndefPIN_SERIAL_TX
141+
#definePIN_SERIAL_TX PA2
142+
#endif
143+
144+
/* Extra HAL modules */
145+
#if !defined(HAL_DAC_MODULE_DISABLED)
146+
#defineHAL_DAC_MODULE_ENABLED
147+
#endif
148+
149+
/*----------------------------------------------------------------------------
150+
* Arduino objects - C++ only
151+
*----------------------------------------------------------------------------*/
152+
153+
#ifdef__cplusplus
154+
// These serial port names are intended to allow libraries and architecture-neutral
155+
// sketches to automatically default to the correct port name for a particular type
156+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
157+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
158+
//
159+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
160+
//
161+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
162+
//
163+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
164+
//
165+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
166+
//
167+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
168+
// pins are NOT connected to anything by default.
169+
#ifndefSERIAL_PORT_MONITOR
170+
#defineSERIAL_PORT_MONITOR Serial
171+
#endif
172+
#ifndefSERIAL_PORT_HARDWARE
173+
#defineSERIAL_PORT_HARDWARE Serial
174+
#endif
175+
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp