This post entry provides an example of a hybrid application (Wireless_UART + GFSK Advertising) by covering Bluetooth Low Energy multiple node connections in parallel with GFSK (Generic Frequency Shift Keying) communication. This is an additional example for the SDK where we have defined a Hybrid application for Bluetooth LE advertising and scanning in parallel with GFSK communication.
The goal of this post is to serve as a guide for software developers who want to use, adapt and integrate GFSK functionality in a Bluetooth Low Energy application.
- IAR Embedded Workbench 8.32 or newer;
https://www.iar.com/iar-embedded-workbench/
- This version of firmware has been tested using SDK_2.2.1_FRDM-KW36, that can be downloaded using the following link: https://mcuxpresso.nxp.com/en/select
(please consider to select as Toolchain/IDE: All toolchains);
- 2 to 5 FRDM-KW36 development board: FRDM-KW36 Development Kit KW36/35 MCUs | NXP
This demo application is design for the FRDM-KW36 platform and can be easily integrated into any board that is using KW35/36 MCU family.
The functionality is based on the coexistence mechanism available on the SDK (Mobile Wireless System - MWS module). Based on the HW link-layer implementation, the Bluetooth Low Energy has a higher priority than the GFSK protocol and as the effect, the GFSK communication is executed during the Idle states (inactive periods) of the Bluetooth LE.
For more details related to the MWS module, please refer to connectivity framework documentation from SDK (Connectivity Framework Reference Manual.pdf).
As for functionality on the Bluetooth low energy, both roles, central and peripheral, are supported.
- download the attached file and unzip to ...\SDK_2.2.1_FRDM-KW36\boards\frdmkw36\wireless_examples\hybrid folder:
- open IAR project (SDK_2.2.1_FRDM-KW36_2019_07_19\boards\frdmkw36\wireless_examples\hybrid\ble_w_uart_gfsk\freertos\iar\ble_w_uart_gfsk_freertos.eww).
- the project is organized like below:
- functionality is defined in main.c file, BleApp_Handle Keys function;
- on the FRDM-KW36 we have:
- SW2 - start scanning - Central device;
- Long SW2 - start advertising - Peripheral device; (long SW2 - SW2 pressed for more than 3 seconds)
- SW3 - start/stop GFSK TX operation (advertising);
- Long SW3 - start/stop GFSK RX operation (long SW3 - SW3 pressed for more than 3 seconds)
- Serial events for different states of the board;
- BaudRate 115200;
The solution has been validated using 1 Master and 4 Slave devices as below:
a. Open serial communication of all devices. After reset you will see the following message:
b. On the Central device press SW2 to start scanning;
c. On the Peripheral device press Long SW2 to start advertising and wait for the confirmation on the serial port:
d. Repeat steps b. and c. for all of the slave devices.
e. When the network is completed on the Central device you will see something like below:
f. Check the over the air connections (connection interval = 312.5 ms):
- from each slave (Peripheral) serial terminal write a message (e.g: testslaveX) and check that the message is printed on the master serial port.
- do the same test from the master (Central) serial terminal.
- Below is an example of this step:
- over the air log:
- in one of the board's press SW3 to start GFSK TX operation (Advertising packet with AdvAddress = 0909090909); At every 1 second (gGenFskApp_TxInterval_c), an ADV packet will be sent over the air.
- Select other board and press Long Sw3 to initiate GFSK RX operation (RX interval = 100ms = gGenFskApp_RxInterval_c);
- Each time an ADV packet from address = 0909090909 is received this will be listed on the serial port as below:
- over the air the GFSK TX packets will be listed as a ADV_NONCONN_IND:
- write a message on the Master (Central) serial terminal and check the feedback on the slave(Peripheral) serial terminals:
Attached is the source code for this application.
Regards,
Ovidiu