3.1 Get software
The K32W Wireless Connectivity Stack comes with a list of demo applications and driver examples ready to be compiled and run.
3.2 Install the SDK
To install the SDK, open MCUXpresso and drag and drop the SDK zip file into the installed SDKs window. Confirm the installation to copy the SDK into the MCUXpresso IDE framework.
3.3 Import SDK examples
From the quickstart panel, select “Import SDK examples”, select K32W061DK6, click next and choose wireless examples. Next, choose “ble_zigbee”, “zigbee_bdt_ed_ble_beacon”, “bm” (Refer to the wireless example’s documentation to find out more information). Then click finish to import the project.
3.4 Build your project
Build your imported project by selecting “Build” in the quickstart panel. Once complete, a binary file (.bin) will be generated inside the project folder under the folder called “Debug” (the name of the selected build configuration.)
3.5 Flash your device
Connect the light or switch DK6 boards to your PC. Open a terminal window in the location of your binary file (Your_MCUxpresso_Workspace\Project_Name\Debug). In your terminal window enter:
To list your connected COM ports. Identify the COM port of your device. then enter:
DK6Programmer.exe -V 5 -P 1000000 -s <COM_PORT> -e Flash
This will wipe the flash of the board.
Next, provision the image by flashing the PSECTOR with the following command:
DK6Programmer.exe -V5 -s <COM_PORT> -P 1000000 -w PSECT:64@0x160=00400000900401010000000000000000000000000000000000000
This wireless example requires a second stage bootloader. A pre-built binary for the bootloader is available inside the unzipped SDK. Under
SDK_2.6.0_K32W061DK6\boards\k32w061dk6\wireless_examples\framework\ssbl\binary. Flash the bootloader by entering:
DK6Programmer.exe -V5 -s <COM_PORT> -P 1000000 -p FLASH@0x00=<Path to ssbl.bin>
Replace <Path to ssbl.bin> with the ssbl.bin in the SDK by dragging and dropping the ssbl.bin from an explorer window into the terminal window. Or enter the path manually. Press enter and then Y.
Flash the application image by entering the following in the terminal window and press enter then y:
DK6Programmer.exe -V5 -s <COM_PORT> -P 1000000 -p FLASH@0x4000=k32w061dk6_zigbee_bdt_ed_ble_beacon_bm.bin
The device will automatically start and try and find a ZigBee network.
3.6 Running the ZigBee app
To setup and join the device. Start the ZGWUI application and connect the control bridge device. Click Settings, select the COM port of the control bridge and open port. Set the CMSK to 12 and click CMSK. Set the Permit join state to FFFC FE and click Permit Join. Finally, click on Start NWK.
The dual mode device should join the network and show it’s device information in the “Received Messages” dialogue box. The LD2 on the dual mode device can now be toggled by sending a toggle command to the device from the “On/Off Cluster” page in ZGWUI. Refer to the JN-AN-1247 documentation for
3.7 Download the IoT Toolbox for your smartphone
In order to use the Bluetooth Low Energy examples, the NXP IoT Toolbox needs to be installed on a smartphone. This application provides several examples that can be used in conjunction with the connectivity stack to connect your phone to the development board over BLE.
3.8 Running the BLE app
Open the IoT Toolbox app on your smartphone and select the “Beacons” icon to preview the beacons transmitted by the device.