Answer
How to get started with developing firmware for Lyra BLE modules
Introduction
The following article provides with brief introduction on how to get started with firmware development using Lyra P&S Bluetooth Low Energy Modules. It describes the required software tools, hardware and connection setup
Hardware
- Lyra S or P Development Kit
- Micro USB cable
Software
- Simplicity Studio IDE v5 or higher
- Bluetooth SDK 3.2.1 or higher
Connection
Use the micro USB cable provided in the Lyra DVK and attach it to PC USB slot and the micro USB connector on the DVK
Building and running the firmware
Please launch Simplicity Studio IDE and import the SoC Empty project template:
- File->New->Silicon Labs Project Wizard...
- Assign Target:
- Boards[BGM220 Explorer Kit Board (BRD4314A)]
- Device[BGM220PC22HNA]
- SDK[Gecko SDK Suite: Amazon, Bluetooth 3.2.1, Bluetooth Mesh 2.1.1, HomeKit 1.0.1.0, MCU 6.1.1.0, Micrium OS Kernel, OpenThread 1.2.1.0 (GitHub-48b129e74), Platform 3.2.1.0]
- IDE / Toolchain[Simplicity IDE / GNU ARM v10.2.1]
- Click Next and on the left top in filter on keywords type: "SoC Empty" and select "SoC Empty" template on the right top, Click Next to import the selected template
- If required please change the "Project Name" and click Finish
- Build the imported project: Right click on the "project name" in Eclipse Project Explorer tab in the left top and select "Build Project". The build should finish with 0 errors and 0 warnings
- Run the project using debug session: Right click on the "project name" in Eclipse Project Explorer tab in the left top and select "Debug As" -> "Silicon Labs ARM Program"
- If more than one device is connected to USB, please select the device to debug in Device Selection dialog window and click OK. The firmware should start loading and right after the MCU execution should be halted in main().
- Please resume MCU execution by pressing F8
Test the firmware
To test if the loaded firmware is running correctly please use EFR Connect application
- Download the EFR Connect for iOS or Android smartphone
- Open the app and choose the Bluetooth Browser
- Find the device advertising as "Empty Example". Select Connect
- The connection is opened, and the GATT database is discovered. Find the device name characteristic under Generic Access service and try to read out the device name. It should return Empty Example
Note:
The MCU might not halt at main() if the bootloader location on the Flash was erased. In order to recover from this error, the bootloader should be loaded to address#0 using the j-link utility command: loadfile bootloader.hex 0