Skip to content

Commit 6330299

Browse files
authored
Merge pull request #14578 from jeromecoutant/PR_WB55MMG
STM32 : new DISCO_WB5MMG target
2 parents 684e192 + ebc0035 commit 6330299

File tree

19 files changed

+2359
-2
lines changed

19 files changed

+2359
-2
lines changed

connectivity/drivers/mbedtls/TARGET_STM/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ elseif("STM32L4S5xI" IN_LIST MBED_TARGET_LABELS)
1515
add_subdirectory(TARGET_STM32L4S5xI)
1616
elseif("STM32L562xx" IN_LIST MBED_TARGET_LABELS)
1717
add_subdirectory(TARGET_STM32L562xx)
18-
elseif("STM32WB55xx" IN_LIST MBED_TARGET_LABELS)
19-
add_subdirectory(TARGET_STM32WB55xx)
18+
elseif("STM32WB" IN_LIST MBED_TARGET_LABELS)
19+
add_subdirectory(TARGET_STM32WB)
2020
endif()
2121

2222
target_sources(mbed-mbedtls

targets/TARGET_STM/TARGET_STM32WB/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
add_subdirectory(TARGET_STM32WB50xx EXCLUDE_FROM_ALL)
55
add_subdirectory(TARGET_STM32WB55xx EXCLUDE_FROM_ALL)
6+
add_subdirectory(TARGET_STM32WB5Mxx EXCLUDE_FROM_ALL)
7+
68
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
79

810
add_library(mbed-stm32wb INTERFACE)

targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/CMSIS/stm32wb5mxx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
#define __VTOR_PRESENT 1U /*!< Vector Table Register supported */
5252
#define __NVIC_PRIO_BITS 4U /*!< STM32WBxx uses 4 Bits for the Priority Levels */
5353
#define __Vendor_SysTickConfig 0U /*!< Set to 1 if different SysTick Config is used */
54+
#ifndef __FPU_PRESENT
5455
#define __FPU_PRESENT 1U /*!< FPU present */
56+
#endif
5557
/**
5658
* @}
5759
*/
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2020 ARM Limited. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(TARGET_DISCO_WB5MMG EXCLUDE_FROM_ALL)
5+
6+
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
7+
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32wb5mxx.S)
8+
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32wb5mxx.ld)
9+
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
10+
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32wb5mxx.S)
11+
set(LINKER_FILE TOOLCHAIN_ARM/stm32wb5mxx.sct)
12+
endif()
13+
14+
add_library(mbed-stm32wb5mxx INTERFACE)
15+
16+
target_sources(mbed-stm32wb5mxx
17+
INTERFACE
18+
${STARTUP_FILE}
19+
system_clock.c
20+
)
21+
22+
target_include_directories(mbed-stm32wb5mxx
23+
INTERFACE
24+
.
25+
)
26+
27+
mbed_set_linker_script(mbed-stm32wb5mxx ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
28+
29+
target_link_libraries(mbed-stm32wb5mxx INTERFACE mbed-stm32wb)
Lines changed: 16 additions & 0 deletions
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-disco-wb5mmg INTERFACE)
5+
6+
target_sources(mbed-disco-wb5mmg
7+
INTERFACE
8+
PeripheralPins.c
9+
)
10+
11+
target_include_directories(mbed-disco-wb5mmg
12+
INTERFACE
13+
.
14+
)
15+
16+
target_link_libraries(mbed-disco-wb5mmg INTERFACE mbed-stm32wb5mxx)

targets/TARGET_STM/TARGET_STM32WB/TARGET_STM32WB5Mxx/TARGET_DISCO_WB5MMG/PeripheralPins.c

Lines changed: 274 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
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/STM32WB5MMGHx.xml
16+
*/
17+
18+
/* MBED TARGET LIST: DISCO_WB5MMG */
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+
ALT0 = 0x100,
32+
} ALTx;
33+
34+
typedef enum {
35+
PA_0 = 0x00,
36+
PA_1 = 0x01,
37+
PA_2 = 0x02,
38+
PA_3 = 0x03,
39+
PA_4 = 0x04,
40+
PA_5 = 0x05,
41+
PA_6 = 0x06,
42+
PA_7 = 0x07,
43+
PA_7_ALT0 = PA_7 | ALT0, // same pin used for alternate HW
44+
PA_8 = 0x08,
45+
PA_9 = 0x09,
46+
PA_10 = 0x0A,
47+
PA_11 = 0x0B,
48+
PA_12 = 0x0C,
49+
PA_13 = 0x0D,
50+
PA_14 = 0x0E,
51+
PA_15 = 0x0F,
52+
PB_2 = 0x12,
53+
PB_3 = 0x13,
54+
PB_4 = 0x14,
55+
PB_5 = 0x15,
56+
PB_6 = 0x16,
57+
PB_7 = 0x17,
58+
PB_8 = 0x18,
59+
PB_9 = 0x19,
60+
PB_9_ALT0 = PB_9 | ALT0, // same pin used for alternate HW
61+
PB_10 = 0x1A,
62+
PB_11 = 0x1B,
63+
PB_12 = 0x1C,
64+
PB_13 = 0x1D,
65+
PB_14 = 0x1E,
66+
PB_15 = 0x1F,
67+
PC_0 = 0x20,
68+
PC_1 = 0x21,
69+
PC_2 = 0x22,
70+
PC_3 = 0x23,
71+
PC_4 = 0x24,
72+
PC_5 = 0x25,
73+
PC_6 = 0x26,
74+
PC_7 = 0x27,
75+
PC_8 = 0x28,
76+
PC_9 = 0x29,
77+
PC_10 = 0x2A,
78+
PC_11 = 0x2B,
79+
PC_12 = 0x2C,
80+
PC_13 = 0x2D,
81+
PD_0 = 0x30,
82+
PD_1 = 0x31,
83+
PD_2 = 0x32,
84+
PD_3 = 0x33,
85+
PD_4 = 0x34,
86+
PD_5 = 0x35,
87+
PD_6 = 0x36,
88+
PD_7 = 0x37,
89+
PD_8 = 0x38,
90+
PD_9 = 0x39,
91+
PD_10 = 0x3A,
92+
PD_11 = 0x3B,
93+
PD_12 = 0x3C,
94+
PD_13 = 0x3D,
95+
PD_14 = 0x3E,
96+
PD_15 = 0x3F,
97+
PE_0 = 0x40,
98+
PE_1 = 0x41,
99+
PE_2 = 0x42,
100+
PE_3 = 0x43,
101+
PE_4 = 0x44,
102+
PH_0 = 0x70,
103+
PH_1 = 0x71,
104+
PH_3 = 0x73,
105+
106+
/**** ADC internal channels ****/
107+
108+
ADC_TEMP = 0xF0, // Internal pin virtual value
109+
ADC_VREF = 0xF1, // Internal pin virtual value
110+
ADC_VBAT = 0xF2, // Internal pin virtual value
111+
112+
#ifdef TARGET_FF_ARDUINO_UNO
113+
// Arduino Uno (Rev3) pins
114+
ARDUINO_UNO_A0 = PC_3,
115+
ARDUINO_UNO_A1 = PA_2,
116+
ARDUINO_UNO_A2 = PA_5,
117+
ARDUINO_UNO_A3 = PC_1,
118+
ARDUINO_UNO_A4 = PC_4,
119+
ARDUINO_UNO_A5 = PC_5,
120+
ARDUINO_UNO_D0 = PC_0, // connected to LPUART switch
121+
ARDUINO_UNO_D1 = PB_5, // connected to LPUART switch
122+
ARDUINO_UNO_D2 = PD_12,
123+
ARDUINO_UNO_D3 = PD_14,
124+
ARDUINO_UNO_D4 = PE_4,
125+
ARDUINO_UNO_D5 = PB_10,
126+
ARDUINO_UNO_D6 = PE_0,
127+
ARDUINO_UNO_D7 = PB_2,
128+
ARDUINO_UNO_D8 = PD_13,
129+
ARDUINO_UNO_D9 = PD_15,
130+
ARDUINO_UNO_D10= PA_4,
131+
ARDUINO_UNO_D11= PA_7,
132+
ARDUINO_UNO_D12= PB_4,
133+
ARDUINO_UNO_D13= PA_1,
134+
ARDUINO_UNO_D14= PA_10,
135+
ARDUINO_UNO_D15= PB_8,
136+
#endif
137+
138+
// STDIO for console print
139+
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
140+
CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
141+
#else
142+
CONSOLE_TX = PB_6,
143+
#endif
144+
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
145+
CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
146+
#else
147+
CONSOLE_RX = PB_7,
148+
#endif
149+
150+
/**** USB pins ****/
151+
USB_DM = PA_11,
152+
USB_DP = PA_12,
153+
USB_NOE = PA_13,
154+
USB_NOE_ALT0 = PC_9,
155+
156+
/**** DEBUG pins ****/
157+
SYS_JTCK_SWCLK = PA_14,
158+
SYS_JTDI = PA_15,
159+
SYS_JTDO_SWO = PB_3,
160+
SYS_JTMS_SWDIO = PA_13,
161+
SYS_JTRST = PB_4,
162+
SYS_PVD_IN = PB_7,
163+
SYS_TRACECLK = PE_2,
164+
SYS_TRACED0 = PD_9,
165+
SYS_TRACED1 = PC_10,
166+
SYS_TRACED2 = PD_2,
167+
SYS_TRACED3 = PC_12,
168+
SYS_TRIG_INOUT = PD_10,
169+
SYS_WKUP1 = PA_0,
170+
SYS_WKUP2 = PC_13,
171+
SYS_WKUP3 = PC_12,
172+
SYS_WKUP4 = PA_2,
173+
SYS_WKUP5 = PC_5,
174+
175+
/**** QSPI FLASH pins ****/
176+
QSPI_FLASH1_IO0 = PB_9,
177+
QSPI_FLASH1_IO1 = PD_5,
178+
QSPI_FLASH1_IO2 = PD_6,
179+
QSPI_FLASH1_IO3 = PD_7,
180+
QSPI_FLASH1_SCK = PA_3,
181+
QSPI_FLASH1_CSN = PD_3,
182+
183+
// Not connected
184+
NC = (int)0xFFFFFFFF
185+
} PinName;
186+
187+
// Standardized LED and button names
188+
#define LED1 PA_7 // LD4 is a RGB LED connected to a PWM LED driver // TODO
189+
#define BUTTON1 PC_12
190+
#define BUTTON2 PC_13
191+
192+
#ifdef __cplusplus
193+
}
194+
#endif
195+
196+
#endif

0 commit comments

Comments
 (0)