Hexiwear KW40Z

Overview

See Hexiwear for a general overview of the Hexiwear board and the main application SoC, the K64. The KW40Z is a secondary SoC on the board that provides wireless connectivity with a multimode BLE and 802.15.4 radio.

For more information about the KW40Z SoC:

Supported Features

The hexiwear_kw40z board configuration supports the following hardware features:

Interface Controller Driver/Component
NVIC on-chip nested vector interrupt controller
SYSTICK on-chip systick
PINMUX on-chip pinmux
GPIO on-chip gpio
UART on-chip serial port-polling; serial port-interrupt
RTT on-chip console
FLASH on-chip soc flash

The default configuration can be found in the defconfig file:

boards/arm/hexiwear_kw40z/hexiwear_kw40z_defconfig

Other hardware features are not currently supported by the port.

Connections and IOs

The KW40Z SoC has three pairs of pinmux/gpio controllers, but only one is currently enabled (PORTC/GPIOC) for the hexiwear_kw40z board.

Name Function Usage
PTC6 UART0_RX UART BT HCI
PTC7 UART0_TX UART BT HCI

System Clock

The KW40Z SoC is configured to use the 32 MHz external oscillator on the board with the on-chip FLL to generate a 40 MHz system clock.

Serial Port

The KW40Z SoC has one UART, which is used for BT HCI. The console is available using Segger RTT.

Programming and Debugging

The Hexiwear docking station includes the NXP OpenSDA serial and debug adapter built into the board to provide debugging, flash programming, and serial communication over USB.

To use the pyOCD tools with OpenSDA, follow the instructions in the pyOCD page using the DAPLink Hexiwear Firmware.

To use the Segger J-Link tools with OpenSDA, follow the instructions in the Segger J-Link page using the Segger J-Link OpenSDA V2.1 Firmware.

Because Segger RTT is required for a console to KW40Z, the J-Link tools are recommended.

Flashing

The Segger J-Link firmware does not support command line flashing, therefore the make flash build target is not supported.

Debugging

This example uses the Hello World sample with the Segger J-Link tools. Use the make debug build target to build your Zephyr application, invoke the J-Link GDB server, attach a GDB client, and program your Zephyr application to flash. It will leave you at a gdb prompt.

$ cd <zephyr_root_path>
$ . zephyr-env.sh
$ cd samples/hello_world/
$ make BOARD=hexiwear_kw40z DEBUG_SCRIPT=jlink.sh debug

In a second terminal, open telnet:

$ telnet localhost 19021
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SEGGER J-Link V6.14b - Real time terminal output
J-Link OpenSDA 2 compiled Feb 28 2017 19:27:57 V1.0, SN=621000000
Process: JLinkGDBServer

Continue program execution in GDB, then in the telnet terminal you should see:

***** BOOTING ZEPHYR OS v1.7.99 - BUILD: Apr  6 2017 21:09:52 *****
Hello World! arm