MCU는 CPU나 GPU와 다르게 낯설지만, 가장 많이 사용되는 반도체 중 하나다. ST 시스템 솔루션 랩의 유지 카와노 매니저에게 MCU의 활용성과 가능성이 얼마나 큰지 들어보자.
“Voice communication via Bluetooth® LE possible with one STM32WB”
Pre-board setup is important when downloading software
48KHz Audio Transmission Demo Android Compatible
[Editor's Note] Generally, when we talk about semiconductors, we tend to think of semiconductors that are familiar to the general public, such as the CPU and memory of computers. On the other hand, MCUs (Micro Controller Units), which are used as core semiconductors for operating electronic products, are semiconductors that are still unfamiliar to the general public, even though they are commonly used in all electronic products that we easily come across. These MCUs have recently been featured in the media due to the semiconductor shortage, and have begun to attract the attention of the general public. Accordingly, this magazine has prepared a place to learn about MCUs through a series of articles by Yuji Kawano, manager at STMicroelectronics, a company specializing in MCU semiconductors.

This time, we will demonstrate voice communication using Bluetooth® Low Energy (Bluetooth LE) using a development board from STMicroelectronics' STM32WB series wireless microcontroller.
This demo demonstrates how to transmit and play audio files from your smartphone to a microcontroller board via Bluetooth LE.
It has become very convenient because it can be done with just one STM32WB.
Receive compressed stereo 48KHz sampling WAV data via Bluetooth LE and play it on your PC.
■ Hardware Preparation ※ Required Materials
- STM32WB Nucleo Pack (uses only the MB1355C board included in the pack)
- PC (Windows 10/7)
- Smartphone (Android)*Bluetooth 4.2 or higher
- USB cable (Micro-USB)
The board to be used this time is the MB1355C board (hereinafter referred to as the STM32 Nucleo board) mounted on the STM32WB55 Nucleo Pack.
In addition to the board, there is a PC and UPrepare a SB cable (Micro-USB) and an Android smartphone.
■ Software Preparation Install STM32CubeProgrammer. If the installation is already complete, skip this step.
If this is your first time using the STM32 Nucleo board on your PC, install STM32CubeProgrammer (formerly ST Link Utility) and prepare the COM port driver, etc. (STM32CubeProgrammer is not used in this post, but the driver is required).
This tool is required to download software to STM32WB microcontrollers.
After unzipping the file, open the executable file and follow the instructions to install.
If you have already installed STM32CubeProgrammer, you do not need to do this.
Once the installation is complete, proceed to the next step.
■ Preparing software for operation verification Next, download the demo program file.
Go to download:
FP-AUD-BVLINKWB1 When you unpack the downloaded file, a working folder for the integrated development environment is created.
The folder below will be used this time. Since the demo program file (binary file) is prepared, check the file first.
Save path (example): 'Drive:...\STM32CubeFunctionPack_BVLINKWB1_Vx.xx\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BVLPeripheral_FullBand\Binary'
File name: FP-AUD-BVLINKWB1_FullBand.bin
■ Connect to PC and download software When downloading software, set up the board as follows in advance.
Also, be careful because the settings here will be different when downloading software and running demos. Don't worry, the board won't be damaged even if you make a mistake.
- For jumper JP1*, set the jumper pin to 'USB STL'
- Connect the PC and Nucleo board to the Micro-USB cable with the 'ST-LINK' connector (be careful, there are two Micro-USB connectors)
*Jumper JP1 is a jumper to select the 5V power supply source of the board.
When you connect the Nucleo board to a PC with a USB cable, it is recognized as a USB memory device named 'NODE_XXXX'. When you run this for the first time, driver installation will begin first.
Drag and drop the binary file 'FP-AUD-BVLINKWB1_FullBand.bin' that we checked earlier onto 'NODE_WB55RG'. This will complete the software download to the STM32 microcomputer.
■ Installing smartphone applications Next, prepare the transmitting side with a smartphone.
Install ST's sensor application 'ST BLE Sensor' on your smartphone. Here, we will use it for audio transmission. If the installation is already complete, skip it.
At this time, only Android supports the 48KHz audio transmission demo.
You can find it by searching for 'st ble' in the Google Play Store, so install it. Most of ST's sensor demos support this application.
In 'ST BLE Sensor', available functions are automatically set according to the application demo program of the connected device. For this demo, the audio transmission feature is enabled.
■ Preparing audio files and connecting the board ○ Preparation
Place the audio data file (WAV) in an appropriate folder on your smartphone in advance.
The only file that can be streamed in this demo is a 48KHz sampling WAV file. If the audio file you are using is not 48KHz PCM data, resampling is required. Sampling is also possible with free software such as Audacity.
Also, compressed files such as MP3 or AAC cannot be used in this demo.
Here is a brief introduction to the process of resampling 44.1KHzPCM data to 48KHz using Audacity as an example.
After executing the resampling process in the order shown in the image above, save it as a WAV file.
This creates a 48KHz WAV file. Place it in an appropriate folder on your smartphone.
■ Connect the board to the PC Before running the demo, set up the board as follows: As I mentioned once when downloading the software, the settings here are different when downloading the software and when running the demo, so be careful.
- For jumper JP1*, set the jumper pin to 'USB_MCU' (supply 5V from the "USB_USER" connector)
- Connect the PC and STM32 Nucleo board to the "USB_USER" connector with a Micro-USB cable.
(Be careful, there are two Micro-USB connectors)
*Jumper JP1 is a jumper to select the 5V power supply source of the board.
■ Device recognition If the board is properly connected to USB, it will be recognized as a 'microphone' (voice input device), so check that first.
Open the Control Panel by entering characters such as 'contro' in the search box at the bottom left of the desktop screen.
If you click on 'Sound' among these, the sound properties will open. There should be a device here called 'STM32 AUDIO Streaming FS Mode', so select it and click 'Properties'.
In the 'Default Format' ([Advanced/Detailed] tab in the image below), you will see an item to select the input format, so select '2 channels, 16bit, 48000Hz' and click 'Apply'.
With this, preparations on the PC side are complete. Okay, the received audio data is ready to be transferred to the PC via USB audio.
■ Check operation ○ Run the smartphone application
With the STM32 Nucleo board connected to the PC, run the smartphone application (ST BLE Sensor) on the transmitting side.
Then, connect the smartphone and device to Bluetooth in the following order.
○ Audio transmission (test confirmation)
This will allow you to play and transmit demo music for testing, so tap the play button first. Check the sound with your PC's speakers or headphones. The blue LED on the board will blink rapidly during data transmission.
○ Select audio file
If you add audio files to the 'Song List', you can also send them freely. Tap the folder icon next to 'Song List' and specify the folder containing the audio files. The order is as follows.
What do you think?
ST has been preparing for voice transmission using Bluetooth LE for some time, and the FP-AUD-BVLINKWB1 file downloaded this time also includes software that can transmit and receive voice in both directions simultaneously. I will also introduce this part sequentially.
■ Structure of movement Finally, I will briefly explain the structure of the movement.
- Compression format: OPUS codec
- Communication data rate: 96Kbps or 192Kbps
- Audio frame size: 10ms
The original audio PCM data is compressed and transmitted at a rate lower than that which can be transmitted via Bluetooth LE (4.2).
Here we use an open source compression codec called OPUS.
On the receiving end, the compressed data is decoded in the opposite way and the output audio PCM data is transmitted as USB audio.
※ Related information For more detailed information, please refer to the related information below.
User Manual for FP-AUD-BVLINKWB1 STBLESensor source code/Android BlueST-SDK/Git-Hubgithub.com/STMicroelectronics/BlueSTSDK_Android/tree/1f55866b370778a93afce98bba0dd011eb558747/BlueSTSDK/src/main/java/com/st/BlueSTSDK/Features/Audio" target="_blank">OPUS/Git-Hub