TWR-KV58F220M

Overview

The TWR-KV58F220M is a development board for NXP Kinetis KV5x 32-bit MCU-based platforms. The onboard OpenSDAv2 serial and debug adapter, running an open source bootloader, offers options for serial communication, flash programming, and run-control debugging.

Hardware

  • MKV58F1M0VLQ24 MCU (up to 240 MHz, 1 MB flash memory, 256 KB RAM, and 144 Low profile Quad Flat Package (LQFP))

  • 1.8 V or 3.3 V MCU operation

  • 6-axis FXOS8700CQ digital accelerometer and magnetometer

  • Four user LEDs

  • Four user push-buttons

  • Potentiometer

  • Two general purpose TWRPI headers

  • Motor pin header

For more information about the KV5x SoC and the TWR-KV58F220M board, see these NXP reference documents:

Supported Features

The twr_kv58f220m board supports the hardware features listed below.

on-chip / on-board
Feature integrated in the SoC / present on the board.
2 / 2
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files.
vnd,foo
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.
twr_kv58f220m
/
mkv58f24

Type

Location

Description

Compatible

CPU

on-chip

ARM Cortex-M7 CPU1

arm,cortex-m7

ADC

on-chip

Kinetis ADC161

nxp,kinetis-adc16

Clock control

on-chip

Kinetis System Integration Module (SIM) IP node1

nxp,kinetis-sim

on-chip

Generic fixed factor clock provider4

fixed-factor-clock

on-chip

NXP Kinetis Multipurpose Clock generator (MCG) IP node1

nxp,kinetis-mcg

Flash controller

on-chip

NXP Kinetis Flash Memory Module E (FTFE)1

nxp,kinetis-ftfe

GPIO & Headers

on-chip

Kinetis GPIO5

nxp,kinetis-gpio

I2C

on-chip

Kinetis I2C1 1

nxp,kinetis-i2c

Input

on-board

Group of GPIO-bound input keys1

gpio-keys

Interrupt controller

on-chip

ARMv7-M NVIC (Nested Vectored Interrupt Controller)1

arm,v7m-nvic

LED

on-board

Group of GPIO-controlled LEDs1

gpio-leds

MMU / MPU

on-chip

NXP System Memory Protection Unit (SYSMPU)1

nxp,sysmpu

MTD

on-chip

Flash node1

soc-nv-flash

on-board

Fixed partitions of a flash (or other non-volatile storage) memory1

fixed-partitions

Pin control

on-chip

NXP PORT Pin Controller5

nxp,port-pinmux

on-chip

NXP PORT Pin Controller1

nxp,port-pinctrl

Sensors

on-board

FXOS8700 6-axis accelerometer/magnetometer sensor1

nxp,fxos8700

Serial controller

on-chip

Kinetis UART1 5

nxp,kinetis-uart

SPI

on-chip

NXP DSPI controller3

nxp,dspi

SRAM

on-chip

Generic on-chip SRAM1

mmio-sram

Timer

on-chip

ARMv7-M System Tick1

arm,armv7m-systick

on-chip

NXP FlexTimer Module (FTM)4

nxp,ftm

System Clock

The KV58 SoC is configured to use the 50 MHz external oscillator on the board with the on-chip PLL to generate a 237.5 MHz system clock.

Serial Port

The KV58 SoC has six UARTs. UART0 is configured for the console. The remaining UARTs are not used.

Accelerometer and magnetometer

The TWR-KV58F220M board by default only supports polling the FXOS8700 accelerometer and magnetometer for sensor values (CONFIG_FXOS8700_TRIGGER_NONE=y).

In order to support FXOS8700 triggers (interrupts), shunts must be placed on the jumpers J2 and J9. A trigger option also must be enabled in Kconfig (either CONFIG_FXOS8700_TRIGGER_GLOBAL_THREAD=y or CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y).

Programming and Debugging

The twr_kv58f220m board supports the runners and associated west commands listed below.

flash debug debugserver rtt attach
jlink ✅ (default) ✅ (default)

Build and flash applications as usual (see Building an Application and Run an Application for more details).

Configuring a Debug Probe

This board integrates an OpenSDA debug probe. However, it can currently only be used for flashing the KV58 SoC by copying the compiled firmware to the USB Mass Storage Device. The board cannot be debugged using the OpenSDA probe, since pyOCD does not support the target. The OpenSDA J-Link firmware (as of release 2019-06-03) also cannot be used, since the flash algorithm for the KV58 seems to be broken at the time of writing.

An external J-Link debug probe connected to the JTAG header J13 is used to debug the target.

Install the J-Link Debug Host Tools and make sure they are in your search path.

Using west:

# From the root of the zephyr repository
west build -b twr_kv58f220m samples/hello_world

Using CMake and ninja:

# From the root of the zephyr repository
# Use cmake to configure a Ninja-based buildsystem:
cmake -Bbuild -GNinja -DBOARD=twr_kv58f220m samples/hello_world

# Now run the build tool on the generated build system:
ninja -Cbuild

Configuring a Console

Even though the OpenSDA probe cannot be used for debugging, we will use it as a USB-to-serial adapter for the serial console.

Connect a USB cable from your PC to J22.

Use the following settings with your serial terminal of choice (minicom, putty, etc.):

  • Speed: 115200

  • Data: 8 bits

  • Parity: None

  • Stop bits: 1

Flashing

Here is an example for the Hello World application.

# From the root of the zephyr repository
west build -b twr_kv58f220m samples/hello_world
west flash

Open a serial terminal, reset the board (press the SW1 button), and you should see the following message in the terminal:

***** Booting Zephyr OS v1.14.0-xxx-gxxxxxxxxxxxx *****
Hello World! twr_kv58f220m

Debugging

Here is an example for the Hello World application.

# From the root of the zephyr repository
west build -b twr_kv58f220m samples/hello_world
west debug

Open a serial terminal, step through the application in your debugger, and you should see the following message in the terminal:

***** Booting Zephyr OS v1.14.0-xxx-gxxxxxxxxxxxx *****
Hello World! twr_kv58f220m

Support Resources for Zephyr