Skip to content

Commit 7616546

Browse files
committed
variant(wb0): add Nucleo-WB09KE support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 3770b0e commit 7616546

File tree

4 files changed

+246
-0
lines changed

4 files changed

+246
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
159159
| :green_heart: | STM32L476RG | [Nucleo L476RG](http://www.st.com/en/evaluation-tools/nucleo-l476rg.html) | *0.1.0* | |
160160
| :green_heart: | STM32U083RC | [Nucleo U083RC](http://www.st.com/en/evaluation-tools/nucleo-u083rc.html) | *2.9.0* | |
161161
| :green_heart: | STM32U385RG-Q | [Nucleo-U385RG-Q](https://www.st.com/en/evaluation-tools/nucleo-u385rg-q.html) | *2.10.0* | |
162+
| :yellow_heart: | STM32WB09KEV | [Nucleo-WB09KE](https://www.st.com/en/evaluation-tools/nucleo-wb09ke.html) | **2.11.0** | |
162163
| :green_heart: | STM32WB15CCU | [Nucleo-WB15CC](https://www.st.com/en/evaluation-tools/nucleo-wb15cc.html) | *2.5.0* | |
163164
| :green_heart: | STM32WBA55CGU | Nucleo-WBA55CG | *2.8.0* | |
164165
| :green_heart: | STM32WB55RG | [P-Nucleo-WB55RG](https://www.st.com/en/evaluation-tools/p-nucleo-wb55.html) | *1.6.0* | BLE support with [STM32duinoBLE](https://github.com/stm32duino/STM32duinoBLE) |

boards.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,20 @@ Nucleo_64.menu.pnum.NUCLEO_U385RG_Q.build.variant=STM32U3xx/U375R(E-G)TxQ_U385RG
907907
#Nucleo_64.menu.pnum.NUCLEO_U385RG_Q.openocd.target=stm32u3x
908908
#Nucleo_64.menu.pnum.NUCLEO_U385RG_Q.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32U3xx/STM32U3.svd
909909

910+
# NUCLEO_WB09KE board
911+
Nucleo_64.menu.pnum.NUCLEO_WB09KE=Nucleo WB09KE
912+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.node="NOD_WB09KE"
913+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.upload.maximum_size=524288
914+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.upload.maximum_data_size=65536
915+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.build.mcu=cortex-m0plus
916+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.build.board=NUCLEO_WB09KE
917+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.build.series=STM32WB0x
918+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.build.product_line=STM32WB09
919+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.build.variant=STM32WB0x/WB05KZV_WB05TZF_WB09KEV_WB09TEF
920+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.build.st_extra_flags=-D{build.product_line} {build.xSerial} -D__CORTEX_SC=0
921+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.openocd.target=stm32wb0x
922+
Nucleo_64.menu.pnum.NUCLEO_WB09KE.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32WB0x/STM32WB09.svd
923+
910924
# NUCLEO_WB15CC
911925
Nucleo_64.menu.pnum.NUCLEO_WB15CC=Nucleo WB15CC
912926
Nucleo_64.menu.pnum.NUCLEO_WB15CC.node="NOD_WB15CC"
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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_WB09KE)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
const PinName digitalPin[] = {
18+
PB_5, // D0/A3
19+
PB_4, // D1
20+
PB_14, // D2
21+
PB_3, // D3/A0
22+
PA_11, // D4
23+
PB_7, // D5
24+
PB_6, // D6
25+
PA_8, // D7
26+
PB_15, // D8
27+
PA_0, // D9
28+
PA_9, // D10
29+
PA_11, // D11
30+
PA_8, // D12
31+
PB_3, // D13/A0
32+
PB_7, // D14
33+
PB_6, // D15
34+
PB_2, // D16
35+
PB_1, // D17/A2
36+
PB_0, // D18
37+
PA_10, // D19
38+
PA_2, // D20
39+
PA_3, // D21/A1
40+
PB_12, // D22
41+
PB_13, // D23
42+
PA_1 // D24
43+
};
44+
45+
// Analog (Ax) pin number array
46+
const uint32_t analogInputPin[] = {
47+
3, // A0, PB3
48+
21, // A1, PA3
49+
17, // A2, PB1
50+
0 // A3, PB5
51+
};
52+
53+
// ----------------------------------------------------------------------------
54+
#ifdef __cplusplus
55+
extern "C" {
56+
#endif
57+
58+
/**
59+
* @brief System Clock Configuration
60+
* @param None
61+
* @retval None
62+
*/
63+
WEAK void SystemClock_Config(void)
64+
{
65+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
66+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
67+
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
68+
69+
/** Initializes the RCC Oscillators according to the specified parameters
70+
* in the RCC_OscInitTypeDef structure.
71+
*/
72+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
73+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
74+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
75+
Error_Handler();
76+
}
77+
78+
/** Configure the SYSCLKSource and SYSCLKDivider
79+
*/
80+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_RC64MPLL;
81+
RCC_ClkInitStruct.SYSCLKDivider = RCC_RC64MPLL_DIV1;
82+
83+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_WAIT_STATES_1) != HAL_OK) {
84+
Error_Handler();
85+
}
86+
/** Initializes the peripherals clock
87+
*/
88+
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS;
89+
PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLK_DIV4;
90+
91+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) {
92+
Error_Handler();
93+
}
94+
}
95+
96+
#ifdef __cplusplus
97+
}
98+
#endif
99+
#endif /* ARDUINO_NUCLEO_WB09KE */
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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+
// Arduino UNO V3
19+
// CN8
20+
#define PB5 PIN_A3 // Q4 Not connected by default (SB31 OFF)
21+
#define PB4 1 // A5 / Not connected by default (SB29 OFF)
22+
#define PB14 2 // Not connected by default (SB36 OFF)
23+
#define PB3 PIN_A0 // Not connected by default (SB24 OFF)
24+
#define PA11 4 // Not connected by default (SB44 OFF)
25+
#define PB7 5 // Not connected by default (SB42 OFF)
26+
#define PB6 6 // Not connected by default (SB40 OFF)
27+
#define PA8 7 // Not connected by default (SB39 OFF)
28+
// CN6
29+
#define PB15 8
30+
#define PA0 9 // Not connected by default (SB12 OFF)
31+
#define PA9 10 // SB47 ON
32+
// 11 is PA11 (4) // SB43 ON
33+
// 12 is PA8 (7) // SB41 ON
34+
// 13 is PB3 (3) // SB14 ON
35+
// 14 is PB7 (5) // SB34 ON
36+
// 15 is PB6 (6) // SB32 ON
37+
// CN7
38+
// Analog pins A0 to A5 silkscreened
39+
// None connected by default moreover some of assigned pins are not supported
40+
// as the N channel of the ADC is not supportedby the core
41+
#define PB2 16 // A1 / Not connected by default (SB13 OFF)
42+
#define PB1 PIN_A2 // Not connected by default (SB10 OFF)
43+
#define PB0 18 // A3 / Not connected by default (SB8 OFF)
44+
// ST Morpho
45+
// CN3 Left Side
46+
#define PA10 19
47+
#define PA2 20
48+
#define PA3 PIN_A1
49+
#define PB12 22
50+
#define PB13 23
51+
#define PA1 24
52+
53+
// Alternate pins number
54+
#define PA2_ALT1 (PA2 | ALT1)
55+
#define PA3_ALT1 (PA3 | ALT1)
56+
#define PA9_ALT1 (PA9 | ALT1)
57+
#define PB3_ALT1 (PB3 | ALT1)
58+
#define PB4_ALT1 (PB4 | ALT1)
59+
#define PB6_ALT1 (PB6 | ALT1)
60+
61+
#define NUM_DIGITAL_PINS 25
62+
#define NUM_ANALOG_INPUTS 4
63+
64+
// On-board LED pin number
65+
#define LED_BLUE PB1
66+
#define LED_LD1 LED_BLUE
67+
#define LED_GREEN PB4
68+
#define LED_LD2 LED_GREEN
69+
#define LED_RED PB2
70+
#define LED_LD3 LED_RED
71+
#ifndef LED_BUILTIN
72+
#define LED_BUILTIN LED_BLUE
73+
#endif
74+
75+
// On-board user button
76+
#define USER_B1 PA0
77+
#define USER_B2 PB5
78+
#define USER_B3 PB14
79+
#ifndef USER_BTN
80+
#define USER_BTN USER_B1
81+
#endif
82+
83+
// Timer Definitions
84+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
85+
#ifndef TIMER_TONE
86+
#define TIMER_TONE TIM16
87+
#endif
88+
#ifndef TIMER_SERVO
89+
#define TIMER_SERVO TIM17
90+
#endif
91+
92+
// UART Definitions
93+
#ifndef SERIAL_UART_INSTANCE
94+
#define SERIAL_UART_INSTANCE 1
95+
#endif
96+
97+
// Default pin used for generic 'Serial' instance
98+
// Mandatory for Firmata
99+
#ifndef PIN_SERIAL_RX
100+
#define PIN_SERIAL_RX PB0
101+
#endif
102+
#ifndef PIN_SERIAL_TX
103+
#define PIN_SERIAL_TX PA1
104+
#endif
105+
106+
/*----------------------------------------------------------------------------
107+
* Arduino objects - C++ only
108+
*----------------------------------------------------------------------------*/
109+
110+
#ifdef __cplusplus
111+
// These serial port names are intended to allow libraries and architecture-neutral
112+
// sketches to automatically default to the correct port name for a particular type
113+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
114+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
115+
//
116+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
117+
//
118+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
119+
//
120+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
121+
//
122+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
123+
//
124+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
125+
// pins are NOT connected to anything by default.
126+
#ifndef SERIAL_PORT_MONITOR
127+
#define SERIAL_PORT_MONITOR Serial
128+
#endif
129+
#ifndef SERIAL_PORT_HARDWARE
130+
#define SERIAL_PORT_HARDWARE Serial
131+
#endif
132+
#endif

0 commit comments

Comments
 (0)