TWR-KE18F

Overview

The TWR-KE18F is a development board for NXP Kinetis KE1xF 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

  • MKE18F512VLL16 MCU (up to 168 MHz, 512 KB flash memory, 64 KB RAM, and 100 Low profile Quad Flat Package (LQFP))

  • 3.3 V or 5 V MCU operation

  • 6-axis FXOS8700CQ digital accelerometer and magnetometer

  • RGB LED

  • Four user LEDs

  • Two user push-buttons

  • Potentiometer

  • Thermistor

  • Infrared port (IrDA)

  • CAN pin header

  • Flex I/O pin header

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

Supported Features

The twr_ke18f 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_ke18f
/
mke18f16

Type

Location

Description

Compatible

CPU

on-chip

ARM Cortex-M4F CPU1

arm,cortex-m4f

ADC

on-chip

NXP ADC121 2

nxp,adc12

CAN

on-chip

NXP FlexCAN controller1 1

nxp,flexcan

Clock control

on-chip

Kinetis KE1xF System Integration Module (SIM) IP node1

nxp,kinetis-ke1xf-sim

on-chip

NXP Kinetis SCG (System Clock Generator) IP node1

nxp,kinetis-scg

on-chip

Generic fixed-rate clock provider4

fixed-clock

on-chip

Generic fixed factor clock provider14

fixed-factor-clock

on-chip

NXP Kinetis PCC (Peripheral Clock Controller) IP node1

nxp,kinetis-pcc

Comparator

on-chip

NXP Kinetis ACMP (Analog CoMParator)3

nxp,kinetis-acmp

Counter

on-chip

NXP LPTMR1

nxp,lptmr

DAC

on-chip

NXP Kinetis MCUX DAC321

nxp,kinetis-dac32

DMA

on-chip

NXP MCUX EDMA controller1

nxp,mcux-edma

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

NXP LPI2C controller2

nxp,lpi2c

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

on-board

Group of PWM-controlled LEDs1

pwm-leds

Miscellaneous

on-chip

NXP FlexIO controller1

nxp,flexio

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

PWM

on-chip

Kinetis PWT PWM Capture1

nxp,kinetis-pwt

on-chip

NXP FlexTimer Module (FTM) PWM controller2

nxp,ftm-pwm

RTC

on-chip

NXP Real Time Clock (RTC)1

nxp,rtc

Sensors

on-board

FXOS8700 6-axis accelerometer/magnetometer sensor1

nxp,fxos8700

on-chip

NXP Kinetis temperature sensor1 2

nxp,kinetis-temperature

Serial controller

on-chip

NXP LPUART1 2

nxp,lpuart

SPI

on-chip

NXP LPSPI controller2

nxp,lpspi

SRAM

on-chip

Generic on-chip SRAM description1

mmio-sram

Timer

on-chip

ARMv7-M System Tick1

arm,armv7m-systick

on-chip

NXP FlexTimer Module (FTM)2

nxp,ftm

Watchdog

on-chip

NXP watchdog (WDOG32)1

nxp,wdog32

System Clock

The KE18 SoC is configured to use the 8 MHz external oscillator on the board with the on-chip PLL to generate a 120 MHz system clock.

Serial Port

The KE18 SoC has three UARTs. UART0 is configured for the console. The remaining UARTs are not used.

Accelerometer and magnetometer

The TWR-KE18F 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) the 0 ohm resistors R47 and R57 must be mounted on the TWR-KE18F board. The devicetree must also be modified to describe the FXOS8700 interrupt GPIOs:

/dts-v1/;

&fxos8700 {
        int1-gpios = <&gpioa 14 0>;
        int2-gpios = <&gpioc 17 0>;
};

Finally, a trigger option must be enabled in Kconfig (either FXOS8700_TRIGGER_GLOBAL_THREAD=y or FXOS8700_TRIGGER_OWN_THREAD=y).

Programming and Debugging

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

Configuring a Debug Probe

A debug probe is used for both flashing and debugging the board. This board is configured by default to use the OpenSDA DAPLink Onboard Debug Probe.

Early versions of this board have an outdated version of the OpenSDA bootloader and require an update. Please see the DAPLink Bootloader Update page for instructions to update from the CMSIS-DAP bootloader to the DAPLink bootloader.

Configuring a Console

Regardless of your choice in debug probe, we will use the OpenSDA microcontroller as a usb-to-serial adapter for the serial console.

Connect a USB cable from your PC to J2.

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_ke18f 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_ke18f

Debugging

Here is an example for the Hello World application.

# From the root of the zephyr repository
west build -b twr_ke18f 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_ke18f

Support Resources for Zephyr