Setting up the development environment
- IAR Embedded Workbench 8.32 or newer;
- 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);
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.
Integration to the KW36 SDK
- 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:
1. Create the network:
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:
2. Validate functionality on the Bluetooth LE:
- 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:
3. Initiate GFSK communication:
- 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:
4. Validate Bluetooth LE in parallel with GFSK:
- 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.