Skip to content

Commit 4c7d9d1

Browse files
committed
STM32 NUCLEO_WB15CC support
1 parent 9145ac5 commit 4c7d9d1

File tree

5 files changed

+336
-0
lines changed

5 files changed

+336
-0
lines changed

targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB15xC/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (c) 2020 ARM Limited. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

4+
add_subdirectory(TARGET_NUCLEO_WB15CC EXCLUDE_FROM_ALL)
5+
46
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
57
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32wb15xx.S)
68
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32wb15xc.ld)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_library(mbed-nucleo-wb15cc INTERFACE)
5+
6+
target_sources(mbed-nucleo-wb15cc
7+
INTERFACE
8+
PeripheralPins.c
9+
)
10+
11+
target_include_directories(mbed-nucleo-wb15cc
12+
INTERFACE
13+
.
14+
)
15+
16+
target_link_libraries(mbed-nucleo-wb15cc INTERFACE mbed-stm32wb15xc)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
/* mbed Microcontroller Library
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2016-2021 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+
* Automatically generated from STM32CubeMX/db/mcu/STM32WB15CCUx.xml
16+
*/
17+
18+
#include "PeripheralPins.h"
19+
#include "mbed_toolchain.h"
20+
21+
//==============================================================================
22+
// Notes
23+
//
24+
// - The pins mentioned Px_y_ALTz are alternative possibilities which use other
25+
// HW peripheral instances. You can use them the same way as any other "normal"
26+
// pin (i.e. PwmOut pwm(PA_7_ALT0);). These pins are not displayed on the board
27+
// pinout image on mbed.org.
28+
//
29+
// - The pins which are connected to other components present on the board have
30+
// the comment "Connected to xxx". The pin function may not work properly in this
31+
// case. These pins may not be displayed on the board pinout image on mbed.org.
32+
// Please read the board reference manual and schematic for more information.
33+
//
34+
// - Warning: pins connected to the default STDIO_UART_TX and STDIO_UART_RX pins are commented
35+
// See https://os.mbed.com/teams/ST/wiki/STDIO for more information.
36+
//
37+
//==============================================================================
38+
39+
40+
41+
42+
//*** ADC ***
43+
44+
MBED_WEAK const PinMap PinMap_ADC[] = {
45+
{PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 // Connected to B1 [Push Button]
46+
{PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
47+
{PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
48+
{PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
49+
{PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
50+
{PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
51+
{PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 // Connected to B3 [Push Button]
52+
{PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
53+
{PA_8, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
54+
// {PA_9, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 // Connected to STDIO_UART_TX
55+
{NC, NC, 0}
56+
};
57+
58+
MBED_WEAK const PinMap PinMap_ADC_Internal[] = {
59+
{ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)},
60+
{ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)},
61+
{ADC_VBAT, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)},
62+
{NC, NC, 0}
63+
};
64+
65+
//*** I2C ***
66+
67+
MBED_WEAK const PinMap PinMap_I2C_SDA[] = {
68+
// {PA_10, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // Connected to STDIO_UART_RX
69+
{PB_7, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
70+
{PB_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
71+
{NC, NC, 0}
72+
};
73+
74+
MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
75+
// {PA_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // Connected to STDIO_UART_TX
76+
{PB_6, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
77+
{PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
78+
{NC, NC, 0}
79+
};
80+
81+
//*** PWM ***
82+
83+
// TIM2 cannot be used because already used by the us_ticker
84+
// (update us_ticker_data.h file if another timer is chosen)
85+
MBED_WEAK const PinMap PinMap_PWM[] = {
86+
// {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // Connected to B1 [Push Button]
87+
// {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
88+
// {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
89+
// {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
90+
// {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
91+
{PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
92+
{PA_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
93+
// {PA_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 // Connected to STDIO_UART_TX
94+
// {PA_10, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 // Connected to STDIO_UART_RX
95+
{PA_11, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
96+
// {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
97+
// {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 // Connected to JTDO
98+
{PB_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF12_TIM1, 3, 0)}, // TIM1_CH3
99+
{PB_8, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
100+
{PB_9, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
101+
{NC, NC, 0}
102+
};
103+
104+
//*** SERIAL ***
105+
106+
MBED_WEAK const PinMap PinMap_UART_TX[] = {
107+
{PA_2, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
108+
{PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to STDIO_UART_TX
109+
{PB_5, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to LD1 [Blue Led]
110+
{PB_6, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
111+
{NC, NC, 0}
112+
};
113+
114+
MBED_WEAK const PinMap PinMap_UART_RX[] = {
115+
{PA_3, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
116+
{PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to STDIO_UART_RX
117+
{PA_12, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
118+
{PB_7, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
119+
{NC, NC, 0}
120+
};
121+
122+
MBED_WEAK const PinMap PinMap_UART_RTS[] = {
123+
{PA_12, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
124+
{PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to LD3 [Red Led]
125+
{PB_3, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // Connected to JTDO
126+
{NC, NC, 0}
127+
};
128+
129+
MBED_WEAK const PinMap PinMap_UART_CTS[] = {
130+
{PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to B3 [Push Button]
131+
{PA_11, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
132+
{PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
133+
{NC, NC, 0}
134+
};
135+
136+
//*** SPI ***
137+
138+
MBED_WEAK const PinMap PinMap_SPI_MOSI[] = {
139+
{PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_SPI1)},
140+
{PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
141+
{PA_12, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
142+
{PA_13, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to JTMS
143+
{PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to LD1 [Blue Led]
144+
{NC, NC, 0}
145+
};
146+
147+
MBED_WEAK const PinMap PinMap_SPI_MISO[] = {
148+
{PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to B3 [Push Button]
149+
{PA_11, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
150+
{PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
151+
{NC, NC, 0}
152+
};
153+
154+
MBED_WEAK const PinMap PinMap_SPI_SCLK[] = {
155+
{PA_1, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
156+
{PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
157+
{PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to JTDO
158+
{NC, NC, 0}
159+
};
160+
161+
MBED_WEAK const PinMap PinMap_SPI_SSEL[] = {
162+
{PA_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
163+
{PA_14, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to JTCK
164+
{PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
165+
{PB_2, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
166+
{PB_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)},
167+
{NC, NC, 0}
168+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
/* mbed Microcontroller Library
2+
* SPDX-License-Identifier: BSD-3-Clause
3+
******************************************************************************
4+
*
5+
* Copyright (c) 2016-2021 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+
* Automatically generated from STM32CubeMX/db/mcu/STM32WB15CCUx.xml
16+
*/
17+
18+
/* MBED TARGET LIST: NUCLEO_WB15CC */
19+
20+
#ifndef MBED_PINNAMES_H
21+
#define MBED_PINNAMES_H
22+
23+
#include "cmsis.h"
24+
#include "PinNamesTypes.h"
25+
26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
30+
typedef enum {
31+
32+
PA_0 = 0x00,
33+
PA_1 = 0x01,
34+
PA_2 = 0x02,
35+
PA_3 = 0x03,
36+
PA_4 = 0x04,
37+
PA_5 = 0x05,
38+
PA_6 = 0x06,
39+
PA_7 = 0x07,
40+
PA_8 = 0x08,
41+
PA_9 = 0x09,
42+
PA_10 = 0x0A,
43+
PA_11 = 0x0B,
44+
PA_12 = 0x0C,
45+
PA_13 = 0x0D,
46+
PA_14 = 0x0E,
47+
PA_15 = 0x0F,
48+
PB_0 = 0x10,
49+
PB_1 = 0x11,
50+
PB_2 = 0x12,
51+
PB_3 = 0x13,
52+
PB_4 = 0x14,
53+
PB_5 = 0x15,
54+
PB_6 = 0x16,
55+
PB_7 = 0x17,
56+
PB_8 = 0x18,
57+
PB_9 = 0x19,
58+
PC_14 = 0x2E,
59+
PC_15 = 0x2F,
60+
PE_4 = 0x44,
61+
PH_3 = 0x73,
62+
63+
/**** ADC internal channels ****/
64+
65+
ADC_TEMP = 0xF0, // Internal pin virtual value
66+
ADC_VREF = 0xF1, // Internal pin virtual value
67+
ADC_VBAT = 0xF2, // Internal pin virtual value
68+
69+
#ifdef TARGET_FF_ARDUINO_UNO
70+
// Arduino Uno (Rev3) pins
71+
ARDUINO_UNO_A0 = PA_4,
72+
ARDUINO_UNO_A1 = PA_6,
73+
ARDUINO_UNO_A2 = PA_1,
74+
ARDUINO_UNO_A3 = PA_0,
75+
ARDUINO_UNO_A4 = PA_2,
76+
ARDUINO_UNO_A5 = PA_3,
77+
78+
ARDUINO_UNO_D0 = PB_7,
79+
ARDUINO_UNO_D1 = PB_6,
80+
ARDUINO_UNO_D2 = PB_0,
81+
ARDUINO_UNO_D3 = PA_12,
82+
ARDUINO_UNO_D4 = PB_1,
83+
ARDUINO_UNO_D5 = PA_11,
84+
ARDUINO_UNO_D6 = PA_8,
85+
ARDUINO_UNO_D7 = PE_4,
86+
ARDUINO_UNO_D8 = PB_5,
87+
ARDUINO_UNO_D9 = PA_15,
88+
ARDUINO_UNO_D10 = PB_2,
89+
ARDUINO_UNO_D11 = PA_7,
90+
ARDUINO_UNO_D12 = PB_4,
91+
ARDUINO_UNO_D13 = PA_5,
92+
ARDUINO_UNO_D14 = PB_9,
93+
ARDUINO_UNO_D15 = PB_8,
94+
#endif
95+
96+
// STDIO for console print
97+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
98+
CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
99+
#else
100+
CONSOLE_TX = PA_9,
101+
#endif
102+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
103+
CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
104+
#else
105+
CONSOLE_RX = PA_10,
106+
#endif
107+
108+
/**** OSCILLATOR pins ****/
109+
RCC_OSC32_IN = PC_14,
110+
RCC_OSC32_OUT = PC_15,
111+
112+
/**** DEBUG pins ****/
113+
SYS_JTCK_SWCLK = PA_14,
114+
SYS_JTDI = PA_15,
115+
SYS_JTDO_SWO = PB_3,
116+
SYS_JTMS_SWDIO = PA_13,
117+
SYS_JTRST = PB_4,
118+
SYS_PVD_IN = PB_7,
119+
SYS_WKUP1 = PA_0,
120+
SYS_WKUP4 = PA_2,
121+
122+
// Not connected
123+
NC = (int)0xFFFFFFFF
124+
} PinName;
125+
126+
// Standardized LED and button names
127+
#define LED1 PB_5 // LD1 [Blue Led]
128+
#define LED2 PB_0 // LD2 [Green Led]
129+
#define LED3 PB_1 // LD3 [Red Led]
130+
#define BUTTON1 PA_0 // B1 [Push Button]
131+
#define BUTTON2 PE_4 // B2 [Push Button]
132+
#define BUTTON3 PA_6 // B3 [Push Button]
133+
134+
#ifdef __cplusplus
135+
}
136+
#endif
137+
138+
#endif

targets/targets.json

+12
Original file line numberDiff line numberDiff line change
@@ -4209,6 +4209,18 @@
42094209
"STM32WB15xx"
42104210
]
42114211
},
4212+
"NUCLEO_WB15CC": {
4213+
"inherits": [
4214+
"MCU_STM32WB15xC"
4215+
],
4216+
"supported_form_factors": [
4217+
"ARDUINO_UNO"
4218+
],
4219+
"detect_code": [
4220+
"0883"
4221+
],
4222+
"device_name": "STM32WB15CCUx"
4223+
},
42124224
"MCU_STM32WB55xG": {
42134225
"inherits": [
42144226
"MCU_STM32WB"

0 commit comments

Comments
 (0)