Let's take your FRDM-KW019032 for a test drive!
Note: this page is made available for historical reference only.
The LEDs on your FRDM-KW019032 should start flashing in serial mode when you connect the board.
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 developent.
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 FRDM-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:
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:
If you are interested in running the preprogrammed connectivity test demo that comes with your board Click here
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\smac" folder to see the application demos:
If you are interested in running the preprogrammed TSCH Application that comes with your
board
Click here
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.
3.2 Build, Run and Debug Wireless Connectivity Examples
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.
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.
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 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-KL43Z board comes loaded with the PE micro 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-KW019032 board to your PC.
Open a Terminal Emulator program and open a session to your FRDM-KW019032 COM port. Configure the terminal with these settings:
Click on "Download and Debug" icon to flash the board.
The following output will be displayed.
If you don't see this output, verify 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 “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 FRDM-KW019032 board to your PC.
Open a Terminal Emulator program and open a session to your FRDM-KW019032 COM port. Configure the terminal with these settings:
Click on "Download and Debug" icon to flash the board.
The following output will be displayed
If you don't see this output, verify 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 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 USB-KW40Z board to your PC
Right click on the " dual_mode_demo – dual_mode_debug_BM -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 a 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.
Use the Kinetis BLE Toolbox mobile application to play with the BLE part of this demo, which correspond to a Heart Rate Sensor. 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:
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.
Your FRDM-KW019032 boards are loaded with a MAC TSCH demo that allows network nodes to hop on a set of channels based on a time division manner, the mechanism being Time Slotted Channel Hopping (TSCH). TSCH allows networks nodes to exchange data frames on various frequencies being recommended for regions where local regulations limit the continuous transmission time on a frequency of a node to a certain duration.
The TSCH demo will start with a sequence of LEDs indicating that the application is in the pre-MAC start state.
2 FRDM-KW01 boards are needed to run this demo.
The available demo applications are:
After configuring both devices as a Coordinator and as an End Device respectively, the application will start in a moment. In both boards, the RGB LED will toggle with a reception and D8 LED will toggle with a transmission. To monitor the traffic, one or multiple sniffers can be used set on the channels the two devices hop on (US ISM Band).
This application also can be used to test the range of the boards by watching that the LEDs continue toggling with the distance.
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.
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.