This repository contains the core application logic for a Bluetooth Low Energy (BLE) project running on the Silicon Labs BGM220 Explorer Kit. It demonstrates bidirectional BLE communication using the LE Coded PHY (Bluetooth 5 Long Range feature) for extended broadcast and connection range.
- LE Coded PHY Advertising: Utilizes Bluetooth 5 Extended Advertising APIs to broadcast on the 125k/500k Coded PHY.
- Bidirectional GATT Communication:
- LED Control: Remote BLE Central devices can toggle the onboard LED by writing to the
gattdb_led_controlcharacteristic. - Button Notifications: Pressing the onboard physical button triggers real-time GATT notifications via the
gattdb_report_buttoncharacteristic.
- LED Control: Remote BLE Central devices can toggle the onboard LED by writing to the
- Dynamic PHY Logging: Actively monitors and logs connection PHY status changes (e.g., transitions between 1M, 2M, and Coded PHY) negotiated by the Central device.
- Optimized Cryptography: Configured with
SL_MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS=1for maximum memory and processing performance during embedded operation.
- Hardware: Silicon Labs BGM220 Explorer Kit (BRD4314A)
- IDE: Simplicity Studio 6
- Testing: An Android mobile device and BLE scanner application that supports LE Coded PHY scanning (e.g., nRF Connect for Mobile).
- Create a new "Bluetooth - SoC Blinky" project in Simplicity Studio 6.
- Open the
.slcpproject configuration file. - Navigate to Software Components.
- CRITICAL: Search for and Install the
Extended Advertisercomponent. - Search for and Uninstall the
Legacy Advertisercomponent to save flash memory. - Replace the default
app.cwith theapp.cprovided in this repository. - Build the project and flash the binary to the BGM220.
- Power on the BGM220 Explorer Kit. Monitor the serial output to verify the
Blinky example initialized.message. - Open nRF Connect on your mobile device.
- Open the scanner settings/filters and ensure LE Coded (or "Use Extended Scanning") is enabled. Standard 1M PHY scans will not see this device.
- Connect to the device named
Blinky Examplein the scanner app. - Expand the Custom Service:
- Write
0x01to the LED characteristic to turn the LED on, and0x00to turn it off. - Enable notifications on the Button characteristic. Press the physical button on the board to see state changes (
0x00for released,0x01for pressed).
- Write
- Serial logs show
Status: sc = 0x000f (?) Assertion failedon boot: This indicatesSL_STATUS_NOT_SUPPORTED. Ensure you have installed the Extended Advertiser software component in Simplicity Studio. The legacy advertiser cannot handle thesl_bt_extended_advertiser_set_phycommands used in this code. - Device is not visible in the BLE Scanner: Double-check that your phone's hardware supports Bluetooth 5 Long Range / Coded PHY, and that the scanner application is actively filtering for it.
- Compiler warning about
SL_MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS=1: This is an expected informational#pragma messagefrom the mbedTLS library confirming that the high-performance, low-memory buffer configuration is active. It can be safely ignored.
This project is licensed under the MIT License. See the LICENSE file for details.
- Silicon Labs Simplicity Studio 6
Bluetooth - SoC Blinkyexample project for the BGM220.- this code is heavily based on the original blinky example, with modifications to support LE Coded PHY.