boards/nxp/twr_kv58f220m/doc/index.rst
.. zephyr:board:: 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
For more information about the KV5x SoC and the TWR-KV58F220M board, see these NXP reference documents:
KV5x Website_KV5x Datasheet_KV5x Reference Manual_TWR-KV58F220M Website_TWR-KV58F220M User Guide_TWR-KV58F220M Schematics_.. zephyr:board-supported-hw::
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.
The KV58 SoC has six UARTs. UART0 is configured for the console. The remaining UARTs are not used.
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
.. zephyr:board-supported-runners::
Build and flash applications as usual (see :ref:build_an_application and
:ref:application_run for more details).
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 :ref:jlink-debug-host-tools and make sure they are in your search
path.
.. zephyr-app-commands:: :zephyr-app: samples/hello_world :tool: all :board: twr_kv58f220m :goals: build
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.):
Here is an example for the :zephyr:code-sample:hello_world application.
.. zephyr-app-commands:: :zephyr-app: samples/hello_world :board: twr_kv58f220m :goals: flash
Open a serial terminal, reset the board (press the SW1 button), and you should see the following message in the terminal:
.. code-block:: console
***** Booting Zephyr OS v1.14.0-xxx-gxxxxxxxxxxxx ***** Hello World! twr_kv58f220m
Here is an example for the :zephyr:code-sample:hello_world application.
.. zephyr-app-commands:: :zephyr-app: samples/hello_world :board: twr_kv58f220m :goals: debug
Open a serial terminal, step through the application in your debugger, and you should see the following message in the terminal:
.. code-block:: console
***** Booting Zephyr OS v1.14.0-xxx-gxxxxxxxxxxxx ***** Hello World! twr_kv58f220m
.. include:: ../../common/board-footer.rst.inc
.. _TWR-KV58F220M Website: https://www.nxp.com/TWR-KV58F220M
.. _TWR-KV58F220M User Guide: https://www.nxp.com/webapp/Download?colCode=TWRKV58F220MUG
.. _TWR-KV58F220M Schematics: https://www.nxp.com/webapp/Download?colCode=TWR-KV58F220M-SCH
.. _KV5x Datasheet: https://www.nxp.com/docs/en/data-sheet/KV5XP144M240.pdf
.. _KV5x Reference Manual: https://www.nxp.com/webapp/Download?colCode=KV5XP144M240RM