This directory contains example platform drivers for the [NXP K32W061][k32w061] based on [K32W061-DK006][k32w061-dk006] hardware platform.
The example platform drivers are intended to present the minimal code necessary to support OpenThread. As a result, the example platform drivers do not necessarily highlight the platform's full capabilities.
OpenThread environment is suited to be run on a Linux-based OS. Recommended OS is Ubuntu 18.04.2 LTS. Download and install the MCUXpresso IDE.
In a Bash terminal (found, for example, in Ubuntu OS), follow these instructions to install the GNU toolchain and other dependencies.
$ cd <path-to-openthread> $ ./script/bootstrap
If a network connection timeout is encountered, re-run the script.
Python-pip is also required for the build. User can install it by running “sudo apt-get install python-pip” in bash. After installing Python-pip, execute “pip install pycryptodome” in bash. This is needed for signing the built binary in order to load it on the board. Also, pycrypto “pip install pycrypto” is required for PKCS1.
Windows 10 offers the possibility of running bash by installing “Ubuntu on Windows” from Microsoft Store. This application allows the user to use Ubuntu Terminal and run Ubuntu command line utilities including bash, ssh, git, apt and many more. If this option is used, it is recommended to add instructions for the path mapping in MCUXpresso IDE. This can be done after adding the project to the workspace by going to Run->“Debug Configuration”->“C/C++(NXP Semiconductors) MCU Application”->Source->Add. Then the user should create a path mapping such that MCUXpresso IDE will find the mount point for the “Ubuntu in Windows” subsystem. For example, user can enter compilation path recognized by Ubuntu as /mnt/c/, while equivalent “Local file system path” is C:/. This example assumes that the openthread package is installed on the C drive.
$ cd <path-to-openthread> $ ./bootstrap $ make -f examples/Makefile-k32w061
After a successful build, the elf
files are found in <path-to-openthread>/output/k32w061/bin
.
Connect to the board by plugging a mini-USB cable to the connector marked with TARGET on the DK6 board. This connector is situated on the same side with the power connector.
OpenThread example application compiled binaries can be found in <path-to-openthread>/output/k32w061/bin
and include FTD (Full Thread Device) and MTD (Minimal Thread Device) variants of CLI and NCP applications. The compiled binaries can be flashed onto the K32W061 using MCUXpresso IDE. This requires the following steps:
Prepare two boards with the flashed CLI Example
(as shown above). Make sure that the JN4 jumper is set to RX and the JN7 jumper is set to TX, connecting the LPC and JN UART0 pins.
The CLI example uses UART connection. To view raw UART output, start a terminal emulator like PuTTY and connect to the used COM port with the following UART settings:
Open a terminal connection on the first board and start a new Thread network.
> panid 0xabcd Done > ifconfig up Done > thread start Done
> state Leader
> panid 0xabcd Done > ifconfig up Done > thread start Done
> state Child
> ipaddr fdde:ad00:beef:0:0:ff:fe00:fc00 fdde:ad00:beef:0:0:ff:fe00:9c00 fdde:ad00:beef:0:4bcb:73a5:7c28:318e fe80:0:0:0:5c91:c61:b67c:271c
> ping fdde:ad00:beef:0:0:ff:fe00:fc00 16 bytes from fdde:ad00:beef:0:0:ff:fe00:fc00: icmp_seq=1 hlim=64 time=8ms
For a list of all available commands, visit OpenThread CLI Reference README.md.