Part 1
요약·해설
KL25Z의 9개 지원 interface와 8개 pin, 48 MHz FLL clock·USB device 제약을 정리하고 LinkServer/J-Link로 hello_world를 flash·debug하는 과정을 설명합니다.
MKL25Z128VLK4 · Cortex-M0+
128 KB Flash · 16 KB SRAM
OpenSDA · LinkServer · J-Link
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
DBF0E1F4371E637BCDF0C8EBBE81A89632E34C4E76A5DC69A14B75366514B27E
.. _frdm_kl25z:
NXP FRDM-KL25Z
##############
Overview
********
The Freedom KL25Z is an ultra-low-cost development platform for
Kinetis |reg| L Series KL1x (KL14/15) and KL2x (KL24/25) MCUs built
on ARM |reg| Cortex |reg|-M0+ processor.
The FRDM-KL25Z features include easy access to MCU I/O, battery-ready,
low-power operation, a standard-based form factor with expansion board
options and a built-in debug interface for flash programming and run-control.
.. image:: ../../../../../../../boards/nxp/frdm_kl25z/doc/frdm_kl25z.jpg
:align: center
:alt: FRDM-KL25Z
Hardware
********
- MKL25Z128VLK4 MCU @ 48 MHz, 128 KB flash, 16 KB SRAM, USB OTG (FS), 80LQFP
- On board capacitive touch "slider", MMA8451Q accelerometer, and tri-color LED
- OpenSDA debug interface
For more information about the KL25Z SoC and FRDM-KL25Z board:
- `KL25Z Website`_
- `KL25Z Datasheet`_
- `KL25Z Reference Manual`_
- `FRDM-KL25Z Website`_
- `FRDM-KL25Z User Guide`_
- `FRDM-KL25Z Schematics`_
Supported Features
==================
The frdm_kl25z 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 |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| ADC | on-chip | adc |
+-----------+------------+-------------------------------------+
| FLASH | on-chip | soc flash |
+-----------+------------+-------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+-------------------------------------+
The default configuration can be found in
:zephyr_file:`boards/nxp/frdm_kl25z/frdm_kl25z_defconfig`
Other hardware features are not currently supported by the port.
Connections and IOs
===================
The KL25Z SoC has five pairs of pinmux/gpio controllers, and all are currently enabled
(PORTA/GPIOA, PORTB/GPIOB, PORTC/GPIOC, PORTD/GPIOD, and PORTE/GPIOE) for the FRDM-KL25Z board.
+-------+-------------+---------------------------+
| Name | Function | Usage |
+=======+=============+===========================+
| PTB2 | ADC | ADC0 channel 12 |
+-------+-------------+---------------------------+
| PTB18 | GPIO | Red LED |
+-------+-------------+---------------------------+
| PTB19 | GPIO | Green LED |
+-------+-------------+---------------------------+
| PTD1 | GPIO | Blue LED |
+-------+-------------+---------------------------+
| PTA1 | UART0_RX | UART Console |
+-------+-------------+---------------------------+
| PTA2 | UART0_TX | UART Console |
+-------+-------------+---------------------------+
| PTE24 | I2C0_SCL | I2C |
+-------+-------------+---------------------------+
| PTE25 | I2C0_SDA | I2C |
+-------+-------------+---------------------------+
System Clock
============
The KL25Z SoC is configured to use the 8 MHz external oscillator on the board
with the on-chip FLL to generate a 48 MHz system clock.
Serial Port
===========
The KL25Z UART0 is used for the console.
USB
===
The KL25Z SoC has a USB OTG (USBOTG) controller that supports both
device and host functions through its mini USB connector (USB KL25Z).
Only USB device function is supported in Zephyr at the moment.
Programming and Debugging
*************************
Build and flash applications as usual (see :ref:`build_an_application` and
:ref:`application_run` 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 :ref:`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.
Option 1: Linkserver: :ref:`opensda-daplink-onboard-debug-probe` (Recommended)
------------------------------------------------------------------------------
Install the :ref:`linkserver-debug-host-tools` and make sure they are in your
search path. LinkServer works with the CMSIS-DAP debug firmware. Please follow the
instructions on :ref:`opensda-daplink-onboard-debug-probe` and select the latest revision
of the firmware image.
Linkserver is the default for this board, ``west flash`` and ``west debug`` will
call the linkserver runner.
.. code-block:: console
west flash
west debug
Option 2: :ref:`opensda-jlink-onboard-debug-probe`
--------------------------------------------------
Install the :ref:`jlink-debug-host-tools` and make sure they are in your search
path.
Follow the instructions in :ref:`opensda-jlink-onboard-debug-probe` to program
the `OpenSDA J-Link FRDM-KL25Z Firmware`_.
Add the arguments ``-DBOARD_FLASH_RUNNER=jlink`` and
``-DBOARD_DEBUG_RUNNER=jlink`` when you invoke ``west build`` to override the
default runner from pyOCD to J-Link:
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: frdm_kl25z
:gen-args: -DBOARD_FLASH_RUNNER=jlink -DBOARD_DEBUG_RUNNER=jlink
:goals: build
Note:
-----
The runners supported by NXP are LinkServer and JLink. pyOCD is another potential option,
but NXP does not test or support the pyOCD runner.
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 J7.
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 :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: frdm_kl25z
: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-rc1 *****
Hello World! frdm_kl25z
Debugging
=========
Here is an example for the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: frdm_kl25z
: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-rc1 *****
Hello World! frdm_kl25z
.. _FRDM-KL25Z Website:
https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/kinetis-cortex-m-mcus/l-seriesultra-low-powerm0-plus/freedom-development-platform-for-kinetis-kl14-kl15-kl24-kl25-mcus:FRDM-KL25Z
.. _FRDM-KL25Z User Guide:
https://www.nxp.com/webapp/Download?colCode=FRDMKL25ZUM
.. _FRDM-KL25Z Schematics:
https://www.nxp.com/downloads/en/schematics/FRDM-KL25Z_SCH_REV_E.pdf
.. _KL25Z Website:
https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/kinetis-cortex-m-mcus/l-seriesultra-low-powerm0-plus/kinetis-kl2x-72-96mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x?&l
.. _KL25Z Datasheet:
https://www.nxp.com/docs/en/data-sheet/KL25P80M48SF0.pdf
.. _KL25Z Reference Manual:
https://www.nxp.com/webapp/Download?colCode=KL25P80M48SF0RM
.. _DAPLink Bootloader Update:
https://os.mbed.com/blog/entry/DAPLink-bootloader-update/
.. _OpenSDA DAPLink FRDM-KL25Z Firmware:
https://www.nxp.com/downloads/en/ide-debug-compile-build-tools/OpenSDAv2.2_DAPLink_frdmkl25z_rev0242.zip
.. _OpenSDA J-Link FRDM-KL25Z Firmware:
https://www.segger.com/downloads/jlink/OpenSDA_FRDM-KL25Z
Part 3
한국어 전문 번역
개요
Freedom KL25Z는 Arm Cortex-M0+ processor 기반 Kinetis L series KL1x(KL14/15)와 KL2x(KL24/25) MCU를 위한 초저가 development platform입니다.
FRDM-KL25Z는 MCU I/O에 쉽게 접근할 수 있고 battery-ready low-power operation을 지원하며, 표준 form factor와 expansion board option, flash programming 및 run-control용 내장 debug interface를 제공합니다.

하드웨어
MKL25Z128VLK4MCU: 48 MHz, 128 KB flash, 16 KB SRAM, USB OTG Full-Speed, 80-pin LQFP- on-board capacitive touch slider
MMA8451Qaccelerometer와 tri-color LED- OpenSDA debug interface
KL25Z SoC와 FRDM-KL25Z의 website, datasheet, reference manual, user guide, schematic은 아래 참고 자료에서 확인할 수 있습니다.
지원 기능
| 인터페이스 | 컨트롤러 | 드라이버/컴포넌트 |
|---|---|---|
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 |
I2C | on-chip | i2c |
ADC | on-chip | adc |
FLASH | on-chip | soc flash |
USB | on-chip | USB device |
기본 구성은 boards/nxp/frdm_kl25z/frdm_kl25z_defconfig에 있습니다. 그 밖의 하드웨어 기능은 현재 이 port에서 지원되지 않습니다.
연결과 입출력
KL25Z SoC에는 pinmux/GPIO controller 쌍이 5개 있으며 FRDM-KL25Z에서는 모두 활성화됩니다: PORTA/GPIOA, PORTB/GPIOB, PORTC/GPIOC, PORTD/GPIOD, PORTE/GPIOE.
| 이름 | 기능 | 용도 |
|---|---|---|
PTB2 | ADC | ADC0 channel 12 |
PTB18 | GPIO | Red LED |
PTB19 | GPIO | Green LED |
PTD1 | GPIO | Blue LED |
PTA1 | UART0_RX | UART Console |
PTA2 | UART0_TX | UART Console |
PTE24 | I2C0_SCL | I2C |
PTE25 | I2C0_SDA | I2C |
System clock
KL25Z SoC는 보드의 8 MHz external oscillator와 on-chip FLL을 사용해 48 MHz system clock을 생성합니다.
Serial port
KL25Z UART0이 console로 사용됩니다.
USB
USB OTG(USBOTG) controller는 USB KL25Z mini USB connector를 통해 device와 host 기능을 모두 지원하지만, 현재 Zephyr에서는 USB device 기능만 지원됩니다.
프로그래밍과 디버깅
일반적인 Zephyr application과 같은 방식으로 build하고 flash합니다. 이 보드는 기본적으로 OpenSDA DAPLink on-board debug probe를 사용합니다.
선택 1: LinkServer/OpenSDA DAPLink(권장)
LinkServer debug host tool을 설치해 search path에 포함하십시오. LinkServer는 CMSIS-DAP debug firmware와 동작하며 OpenSDA DAPLink 지침에서 최신 firmware image revision을 선택해야 합니다. LinkServer가 기본 runner이므로 다음 명령이 linkserver runner를 호출합니다.
west flash
west debug
선택 2: OpenSDA J-Link on-board probe
J-Link debug host tool을 설치하고 OpenSDA J-Link 지침에 따라 OpenSDA J-Link FRDM-KL25Z Firmware를 program하십시오. runner를 pyOCD에서 J-Link로 바꾸려면 두 build argument를 추가합니다.
west build -b frdm_kl25z samples/hello_world -- \
-DBOARD_FLASH_RUNNER=jlink -DBOARD_DEBUG_RUNNER=jlink
Console 구성
debug probe 선택과 관계없이 OpenSDA microcontroller를 serial console용 USB-to-serial adapter로 사용합니다. PC에서 J7으로 USB cable을 연결하고 115200 baud, 8 data bits, parity None, 1 stop bit로 설정하십시오.
Flash
west build -b frdm_kl25z samples/hello_world
west flashserial terminal을 열고 SW1으로 reset하면 다음 출력이 표시됩니다.
***** Booting Zephyr OS v1.14.0-rc1 *****
Hello World! frdm_kl25z
Debug
west build -b frdm_kl25z samples/hello_world
west debugdebugger에서 application을 단계 실행하면 다음 출력이 표시됩니다.
***** Booting Zephyr OS v1.14.0-rc1 *****
Hello World! frdm_kl25z
참고 자료
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.