Golioth turns your Bluetooth fleet into an internet-connected IoT wonderland. We accomplish this with a library called “pouch” which you wrap around data going to and from the device. Any device using Pouch can connect to a Bluetooth gateway using BLE GATT for bi-directional communication with the cloud. Here’s what it took to get an STMicroelectronics STM32WB5MM-DK dev board connected to the Golioth cloud.
STM32WB5MM-DK Example Based on Zephyr
Prerequisites
The Golioth Bluetooth Private Access repository has a Zephyr-based example for connecting Bluetooth devices to the internet via a gateway. While the code repository is public, you’ll need to opt into the early access to enable the features on the Golioth web console.
You need a Bluetooth gateway device that connects to Golioth. Instructions for gateway setup are available on the same private access repo. Choose either an nRF9160 DK or Thingy:91 X as your gateway hardware.
With those two out of the way, we can work on adding our STM development board as a leaf node!
Enable the STM32 HAL Library
The pouch repo uses an allow-list in the west.yml
manifest file. Since the repo didn’t originally implement support for STM chips, we need to add the correct hardware abstraction layer (HAL) library to the manifest file.
Edit the west.yml
file and add hal_stm32
to the name-allowlist
. Here’s what the file looks like after this addition:
# Copyright (c) 2025 Golioth, Inc. # SPDX-License-Identifier: Apache-2.0 manifest: version: 0.8 projects: - name: zephyr revision: v4.0.0 url: https://github.com/zephyrproject-rtos/zephyr west-commands: scripts/west-commands.yml import: path-prefix: deps name-allowlist: - zephyr - cmsis - hal_nordic - hal_stm32 - mbedtls - mcuboot - segger - tfm-mcuboot - tinycrypt - trusted-firmware-m - zcbor
Don’t forget to run west update
after making this change. This instructs Zephyr to clone the library we added to the allow list.
Build the Project
Now that we’ve added HAL support for STM we can build the project for our dev board.
Follow the Building Your First BLE Application instructions. This begins by creating a device in the Golioth web console and copying its Device ID
. The build command will be the same as in the instructions, with the exception of board name used in the build step. Here’s an example build, note that the Device ID has not been added to this command:
west build -p -b stm32wb5mm_dk pouch/examples/ble_gatt -- -DCONFIG_EXAMPLE_DEVICE_ID=\"REPLACME\" west flash
When the application begins running, the gateway will periodically connect and read data from it. Note that there is a known issue with the STM32WB Bluetooth that causes a warning and an error to be displayed, however we found it doesn’t interfere with the normal operation.
[00:00:00.004,000] <inf> ISM330DHCX: chip id 0x6b *** Booting Zephyr OS build 8469084dfae8 *** [00:00:00.179,000] <inf> bt_hci_core: Identity: 02:80:E1:00:00:00 (public) [00:00:00.179,000] <inf> bt_hci_core: HCI: version 1.0b (0x00) revision 0x807b, manufacturer 0x0030 [00:00:00.179,000] <inf> bt_hci_core: LMP: version 1.0b (0x00) subver 0x007b [00:00:00.179,000] <dbg> main: main: Bluetooth initialized [00:00:00.182,000] <dbg> main: main: Advertising successfully started [00:01:06.070,000] <dbg> main: connected: Connected [00:01:06.071,000] <wrn> bt_hci_core: opcode 0x2016 status 0x3a [00:01:06.071,000] <err> bt_conn: Failed read remote features (-5) [00:01:06.328,000] <wrn> bt_conn: conn 0x20001a88 failed to establish. RF noise? [00:01:06.328,000] <dbg> main: disconnected: Disconnected (reason 0x3e) [00:02:08.337,000] <dbg> main: connected: Connected [00:02:08.338,000] <wrn> bt_hci_core: opcode 0x2016 status 0x3a [00:02:08.338,000] <err> bt_conn: Failed read remote features (-5) [00:02:09.339,000] <dbg> main: disconnected: Disconnected (reason 0x13) [00:02:29.376,000] <dbg> main: connected: Connected [00:02:29.376,000] <wrn> bt_hci_core: opcode 0x2016 status 0x3a [00:02:29.376,000] <err> bt_conn: Failed read remote features (-5) [00:02:30.377,000] <dbg> main: disconnected: Disconnected (reason 0x13)
Viewing Network Topology and Data on the Cloud
When viewing the network topology you can see the gateway device at the center with Bluetooth leaf devices connecting to it. Above we see my project has three leaf devices. Two are not currently connected, but the newly added dev board is connecting and sending data!
When viewing the
Monitor→LightDB Stream
tab of the Golioth web console we see the data that has been received from this device. This is different from the simulated temperature sensor data that is sent by default. If you watch the end of our video you can see the process used to enable the onboard time-of-flight sensor and how to send that data to the cloud.
Enabling IoT On Every Device
We had a ton of customers asking for Bluetooth support on the Golioth platform and now we have it with Bluetooth-to-Cloud connectivity! Golioth is free for individuals, so take it for a test drive today to easily add cloud connectivity to your Bluetooth fleet.
No comments yet! Start the discussion at forum.golioth.io