1.. zephyr:board:: stm32wb5mm_dk
2
3Overview
4********
5
6The STM32WB5MM-DK Discovery kit is designed as a complete demonstration
7and development platform for the STMicroelectronics STM32W5MMG module based
8on the Arm |reg| Cortex |reg|-M4 and Arm |reg|  Cortex |reg|-M0+ cores.
9The STM32 device is a multi-protocol wireless and ultra-low-power device
10embedding a powerful and ultra-low-power radio compliant with the
11Bluetooth |reg| Low Energy (BLE) SIG specification v5.2 and with
12IEEE 802.15.4-2011.
13
14
15STM32WB5MM-DK supports the following features:
16
17* STM32WB5MMG (1-Mbyte Flash memory, 256-Kbyte SRAM)
18    - Dual-core 32‑bit (Arm |reg| Cortex |reg|-M4 and M0+)
19    - 2.4 GHz RF transceiver
20    - 0.96-inch 128x64 OLED display
21    - 128-Mbit Quad-SPI NOR Flash Memory
22    - Temperature sensor
23    - Accelerometer/gyroscope sensor
24    - Time-of-Flight and gesture-detection sensor
25    - Digital microphone
26    - RGB LED
27    - Infrared LED
28    - 3 push-buttons (2 users and 1 reset) and 1 touch key button
29
30* Board connectors:
31    - STMod+
32    - ARDUINO |reg| Uno V3 expansion connector
33    - USB user with Micro-B connector
34    - TAG10 10-pin footprint
35
36* Flexible power-supply options:
37    - ST-LINK/V2-1 USB connector,
38    - 5 V delivered by:
39        - ARDUINO |reg|,
40        - external connector,
41        - USB charger, or USB power
42
43* On-board ST-LINK/V2-1 debugger/programmer with USB re-enumeration
44    - Virtual COM port and debug port
45
46
47More information about the board can be found in `STM32WB5MM-DK on www.st.com`_.
48
49Hardware
50********
51
52STM32WB5MMG is an ultra-low-power and small form factor certified 2.4 GHz
53wireless module. It supports Bluetooth |reg| Low Energy 5.4, Zigbee |reg| 3.0,
54OpenThread, dynamic, and static concurrent modes, and 802.15.4 proprietary
55protocols.
56
57Based on the STMicroelectronics STM32WB55VGY wireless microcontroller,
58STM32WB5MMG provides best-in-class RF performance thanks to its high
59receiver sensitivity and output power signal. Its low-power features
60enable extended battery life, small coin-cell batteries, and energy harvesting.
61
62- Ultra-low-power with FlexPowerControl
63- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU
64- Radio:
65
66  - 2.4GHz
67  - RF transceiver supporting:
68
69    - Bluetooth |reg| 5.4 specification,
70    - IEEE 802.15.4-2011 PHY and MAC,
71    - Zigbee |reg| 3.0
72
73  - RX sensitivity:
74
75    - -96 dBm (Bluetooth |reg| Low Energy at 1 Mbps),
76    - -100 dBm (802.15.4)
77
78  - Programmable output power up to +6 dBm with 1 dB steps
79  - Integrated balun to reduce BOM
80  - Support for 2 Mbps
81  - Support GATT caching
82  - Support EATT (enhanced ATT)
83  - Support advertising extension
84  - Accurate RSSI to enable power control
85
86- Clock Sources:
87
88  - 32 MHz crystal oscillator with integrated
89    trimming capacitors (Radio and CPU clock)
90  - 32 kHz crystal oscillator for RTC (LSE)
91  - Internal low-power 32 kHz (±5%) RC (LSI1)
92  - Internal low-power 32 kHz (stability
93    ±500 ppm) RC (LSI2)
94  - Internal multispeed 100 kHz to 48 MHz
95    oscillator, auto-trimmed by LSE (better than
96    ±0.25% accuracy)
97  - High speed internal 16 MHz factory
98    trimmed RC (±1%)
99  - 2x PLL for system clock, USB, SAI, ADC
100
101More information about STM32WB55RG can be found here:
102
103- `STM32WB5MM-DK on www.st.com`_
104- `STM32WB5MMG datasheet`_
105
106Supported Features
107==================
108
109The Zephyr STM32WB5MM-DK board configuration supports the following hardware features:
110
111+-----------+------------+-------------------------------------+
112| Interface | Controller | Driver/Component                    |
113+===========+============+=====================================+
114| UART      | on-chip    | serial port-polling;                |
115|           |            | serial port-interrupt               |
116+-----------+------------+-------------------------------------+
117| I2C       | on-chip    | i2c                                 |
118+-----------+------------+-------------------------------------+
119
120
121Other hardware features are not yet supported on this Zephyr port.
122
123The default configuration can be found in the defconfig file:
124:zephyr_file:`boards/st/stm32wb5mm_dk/stm32wb5mm_dk_defconfig`
125
126Bluetooth and compatibility with STM32WB Copro Wireless Binaries
127================================================================
128
129To operate bluetooth on STM32WB5MMG, Cortex-M0 core should be flashed with
130a valid STM32WB Coprocessor binaries (either 'Full stack' or 'HCI Layer').
131These binaries are delivered in STM32WB Cube packages, under
132``Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/``.
133
134For compatibility information with the various versions of these binaries,
135please check `modules/hal/stm32/lib/stm32wb/hci/README`_
136in the ``hal_stm32`` repo.
137
138Note that since STM32WB Cube package V1.13.2, "full stack" binaries are not
139compatible anymore for a use in Zephyr and only "HCI Only" versions should be
140used on the M0 side.
141
142Connections and IOs
143===================
144
145
146Default Zephyr Peripheral Mapping:
147----------------------------------
148
149.. rst-class:: rst-columns
150
151- UART_1 TX/RX : PB7/PB6 ( Connected to ST-Link VCP)
152- LPUART_1 TX/RX : PA3/PA2
153- USB : PA11/PA12
154- SWD : PA13/PA14
155- I2C3: SDA/SCL PB11/PB13 (Sensor I2C bus)
156
157System Clock
158------------
159
160STM32WB5MMG System Clock could be driven by internal or external oscillator,
161as well as main PLL clock. By default System clock is driven by HSE clock at 32MHz.
162
163Serial Port
164-----------
165
166STM32WB5MM-DK board has 2 (LP)U(S)ARTs. The Zephyr console output is assigned to USART1.
167Default settings are ``115200 8N1``.
168
169LEDs
170----
171STM32WB5MM-DK has two types of LEDs, The resources coming from STM32WB5MMG are
172shared between the RGB and IR LEDs. It is not possible to use them
173simultaneously. The selection is done by JP4 and JP5 jumpers.
174To use the RGB LED, JP5 must be ON and JP4 OFF. In this configuration,
175GPIO_SELECT2 (PH1) is the chip select for this RGB device on SPI1.
176
177Buttons
178-------
179STM32WB5MM-DK has two user buttons. The first button is mapped to PC12,
180and the second to PC13. They have the aliases sw0 and sw1 respectively.
181
182Programming and Debugging
183*************************
184
185STM32WB5MM-DK has an on-board ST-Link to flash and debug the firmware on the module.
186
187Applications for the ``stm32wb5mm_dk`` board configuration can be built the
188usual way (see :ref:`build_an_application`).
189
190Flashing
191========
192
193The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
194so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
195
196Alternatively, OpenOCD or pyOCD can also be used to flash the board using
197the ``--runner`` (or ``-r``) option:
198
199.. code-block:: console
200
201   $ west flash --runner openocd
202   $ west flash --runner pyocd
203
204Flashing ``hello_world`` application to STM32WB5MM-DK
205------------------------------------------------------
206
207Connect the STM32WB5MM-DK to your host computer using the USB port (CN11).
208Then build and flash an application. Here is an example for the ``hello_world``
209application.
210
211Run a serial host program to connect with your  STM32WB5MM-DK board:
212
213.. code-block:: console
214
215   $ minicom -D /dev/ttyACM0
216
217Then first build and flash the application for the STM32WB5MM-DK board.
218
219.. zephyr-app-commands::
220   :zephyr-app: samples/hello_world
221   :board: stm32wb5mm_dk
222   :goals: build flash
223
224Reset the board and you should see the following messages on the console:
225
226.. code-block:: console
227
228	Hello World! stm32w5mm_dk
229
230Debugging
231=========
232
233You can debug an application in the usual way.  Here is an example for the
234`Hello_World`_  application.
235
236.. zephyr-app-commands::
237   :zephyr-app: samples/hello_world
238   :board: stm32wb5mm_dk
239   :maybe-skip-config:
240   :goals: debug
241
242.. _STM32WB5MM-DK on www.st.com:
243   https://www.st.com/en/evaluation-tools/stm32wb5mm-dk.html
244
245.. _STM32WB5MMG datasheet:
246   https://www.st.com/resource/en/datasheet/stm32wb5mmg.pdf
247
248.. _modules/hal/stm32/lib/stm32wb/hci/README:
249   https://github.com/zephyrproject-rtos/hal_stm32/blob/main/lib/stm32wb/hci/README
250
251.. _Hello_World:
252   https://docs.zephyrproject.org/latest/samples/hello_world/README.html
253
254.. _STM32CubeProgrammer:
255   https://www.st.com/en/development-tools/stm32cubeprog.html
256