ST STM32Cube User manual

Quick Start Guide
STM32Cube function pack for STM32WB MCU
featuring advanced audio streaming over
Bluetooth 5.0 using Opus codec
(FP-AUD-BVLINKWB1)
Version 3.0 (Feb 18, 2021)

Agenda
1Hardware and Software overview
3Documents & Related Resources
4STM32 Open Development Environment: Overview
2
2Setup & Demo Examples

1- Hardware and Software overview

P-NUCLEO-WB55 pack
Hardware Overview
P-NUCLEO-WB55 Hardware Description:
The P-NUCLEO-WB55 pack is a multi-protocol wireless and ultra-low-power device embedding a powerful and
ultra-low-power radio compliant with the Bluetooth® Low Energy (BLE) SIG specification v5.0 and with IEEE
802.15.4-2011.
Key Product on board
•STM32WB microcontroller in a VFQFPN68 package
•2.4 GHz RF transceiver supporting Bluetooth® specification v5.0 and IEEE 802.15.4-2011 PHY and MAC
•Dedicated Arm® 32-bit Cortex® M0+ CPU for real-time Radio layer
•Three user LEDs
•Three user buttons and one reset button
•Board connector: USB user with Micro-B
•Board expansion connectors:
• Arduino™ Uno V3
•ST morpho
•Integrated PCB antenna or footprint for SMA connector
•Flexible power-supply options: ST-LINK USB VBUS or external sources
•On-board socket for CR2032 battery
•On-board ST-LINK/V2-1 debugger/programmer with USB re- enumeration capability: mass storage, virtual COM port and
debug port
•Comprehensive free software libraries and examples available with the STM32Cube package
• Support of a wide choice of Integrated Development Environments (IDEs), including IAR™, Keil®, GCC-based IDEs,
Arm® Mbed™
Latest info available at www.st.com
P-NUCLEO-WB55

STM32WB5MM-DK
Hardware Overview
STM32WB5MM-DK Hardware Description:
The STM32WB5MM-DK Discovery kit is designed as a complete demonstration and development platform for the
STMicroelectronics STM32W5MMG module based on the Arm® Cortex®-M4 and Arm® Cortex®-M0+ cores.
Key Product on board
•STM32WB5MMG (1-Mbyte Flash memory, 256-Kbyte SRAM, in Module RF package)
•Dual-core 32-bit (Arm® Cortex®-M4 and dedicated M0+ CPU for real-time radio layer)
•2.4 GHz RF transceiver supporting Bluetooth® specification V5.2, 802.15.4 with Zigbee®, Thread®, and
proprietary protocols
•0.96-inch 128x64 OLED display
•128-Mbit Quad-SPI NOR Flash Memory
•Temperature sensor
•Accelerometer/gyroscope sensor
•Time-of-Flight and gesture-detection sensor
•Digital microphone
•RGB LED Infrared LED
•3 push-buttons (2 users and 1 reset) and 1 touch key button
•Connectors: STMod+, ARDUINO® Uno V3 expansion connector, USB user Micro-B connector, TAG10 10-pin footprint
•Flexible power-supply options: ST-LINK/V2-1 USB connector, 5 V delivered by ARDUINO® or external connector, USB
charger, or USB power
•On-board ST-LINK/V2-1 debugger/programmer with USB re-enumeration capability: Virtual COM port and debug port
•Comprehensive free software libraries and examples available with the STM32CubeWB MCU Package
•Support of a wide choice of Integrated Development Environments (IDEs) including IAR Embedded Workbench®, MDK-
ARM, and STM32CubeIDE
Latest info available at www.st.com
STM32WB5MM-DK

MEMS Microphones Expansion Board (CCA02M2)
Hardware Overview
X-NUCLEO-CCA02M2 Hardware Description
The X-NUCLEO-CCA02M2 expansion board has been designed around MP34DT06J digital MEMS microphone. It is
compatible with the ST morpho connector layout and with digital microphone coupon boards such as STEVAL-
MIC001V1, STEVAL-MIC002V1 and STEVAL-MIC003V1.
The X-NUCLEO-CCA02M2 embeds two MP34DT06J microphones and allows synchronized acquisition and
streaming of up to 4 microphones through I²S, SPI, DFSDM or SAI peripherals.
Key Product on board
•2 on-board MP34DT06J digital MEMS microphones
•6 slots to plug in digital microphone coupon boards such as STEVAL-MIC001V1, STEVAL-MIC002V1 and STEVAL-
MIC003V1
•Synchronized acquisition and streaming of up to 4 microphones
•Free comprehensive development firmware library and audio capture plus USB streaming sample application
compatible with STM32Cube
•Compatible with STM32 Nucleo boards
•Equipped with ST morpho connector (upwards and downwards)
•Equipped with Arduino UNO R3 connector (upwards) to allow multiple boards
•RoHS and WEEE compliant
Latest info available at www.st.com
X-NUCLEO-CCA02M2

FP-AUD-BVLINKWB1
Software Overview
7
FP-AUD-BVLINKWB1 Software Description
FP-AUD-BVLINKWB1 is an STM32Cube function pack that performs full-duplex
voice streaming or stereo music streaming over BLE using the advanced Opus
compression algorithm. The application runs on P-NUCLEO-WB55 connected to an
X-NUCLEO-CCA02M2 or on STM32WB5MM-DK.
Key features
•Complete firmware to implement full-duplex audio or stereo music streaming
over Bluetooth 5.0 using Opus codec for both encoding and decoding
•A BlueVoiceOPUS customized profile for audio over BLE, including an easy-to-
use set of APIs to exploit advanced Opus functionality (source code available)
•Third-party Opus v1.3 (downloadable from http://opus-codec.org/) middleware:
an open, royalty-free and highly versatile audio codec that is standardized by
the Internet Engineering Task Force (IETF) as RFC 6716
•Digital audio signal acquisition and processing
•Audio out playback through USB
•Compatibility with STBLESensor mobile app, to perform full-duplex audio
streaming at 16 kHz and speech-to-text or to receive stereo music at 48 kHz
from devices supporting BLE 4.2 or higher
•Free, user-friendly license terms
Overall Software Architecture
FP-AUD-BVLINWB1
Latest info available at www.st.com

2- Setup & Demo Examples

Setup & Application Examples
HW prerequisites for Full-Duplex demo between two STM32WB
9
•Full-Duplex audio streaming between two STM32WB (P-NUCLEO-WB55 or STM32WB5MM-DK)
•2x P-NUCLEO-WB55 development board + 2x X-NUCLEO-CCA02M2 expansion board; alternatively, 2x STM32WB5MM-DK
•Laptop/PC with Windows 7, 8 or 10 andAudacity or other audio recording sw
•2x micro-USB cables
•Full-Duplex audio streaming between STM32WB (P-NUCLEO-WB55 or STM32WB5MG-DK) and a mobile device
•1x P-NUCLEO-WB55 development board + 1x X-NUCLEO-CCA02M2 expansion board; alternatively, 1x STM32WB5MM-DK
•Laptop/PC with Windows 7, 8 or 10 andAudacity or other audio recording sw
•1x micro-USB cable
•1x mobile device running ST BLE SensorApp (v4.9.0 or higher)
•Full-Band stereo music streaming:
•1x P-NUCLEO-WB55 or 1x STM32WB5MM-DK
•Laptop/PC with Windows 7, 8 or 10 andAudacity or other audio recording sw
•1x micro-USB cable
•1x mobile device running ST BLE SensorApp, supporting BLE 4.2 or higher

Configure the X-NUCLEO-CCA02M2
board as in the picture in order to
acquire only one microphone through
the SAI
Full-Duplex Application Examples
X-NUCLEO-CCA02M2 HW setup

Setup & Application Examples
Software and Other prerequisites
11
•STM32 ST-Link Utility
•Download and install STSW-LINK004 from www.st.com
•FP-AUD-BVLINWB1
•Download the FP-AUD-BVLINKWB1 package from www.st.com, copy the .zip file contents into a folder on your PC. The
package contains binaries and source code with project files (Keil, IAR, STM32CubeIDE) based on P-NUCLEO-WB55 or
STM32WB5MM-DK.
•ST BLE Sensor App for Android or iOS, can be downloaded from relevant store,
•Third party software for audio acquisition:
•Audacity® is free, open source, cross-platform software for recording and editing sounds. It is available for
Windows®, Mac®, GNU/Linux®; and other operating systems

FP-AUD-BVLINKWB1. Sample applications
Start coding in just a few minutes
12
Download & unpack
1
FP-AUD-BVLINKWB1
Select Function Pack:
23
4
5
6
Manage audio recording on your
PC or mobile device
www.st.com/stm32ode
Use the pre-compiled binaries or alternative
re-compile the code
FP-AUD-BVLINKWB1 package structure
DocsBSP, HAL
drivers
BLE service, USB class,
PDM2PCM lib, Opus
BVLCentral
BVLPeripheral
BVLPeripheral_FullBand

2.1- Test Full-Duplex audio streaming
between two STM32WB

FP-AUD-BVLINKWB1. Step by step setup
HW prerequisites for Full-Duplex demo between two STM32WB
14
Peripheral Unit
Audio
compressed
@24kbps
USB out
@16/8kHz
Central Unit
USB
Audacity or other
audio recording sw
P-NUCLEO-WB55
+
X-NUCLEO-CCA02M2
BVLCentral project BVLPeripheral project
P-NUCLEO-WB55
+
X-NUCLEO-CCA02M2
USB out
@16/8kHz
USB Audacity or other
audio recording sw
Peripheral Unit
Audio
compressed
@24kbps
USB out
@16/8kHz
Central Unit
USB
Audacity or other
audio recording sw
STM32WB5MM-DK
BVLCentral project BVLPeripheral project
STM32WB5MM-DK
USB out
@16/8kHz
USB Audacity or other
audio recording sw
OR

15
2Move JP1 on P-NUCLEO-WB55 or JP2 on STM32WB5MM-
DK from USB STL to USB MCU.
Plug a micro-USB cable into USB_USER
Both units are recognized as
USB Microphone by Windows.
3
4In Audacity set the default audio settings; open Edit/Preferences and select quality
tab, choose 16 kHz as sampling frequency and 16-bit sample format. If you want to
hear the audio while recording it, open Edit/Preferences, select Recording tab and
check "Software playthrough of input“. Now select the peripheral or central unit and
click record *
5Press user button 1 on the board to START
streaming, press again to STOP it. Both units can
stream at the same time.
Audacity records audio coming from the
selected microphone.
6
1Compile and download BVLCentral application on one unit and
BVLPeripheral application on the other (on P-NUCLEO-WB55 move JP1
on USB STL, on STM32WB5MM-DK move JP2 on USB STL)
FP-AUD-BVLINKWB1. Step by step setup
Full-Duplex between two STM32WB demo setup
* In Windows 10, if an error occurs,
please delete the audio driver from
device manager and unplug and re-
plug the usb cable from Nucleo board

2.2- Test Full-Duplex audio streaming
between STM32WB and mobile device

FP-AUD-BVLINKWB1. Step by step setup
HW prerequisites for Full-Duplex demo between STM32WB and mobile device
17
Peripheral Unit
Audio
compressed
@24kbps
USB out
@16/8kHz
Central Unit
USB
Audacity or other
audio recording sw
P-NUCLEO-WB55
+
X-NUCLEO-CCA02M2
BVLPeripheral project ST BLE Sensor App
Peripheral Unit
Audio
compressed
@24kbps
USB out
@16/8kHz
Central Unit
USB
Audacity or other
audio recording sw
STM32WB5MM-DK
ST BLE Sensor App
BVLPeripheral project
OR

18
2Move JP1 on P-NUCLEO-WB55 or JP2 on STM32WB5MM-
DK from USB STL to USB MCU.
Plug a micro-USB cable into USB_USER
STM32WB is recognized as USB
Microphone by Windows.
3
4In Audacity set the default audio settings; open Edit/Preferences and select quality tab,
choose 16 kHz as sampling frequency and 16-bit sample format. If you want to hear
the audio while recording it, open Edit/Preferences, select Recording tab and check
"Software playthrough of input“. Now select the STM32Microphone and click record *
5Open ST BLE Sensor App on your android device and connect to BVL-WB1.
Push User button 1 on the board to start audio streaming to the app.
You can hear audio from the smartphone speaker.
Enable the Start switch on the app to start audio streaming from the smartphone to
the board. Audacity acquires the received audio. To avoid Larsen effect, keep the
board and smartphone at minimum 40 cm or connect a headset to your mobile device.
6
1Compile and download BVLPeripheral application on P-NUCLEO-WB55
(JP1 on USB STL) or on STM32WB5MM-DK (JP2 on USB STL)
FP-AUD-BVLINKWB1. Step by step setup
Full-Duplex between STM32WB and mobile device demo setup
* In windows 10, if an error occurs,
please delete the audio driver from
device manager and unplug and re-plug
the usb cable from Nucleo board

2.2- Test Full-Band stereo music
streaming

FP-AUD-BVLINKWB1. Step by step setup
HW prerequisites for Full-Band stereo music streaming
20
Peripheral Unit
USB out
stereo
@48kHz
Central Unit
USB
Audacity or other
audio recording sw
P-NUCLEO-WB55
BVLPeripheral project BVLCentral project
OR
Audio
Compressed
96/192 kbps
STM32WB5MM-DK
BLE 4.2 or higher
Other manuals for STM32Cube
6
This manual suits for next models
1
Table of contents
Other ST Computer Hardware manuals

ST
ST UPSD3212A User manual

ST
ST ST32M103 Series User manual

ST
ST ControlBD-7FMC2 User manual

ST
ST ZigBee SNDEV-260 User manual

ST
ST STSW-L9961BMS User manual

ST
ST X-NUCLEO-OUT13A1 User manual

ST
ST X-NUCLEO-GFX02Z1 User manual

ST
ST X-NUCLEO-IDB04A1 User manual

ST
ST STM32 Nucleo User manual

ST
ST UM2960 User manual

ST
ST X-NUCLEO-53L3A2 User manual

ST
ST STM32F101 series User manual

ST
ST X-NUCLEO-OUT08A1 User manual

ST
ST STM32Cube Quick setup guide

ST
ST X-LINUX-NFC5 User manual

ST
ST STM32F3DISCOVERY User manual

ST
ST STM32 Nucleo User manual

ST
ST X-NUCLEO-6283A1 User manual

ST
ST X-NUCLEO-53L4A2 User manual

ST
ST STEVAL-ISF001V1 User manual