FRDM-K22F

Overview

The Freedom-K22F is an ultra-low-cost development platform for Kinetis K22 MCUs.

  • Form-factor compatible with the Arduino R3 pin layout

  • Peripherals enable rapid prototyping, including a 6-axis digital accelerometer and magnetometer to create full eCompass capabilities, a tri-colored LED and 2 user push-buttons for direct interaction, a optional microSD card slot, and headers for use with Bluetooth* and 2.4 GHz radio add-on modules

  • OpenSDAv2, the NXP open source hardware embedded serial and debug adapter running an open source bootloader, offers options for serial communication, flash programming, and run-control debugging

Hardware

  • MK22FN512VLH12 (120 MHz, 512 KB flash memory, 128 KB RAM, low-power, crystal-less USB, and 64 pin Low profile Quad Flat Package (LQFP))

  • Dual role USB interface with micro-B USB connector

  • RGB LED

  • FXOS8700CQ accelerometer and magnetometer

  • Two user push buttons

  • Flexible power supply option - OpenSDAv2 USB, Kinetis K22 USB, and external source

  • Easy access to MCU input/output through Arduino* R3 compatible I/O connectors

  • Programmable OpenSDAv2 debug circuit supporting the CMSIS-DAP Interface software that provides:

    • Mass storage device (MSD) flash programming interface

    • CMSIS-DAP debug interface over a driver-less USB HID connection providing run-control debugging and compatibility with IDE tools

    • Virtual serial port interface

    • Open source CMSIS-DAP software project

  • Optional SDHC

For more information about the K22F SoC and FRDM-K22F board:

Supported Features

The frdm_k22f 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.
frdm_k22f
/
mk22f51212

Type

Location

Description

Compatible

CPU

on-chip

ARM Cortex-M4F CPU1

arm,cortex-m4f

ADC

on-chip

Kinetis ADC161

nxp,kinetis-adc16

Clock control

on-chip

NXP Kinetis Multipurpose Clock generator (MCG) IP node1

nxp,kinetis-mcg

on-chip

Kinetis System Integration Module (SIM) IP node1

nxp,kinetis-sim

on-chip

Generic fixed factor clock provider4

fixed-factor-clock

DAC

on-chip

NXP Kinetis MCUX DAC1 1

nxp,kinetis-dac

Flash controller

on-chip

NXP Kinetis Flash Memory Module E (FTFE)1

nxp,kinetis-ftfe

GPIO & Headers

on-chip

Kinetis GPIO5

nxp,kinetis-gpio

on-board

GPIO pins exposed on Arduino Uno (R3) headers1

arduino-header-r3

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

on-board

Group of PWM-controlled LEDs1

pwm-leds

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

NXP FlexTimer Module (FTM) PWM controller1

nxp,ftm-pwm

RNG

on-chip

Kinetis RNGA (Random Number Generator Accelerator)1

nxp,kinetis-rnga

Sensors

on-board

FXOS8700 6-axis accelerometer/magnetometer sensor1

nxp,fxos8700

Serial controller

on-chip

Kinetis UART1 3

nxp,kinetis-uart

SPI

on-chip

NXP DSPI controller1 1

nxp,dspi

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)3

nxp,ftm

USB

on-chip

NPX Kinetis USBFSOTG Controller in device mode1

nxp,kinetis-usbd

Watchdog

on-chip

Kinetis watchdog1

nxp,kinetis-wdog

Note

For additional features not yet supported, please also refer to the FRDM-K64F, which is the superset board in NXP’s Kinetis K series. NXP prioritizes enabling the superset board with NXP’s Full Platform Support for Zephyr. Therefore, the frdm_k64f board may have additional features already supported, which can also be re-used on this frdm_k22f board.

Connections and IOs

The K22F SoC has five pairs of pinmux/gpio controllers.

Name

Function

Usage

PTA1

GPIO

Red LED

PTA2

GPIO

Green LED

PTD5

GPIO

Blue LED

PTC1

GPIO

SW2

PTD0

GPIO

FXOS8700 INT1

PTD1

GPIO

FXOS8700 INT2

PTB17

GPIO

SW3

PTE1

UART1_RX

UART Console

PTE0

UART1_TX

UART Console

PTD2

UART2_RX

UART BT HCI

PTD3

UART2_TX

UART BT HCI

PTC4

SPI0_PCS0

SPI

PTD1

SPI0_SCK

SPI

PTD2

SPI0_SOUT

SPI

PTD3

SPI0_SIN

SPI

PTB2

I2C0_SCL

I2C / FXOS8700

PTB3

I2C0_SDA

I2C / FXOS8700

System Clock

The K22F SoC is configured to use the 8 MHz crystal oscillator on the board with the on-chip PLL to generate a 72 MHz system clock in its RUN mode. This clock was selected to allow for the maximum number of peripherals to be used with the crystal and PLL clocks. Other clock configurations are possible through NXP SDK currently.

Serial Port

The K22F SoC has three UARTs. One is configured for the console, another for BT HCI, and the remaining are not used.

USB

The K22F SoC has a USB OTG (USBOTG) controller that supports both device and host functions through its micro USB connector (K22F USB). Only USB device function is supported in Zephyr at the moment.

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 J26.

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 frdm_k22f 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 v2.0.0 *****
Hello World! frdm_k22f

Debugging

Here is an example for the Hello World application.

# From the root of the zephyr repository
west build -b frdm_k22f 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 v2.0.0 *****
Hello World! frdm_k22f

Support Resources for Zephyr