![]() |
Morse Micro IoT SDK
2.9.7
|
Copyright 2023-2024 Morse Micro
This directory contains all of the hardware dependent code needed to use a STM32 Nucleo-64 development board with STM32WB55RG MCU configured for BLE operation.
It should be noted that the provided cube.ioc is provided as a reference only. If code is regenerated using STM32CubeMX it will break the applications. This is because STM32CubeMX does not support generating BLE code with FreeRTOS. Generated using STM32CubeMX v6.6.1.
This platform is based off of the basic mm-ekh08-wb55rg platform with the addition of the [heart rate sensor demo BLE app](https://github.com/STMicroelectronics/STM32CubeWB/tree/v1.14.1/Projects/P-NUCLEO-WB55.Nucleo/Applications/BLE/BLE_HeartRateFreeRTOS) provided by ST. It is meant to serve as a reference for running BLE & MM-IOT-SDK stack concurrently. We have taken care to minimize the changes to make view the diff to both the ST application and our non-BLE mm-ekh08-wb55rg platform possible.
The source for all the ST provided code is taken from the STM32CubeWB v1.14.1 repository
It is highly recommended to read the following application notes provided by ST before developing on this platform.
These are useful as a reference for the general operation of the MCU.
These documents go over the BLE portions of the MCU in greater detail.
The Core directory contains all of the setup and configuration code for the board. This will need to be modified to select and provide initialization endpoints for the peripherals. The following files are modified slightly for the BLE application but serve a similar purpose to the non-BLE BSP.
These are all files included specifically for the BLE portion of the application. Care should be taken when modifying defines as not all will work but have been left in to make running a diff with the reference application easier.
This directory contains all the logic for running the BLE application.
The files in the mm_shims directory (mmhal.c, mmport.h, wlan_hal.c) are where the board specific API functions used by morselib are implemented.
This is a very basic overview on how to get the BLE stack running. It is highly recommend to review the documents in the Recommended Reading section for more details.
As an overview the STM32WB55RG has two CPU cores.
For BLE operation ST has provided a number of pre-compiled binaries. For this example platform the stm32wb5x_BLE_Stack_light_fw.bin binary has been used to minimize the amount of flash memory that it uses. This binary is loaded in to the bottom portion of the flash using the firmware upgrade services (FUS) available on STM32WB series MCUs. Instructions on how to load this can be found in the releases notes for the coprocessor binaries. We provide a local copy on the necessary files here bsps/stm32cubewb/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/
Before loading the co-processor binary please ensure that you have the latest FUS FW version installed, currently v1.2.0. Install steps for this can also be found in the release notes. If this is not done first it will wipe the co-processor binary.
The provided linker script has been configured to leave enough space for the
stm32wb5x_BLE_Stack_light_fw.binbinary. If you wish to use another binary this will need to be adjusted.
Once the wireless coprocessor binary has been loaded using the steps provided by ST the example applications can be loaded on as per the usual steps. Note that the wireless coprocessor binary only needs to be loaded once.
Once the code has been load and starts running the applications will behave as per the other platform. The BLE processes will have their own threads in the background that will handle running the Heart Rate Monitor application.
For the BLE we can follow the steps provided by ST, Heart Rate Readme.
On the android/ios device, enable the Bluetooth communications, and if not done before,
You should now see a simulated heart beat value updating every 1 second.
The debug infrastructure provided by ST for the BLE module is not compatible with the rest of the MM-IoT-SDK without significant changes. As stated above this has been left in to enabled easy comparisons to the ST application.
That being said we have provided a method of printing the BLE debug messages. If you comment out the define provided in Core/Inc/app_conf.h you will see the debug messages printed out the UART.
/* Comment out the below line to enable debug logging for BLE */
// #define APP_DBG_MSG(...) do{printf("[%s]", "BLE");printf(__VA_ARGS__);}while(0);
| MM6108 pin | Nucleo/Arduino header pin | STM32WB55 pin |
|---|---|---|
| RESET_N | A0 | PC0 |
| WAKE | A1 | PC1 |
| BUSY | A2 | PA1 |
| SPI_SCK | SCK | PA5 |
| SPI_MOSI | MOSI | PA7 |
| SPI_MISO | MISO | PA6 |
| SPI_CS | CS | PA4 |
| SPI_IRQ | A4 | PC3 |