Let's take your USB-KW019032 for a test drive!
Your USB-KW019032 Power green LED and OpenSDA blue LED should stay ON when you connect the board.
In this step, we are going to guide you through the process to get the required software to enable the USB-KW019032 dongle as a IEEE 802.15.4 sniffer. You can also use the USB-KW019032 as a development platform. Select the option you want to accomplish with your USB-KW019032.
Test Tool for Connectivity Products is a set of graphical user interface modules and applications for testing and deploying Kinetis-W wireless. This tool offers a protocol analyzer for the Kinetis-W family and a Kinetis Firmware Loader.
Download and install the driver for your USB-KW019032. Before running the driver installer, you MUST have the board plugged in to your PC.
This step only applies in case you previously downloaded other demo to your board and you require to re-program the board with the snifer application.
You can find this binary and the versions for the EU & JA bands of the sniffer app in the next path after installing the KW01 Connectivity Software v1.0.0:
In this step, you will be guided to download the software and tools required to build and run the connectivity solutions.
The KW01 Connectivity Software package integrates the Kinetis Software Development Kit 1.3 and all the wireless connectivity stacks required to develop your solution using IEEE 802.15.4 and SMAC wireless connectivity stacks.
Click below to download the KW01 Connectivity Software v1.0.0 for your computer.
IAR Embedded Workbench for Arm ® (EWARM) version 7.40.2 or later is the development toolchain used to deploy software applications using the NXP Connectivity stacks. NXP provides example EWARM workspace projects for you to start your development.
Want to use a different toolchain?
Right now, the only supported toolchain is IAR Embedded Workbench for Arm; we are currently working on the enablement of NXP KDS for the Connectivity stacks.
Many of the example applications output data over the MCU UART so you'll want to make sure that the driver for the board's virtual COM port is installed. Before you run the driver installer, you MUST have the board plugged in to your PC.
With the serial port driver installed, run your favorite terminal application to view the serial output from the MCU's UART. Configure the terminal to 115200 baud rate, 8 data bits, no parity and 1 stop bit. To determine the port number of the USB-KW019032's virtual COM port, open the device manager and look under the "Ports" group.
Not sure how to use a terminal application? Try one of these tutorials:
Connect your USB-KW019032 to your PC, MBED (E:) will be detected.
Drag and drop the Sniffer_usbkw01_US.bin to MBED (E:) using the MSD capabilities of the CMSIS-DAP.
MBED (E:) will blink, disconnect the board, connect it again and the new firmware will start to run in the KW01.
Tera Term is a very popular open source terminal emulation application. This program can be used to display information sent from your NXP development platform's virtual serial port.
PuTTY is a popular terminal emulation application. This program can be used to display information sent from your NXP development platform's virtual serial port.
Each NXP Connectivity Stack comes with a list of demo applications and driver examples ready to be compiled and run.
USB-KW019032 comes pre-programmed with a sniffer application. Once all the required software is installed in the PC. You are ready to start sniffing your IEEE 802.15.4 applications.
How to use the Test Tool's Protocol Analyzer?
Connect the USB KW019032 to PC
Open the undefinedprotocol analyzer tab.
The undefinedProtocol Analyzer should automatically detect the KW01 sniffer. If not, close the tab, unplug the board, plug it back and re-open the tab. If this doesn’t work, try restarting undefinedTest Tool.undefined
undefinedTo start “sniffing” the desired channel, click the arrow down button from undefinedundefinedDevices: KW01 (COMx) Offundefined and select the desired mode and channel.undefined
undefinedThe tab will change to ON meaning that KW01 will "sniff" on the specified channel. To select other channel, click the tab again and it will switch back to Off. Then select a new channel.
undefinedEach NXP Connectivity Stack comes with a list of demo applications and driver examples ready to be compiled and run.
Each of the Wireless Connectivity Stack comes with a list of demo applications and driver examples ready to be compiled and run
Browse to the " examples\smac" folder to see the application demos:
You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application using one of the Wireless Connectivity Stacks provided by NXP.
Browse to the "examples\ieee_802_15_4" folder to see the application demos:
You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application using one of the Wireless Connectivity Stacks provided by NXP.
You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application using one of the Wireless Connectivity Stacks provided by NXP.
Kinetis BLE Toolbox comes with mobile applications acting as a BLE central device. The Kinetis BLE Toolbox allows you to play with different sensor applications provided by the MKW40Z Connectivity Software v1.0.0. Currently, Heart Rate Sensor and Beacon applications are supported. More demos will be added soon.
After you successfully installed the Kinetis BLE Toolbox. Follow the next steps to learn how to configure and play with Kinetis BLE Toolbox and Wireless Connectivity Applications.
Browse to the "examples\hybrid" folder to see the application demos:
If you are interested in running the preprogrammed Connectivity Test Application that comes with your board
You probably want to build and debug a demo by yourself. Use the guide below to learn how to build and debug an example application using one of the Wireless Connectivity Stacks provided by NXP.
Kinetis BLE Toolbox comes with mobile applications acting as a BLE central device. The Kinetis BLE Toolbox allows you to play with different sensor applications provided by the MKW40Z Connectivity Software v1.0.0. Currently, Heart Rate Sensor and Beacon applications are supported. More demos will be added soon.
After you successfully installed the Kinetis BLE Toolbox. Follow the next steps to learn how to configure and play with Kinetis BLE Toolbox and Wireless Connectivity Applications.
These steps show how to program USB-KW40Z with the sniffer application. In order to enable USB-KW40Z as a sniffer, you need to program both devices (K22F and KW40).
The next tools are needed to be able to program USB-KW40Z:
It is assumed that user already know how to flash USB-KW40Z. This means that user already went through the "Update Software of the USB-KW40Z QSG" document shown in the USB-KW40Z "Getting Started" page when using this board as a development platform.
Sniffer binaries files are located in the next path:
After the binaries are located. Please copy and paste these binary files in the JLink installation path (i.e. "C:\Program Files (x86)\SEGGER\JLink_V502").
NOTE: JLink_V502 folder name might change in the future, it is due to the JLink software version installed, so JLink_V502 or later is required to support KW40Z device
Make sure that Jlink debugger is connected to the corresponding JTAG MK22F connector (J6) in the USB-KW40Z.
Go the JLink installation path, and then open the application "JLink". Next window will be displayed.
Call the next instructions in next order:
In order to program the KW40Z, please, make sure that Jlink debugger is connected to the corresponding SWD MKW40Z connector (J1) in the USB-KW40Z.
Call the next instructions in next order:
A success or "O.K" message should be displayed in the window once the binary file is downloaded.
Unplug and plug again the USB-KW40Z to your PC. Now, sniffer application has been programmed to your USB-KW40Z.
These steps show how to:
The example used below is for "MyWirelessApp" application demo, but these steps can be applied to any of the Wireless Connectivity demo applications.
Note: If you select another project, don't forget to build the required KSDK libraries for that project.
If you don't see this output, verify your terminal settings and connections.
The Connectivity Test Application is a SMAC based Demo Application which provides the user with means to test basic transmission-reception functionalities along with several advanced testing features based on the ASP and SMAC APIs.
The runtime configuration is performed using shortcut keys which are available in most of the application’s menus. The menus or tests will change their behavior based on what settings are applied.
The Connectivity Test Application has four main features:
The Carrier Sense test performs ED continuously until the ED value is above the CCA threshold and then transmit a packet which contains pseudo-random data with the payload size configured using 'n' and 'm' shortcuts.
The Transmission Control test displays a selection menu for number of packets identical with the one in PER TX test and then it prompts the user to enter the inter-packet delay. After that, the application will start sending the selected number of packets with the selected inter-packet delay, using pseudo-random data for the payload with the size configured with 'n' and 'm' shortcuts.
For additional details on how to run the Connectivity Test Application, please refer to the SMAC’s Demonstration Applications User’s Guide.
These steps show how to:
Build the platform libraries required by the application demo.
Build the demo application.
Download and run the demo application.
The example used below is for the heart rate sensor demo, but these steps can be applied to any of the Wireless Connectivity demo applications.
Open the " heart_rate_sensor.eww " IAR workspace.
\bluetooth\heart_rate_sensor\usbkw40z\FreeRTOS\build\iar\ heart_rate_sensor.eww
After the workspace is open, some projects are shown: One for the KSDK platform library and one for the demo application. Build ALL the required KSDK libraries by right clicking on the SDK projects and click on 'Make'.
Select and build the "heart_rate_sensor - Debug" project.
Note: If you select another project, don’t forget to build the required KSDK libraries for that project.
Connect your USB-KW40Z board to your PC.
Right click on the "heart_rate_sensor - Debug" project and select "Set as Active"
Click on "Download and Debug" icon to flash the board.
Press "Stop Debugging" button.
Unplug and plug again the USB to your PC. LEDs labeled as D2 and D3 in the USB will start blinking.
Press SW1 of the USB-KW40Z, LED D2 will start blinking indicating that the board is in advertising/discoverable mode.
Please, see section 3.3 How to play with the Bluetooth Low Energy Connectivity Demos? to learn how to play with the app.
Refer to
These steps show how to:
Build the platform libraries required by the application demo.
Build the demo application.
Download and run the demo application.
The example used below is for “dual_mode_demo”, but these steps can be applied to any of the Wireless Connectivity demo applications.
Open the " dual_mode_demo.eww " IAR workspace.
ble_802_15_4_dual_mode_demo\usbkw40z\bare_metal\build\iar\ dual_mode_demo.eww
After the workspace is open, some projects are shown: One for the KSDK platform library and one for the demo application. Build ALL the required KSDK libraries by right clicking on the SDK projects and click on 'Make'.
Select and build the "dual_mode_demo – dual_mode_debug_BM -Debug" project.
Note: If you select another project, don’t forget to build the required KSDK libraries for that project.
Connect your FRDM-KW40Z board to your PC
Click on "Download and Debug" icon to flash the board.
Open a Terminal Emulator program and open a session to your USB-KW40Z COM port.
Configure the terminal with these settings:
Press "Go" button.
The following output will be displayed in the serial terminal.
If you don't see this output, verify your terminal settings and connections.
Repeat all steps with "MyWirelessApp" End Device demo application to communicate with this device.
Use the Kinetis BLE Toolbox mobile application to play with the BLE part of this demo, which correspond to a Heart Rate Sensor.
Press SW4 of the FRDM-KW40Z, LED1 will start blinking indicating that the board is in advertising/discoverable mode.
Refer to
NXP provides a tool called "Project Cloner" which will allow you to copy an existing demo to use it as a base for your own development, keeping the original demo app sources for reference.
To create a clone of an example project:
Your new project will be located in path specified in the previous step . Open the project in IAR Embedded Workbench for Arm by using the same process described in Section 3.2.
Modify your recently cloned application to start your own design!
For more information about the application and the APIs available, please, look at the "Applications Development Guide".
The Wireless Connectivity Stack platforms make use of the Kinetis SDK low level drivers, take a look into the SDK Demo Applications if you want to add a driver that is not currently used on the Connectivity Demo Applications.
These steps show how to open a demo workspace in IAR Embedded Workbench, how to build the platform library required by the demo, and how to build the demo application. The example used below is for the hello_world demo, but similar steps can be applied to any demo in the KSDK.
Open demo workspace (*.eww file) in:
After the workspace is open, two projects are shown: one for the KSDK platform library and one for the demo. Also, the platform library project is bold, indicating that it is the active project. The active project can be changed at any time by right clicking on the desired project and selecting "Set as Active" or via the build target drop-down at the top of the workspace browser.
There are two project configurations (build targets) supported for each KSDK project:
Click the "Make" button, highlighted in red below.
When the build is complete, the library (libksdk_platform.a) is generated in one of the following directories, according to the chosen build target:
The KSDK demo applications are built upon the software building blocks provided in the Kinetis SDK platform library, built in the previous section. If the platform library is not present, the linker displays an error indicating that it cannot find the library. An easy way to check whether the library is present is to expand the Output folder in the ksdk_platform_lib project. If the platform library binary is not built and present, follow the steps on page 1 to build it. Otherwise, continue with the following steps to build the desired demo application.
If not already done, open the desired demo application workspace (*.eww file). This example's workspace file is located in:
Select the desired build target from the drop-down. For this example, select the "hello_world – Debug" target.
To build the demo application, click the "Make" button, highlighted in red below.
The build will complete without errors.
The FRDM-K64F board comes loaded with the mbed/CMSIS-DAP debug interface from the factory. If you have changed the debug OpenSDA application on your board, visit http://www.nxp.com/opensda for information on updating or restoring your board to the factory state.
Connect the development platform to your PC via USB cable between the "SDAUSB" USB port on the board and the PC USB connector.
Open the terminal application on the PC (such as PuTTY or TeraTerm) and connect to the debug COM port you determined earlier. Configure the terminal with these settings:
Click the "Download and Debug" button to download the application to the target.
The application is then downloaded to the target and automatically runs to the main() function.
Run the code by clicking the "Go" button to start the application.
The hello_world application is now running and a banner is displayed on the terminal. If this is not the case, check your terminal settings and connections.
These steps show how to:
Build the platform libraries required by the application demo
Build the demo application.
Download and run the demo application.
The example used below is for the SMAC Connectivity Test demo, but these steps can be applied to any of the Wireless Connectivity demo applications.
Open the " Connectivity_Test.eww " IAR workspace.
After the workspace is open, some projects are shown: One for the KSDK platform library and one for the demo application. Build ALL the required KSDK libraries by right clicking on the SDK projects and click on 'Make'.
Select and build the "Connectivity_Test - Debug" project.
Note: If you select another project, don't forget to build the required KSDK libraries for that project.
Connect your FRDM-KW40Z board to your PC.
Right click on the "Connectivity_Test – Debug" project and select "Set as Active"
Click on "Download and Debug" icon to flash the board.
Open a Terminal Emulator program and open a session to your USB-KW40Z COM port.
Configure the terminal with these settings:
Press "Go" button.
The following output will be displayed in the serial terminal.
If you don't see this output, verify your terminal settings and connections.
Refer to
These steps show how to:
Build the platform libraries required by the application demo.
Build the demo application.
Download and run the demo application.
The example used below is for “MyWirelessApp” application demo (Coordinator), but these steps can be applied to any of the Wireless Connectivity demo applications.
Open the " MyWirelessAppCoordinator.eww " IAR workspace.
\ieee_802_15_4\MyWirelessApp\Coordinator\usbkw40z\FreeRTOS\build\iar\ MyWirelessAppCoordinator.eww
After the workspace is open, some projects are shown: One for the KSDK platform library and one for the demo application. Build ALL the required KSDK libraries by right clicking on the SDK projects and click on 'Make'.
Select and build the "MyWirelessAppCoordinator - Debug" project.
Note: If you select another project, don’t forget to build the required KSDK libraries for that project.
Connect your USB-KW40Z board to your PC.
Right click on the "MyWirelessAppCoordinator – Debug" project and select "Set as Active"
Click on "Download and Debug" icon to flash the board.
Open a Terminal Emulator program and open a session to your USB-KW40Z COM port.
Configure the terminal with these settings:
Press "Go" button.
The following output will be displayed in the serial terminal.
If you don't see this output, verify your terminal settings and connections.
Now unplug the first board, and plug in the other USB-KW40Z.
Program the second USB-KW40Z with the "MyWirelessApp"
End Device demo application which can be found at
Close any open terminal windows, then power cycle both boards, and with both boards plugged into your computer, open up a terminal window for each board.
Press SW1 on the Coordinator board, and then press SW1 on the board programmed with the EndDevice application, and wait for them to connect.
Once connected, type into the terminal of either of the boards, and you will see the text print out on the other board.
Refer to
These steps show how to:
Configure Kinetis Protocol Analyzer Adapter and Wireshark Network Analyzer.
Sniff IEEE 802.15.4 wireless applications.
Open the "Kinetis Protocol Analyzer Adapter".
Make sure, you have USB-KW40Z connected to your PC when opening Kinetis Protocol Analyzer Adapter, it will start looking for Kinetis sniffer hardware. Once USB-KW40Z is detected, KW40Z device will be displayed.
Click on the Wireshark icon to open Wireshark Network Protocol Analyzer.
Wireshark Network Analyzer will be opened. On the "Capture" option of the main window, select the Local Area Connection that was created by the Kinetis Protocol Analyzer, in this example, Kinetis Protocol Analyzer created "Local Area Connection 2", then click "Start" button.
"Capture" window will be opened.
Select the desired IEEE 802.15.4 channel to scan in the Kinetis Protocol Analyzer Adapter window. In this guide, we are going to select channel 19 as an example.
USB-KW40Z will start to sniff and upcoming data will be displayed in the "Capture" window of the Wireshark Network Protocol Analyzer.
Refer to the "Kinetis Protocol Analyzer Adapter User's
Guide" for more information about how to enable other
features of your USB-KW40Z sniffer. Document can be
found in the next path:
These steps show how to:
Configure Kinetis Protocol Analyzer Adapter and Wireshark Network Analyzer.
Sniff BLE wireless applications.
Open the "Kinetis Protocol Analyzer Adapter".
Make sure, you have USB-KW40Z connected to your PC when opening Kinetis Protocol Analyzer Adapter, it will start looking for Kinetis sniffer hardware. Once USB-KW40Z is detected, KW40Z device will be displayed.
Click on the Wireshark icon to open Wireshark Network Protocol Analyzer.
Wireshark Network Analyzer will be opened. On the "Capture" option of the main window, select the Local Area Connection that was created by the Kinetis Protocol Analyzer, in this example, Kinetis Protocol Analyzer created "Local Area Connection 2", then click "Start" button.
"Capture" window will be opened.
Select the desired advertising channel to scan in the Kinetis Protocol Analyzer Adapter window. In this guide, we are going to select All option to start sniffing on all advertising channels (37, 38 and 39). However, you could select different advertising channels of interest to sniff.
Address Filter is selected in this guide, hence, only data upcoming from the specified address will be displayed on the "Capture" window. If you are not interested on following any specific address, you can provide a Hopping interval to sniff any device in the advertising channels.
USB-KW40Z will start to sniff and upcoming data will be displayed in the "Capture" window of the Wireshark Network Protocol Analyzer.
Refer to the "Kinetis Protocol Analyzer Adapter User's
Guide" for more information about how to enable other
features of your USB-KW40Z sniffer. Document can be
found in the next path:
This document describes how to update or program a new application in the USB-KW40Z using J-Link debugger.
USB-KW40Z contains two MCUs that need to be programmed depending on the desired use case. Hence, USB-KW40Z contains two connectors to program the board. These connectors are shown in the figure 1 as "SWD MKW40Z" and "JTAG MK22F".
Figure 1. USB-KW40Z Hardware
When an application needs to be programmed in the MK22FN512 MCU, "JTAG MK22F" connector is used. Different from this, "SWD MKW40Z" connector is used when programming KW40Z device. In order to be able to program an application to the USB-KW40Z using JLink, ".bin" files are needed because it is the format that JLink application requires in order to be able to program a board. Please, follow the next steps to program USB-KW40Z.
Locate the .bin file that need to be programmed in the USB-KW40Z. In this case, this file is the one downloaded from the "Getting Started" web page.
Go to JLink installation path. (i.e. " C:\Program Files (x86)\SEGGER\JLink_V502")
Copy and paste the ".bin" file into the JLink installation path. Just as an example, in this document, a file called "usb-kw40z_cmsis-dap.bin" for the MK22FN512 MCU will be used.
Make sure that Jlink debugger is connected to the corresponding JTAG MK22F connector (J6) in the USB-KW40Z.
Figure 2. JLink debugger connected to JTAG MK22F connector
Go the JLink installation path, and then open the application "JLink". Windows shown in figure 3 will be displayed.
Figure 3. JLink application
Call the next instructions in next order:
unlock kinetis
device mk22fn512xxx12
loadbin usb-kw40z_cmsis-dap.bin 0
One important thing to note in the step 6 is the "loadbin" command. The name of the file to be programmed in the MCU is specified in this command. In this case, "usb-kw40z_cmsis-dap.bin" is used as an example for this document.
A success or "O.K." message should be displayed in the window once the binary file is downloaded.
Disconnect and reconnect the board.
Now, an application to the K22F MCU was successfully downloaded.