Skip to content

IoT-gamer/bgm220_le_coded_phy

Repository files navigation

BGM220 LE Coded PHY BLE Button & LED Controller

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.

Features

  • 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_control characteristic.
    • Button Notifications: Pressing the onboard physical button triggers real-time GATT notifications via the gattdb_report_button characteristic.
  • 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=1 for maximum memory and processing performance during embedded operation.

Hardware & Software Prerequisites

Project Setup

  1. Create a new "Bluetooth - SoC Blinky" project in Simplicity Studio 6.
  2. Open the .slcp project configuration file.
  3. Navigate to Software Components.
  4. CRITICAL: Search for and Install the Extended Advertiser component.
  5. Search for and Uninstall the Legacy Advertiser component to save flash memory.
  6. Replace the default app.c with the app.c provided in this repository.
  7. Build the project and flash the binary to the BGM220.

Usage & Testing

  1. Power on the BGM220 Explorer Kit. Monitor the serial output to verify the Blinky example initialized. message.
  2. Open nRF Connect on your mobile device.
  3. Open the scanner settings/filters and ensure LE Coded (or "Use Extended Scanning") is enabled. Standard 1M PHY scans will not see this device.
  4. Connect to the device named Blinky Example in the scanner app.
  5. Expand the Custom Service:
    • Write 0x01 to the LED characteristic to turn the LED on, and 0x00 to turn it off.
    • Enable notifications on the Button characteristic. Press the physical button on the board to see state changes (0x00 for released, 0x01 for pressed).

Troubleshooting

  • Serial logs show Status: sc = 0x000f (?) Assertion failed on boot: This indicates SL_STATUS_NOT_SUPPORTED. Ensure you have installed the Extended Advertiser software component in Simplicity Studio. The legacy advertiser cannot handle the sl_bt_extended_advertiser_set_phy commands 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 message from the mbedTLS library confirming that the high-performance, low-memory buffer configuration is active. It can be safely ignored.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

  • Silicon Labs Simplicity Studio 6 Bluetooth - SoC Blinky example project for the BGM220.
    • this code is heavily based on the original blinky example, with modifications to support LE Coded PHY.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors