[Silicon Labs BG22-EK4108A Bluetooth Development Evaluation] Evaluation 1 iBeacon Bluetooth Beacon
[Copy link]
Evaluation 1 iBeacon Bluetooth Beacon
This article uses beacons and demonstrates how to modify the iBeacon application to modify the Payload , MAC address, broadcast time parameters, etc. The BRD4108A master controller I have is the EFR32BG22C224F512IM40 , specification BLE5.2 , core M33 and M0+ , supports DSP floating point acceleration instructions, 512K Flash+32K RAM , and a maximum main frequency of 76.8MHz .
1. Program burning
Try its broadcast package application as soon as possible. The SDK has reference examples in the directory ${StudioSdkPath}\app\bluetooth\example\soc_ibeacon , based on Simplicity Studio V5.3.0.0 and Gecko SDK V3.2 . Since SS is based on eclipse , opening or importing the project is the same as eclipse . When importing, you can select the target PCBA , target chip, SDK and compiler. You can choose ICC_ARM , SES , Keil , SS/GNU_ARM . This time, choose open source SS/GNU_ARM :
Figure 1 Engineering parameter selection
The Simplicity IDE download toolchain is in $SimplicityStudio_InstallDir\developer\toolchains . In the project management interface, you can see the structure tree. ibeacon involves radio frequency, so it will target the controller part including PHY , LL layer and the GAP and application layer above. Open main.c and app.c , you can see that the protocol stack all starts with sl_xx as API , the broadcast packet is in the app.c callback function sl_bt_on_event , and then you can fill in AD Flags , UUID , Major , Minor , etc. Click Run->Debug to upload the firmware and you will find that the program jumps directly to 0xefffffc0 and reports an error and cannot run. Later, I found that I needed to burn the BootLoader to boot (there is no LOG prompt here, but it is mentioned in the Troubleshooting section of the readme document ), so I burned the BootLoader first and clicked Flash on the toolbar. Programmer pops up a dialog box, locate ${StudioSdkPath}\platform\bootloader\sample-apps\bootloader-uart-bgapi\bootloader-uart-bgapi.s37 (the subsequent application burning cannot be a .bin file without address information , otherwise the BootLoader will be overwritten ).
Figure 2 Flash Programmer
2. Parameter Configuration
After burning the BootLoader , you can run the debugger and see the phenomenon. Use the mobile phone nRF Connect to scan its broadcast packet.
1.UUID/Major/Minor modification
This time, its payload is modified to include UUID , Major , and Minor , and it is changed to the configuration of WeChat Shake Peripheral in previous years. See the screenshot for details.
Figure 3 ibeacon payload modification
2. Broadcast MAC modification
You can also try to modify other parameters such as broadcast MAC and broadcast interval. Follow the instructions in the link https://docs.silabs.com/bluetooth/latest/general/system-and-performance/setting-a-custom-bt-address--production-approach and use the sl_bt_system_set_identity_address interface:
Figure 4 ibeacon broadcast MAC address modification
3. Modification of broadcast time parameters
The advertising interval, skip number, advertising cycle, etc. can all be implemented using the sl_bt_advertiser_set_timing interface. This modification interval is 500ms:
Figure 5 ibeacon broadcast parameter modification
|