Skip to content

Commit 3fe53db

Browse files
fbrozovicMaureenHelm
authored andcommitted
boards: arm: frdm_k82f: add support for the NXP FRDM-K82F board
Add support for the NXP FRDM-K82F development board. This board features an NXP MK82FN256VLL15 CPU, a user RGB LED and two buttons, two 32 Mb QSPI flashes, Arduino R3 compatible headers, and a FlexIO header. Signed-off-by: Filip Brozovic <[email protected]>
1 parent 2a2113e commit 3fe53db

10 files changed

+659
-0
lines changed

boards/arm/frdm_k82f/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(CONFIG_PINMUX_MCUX)
4+
zephyr_library()
5+
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
6+
zephyr_library_sources(pinmux.c)
7+
endif()

boards/arm/frdm_k82f/Kconfig.board

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Kconfig - FRDM-K82F board configuration
2+
#
3+
# Copyright (c) 2019 SEAL AG
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
config BOARD_FRDM_K82F
8+
bool "NXP FRDM-K82F"
9+
depends on SOC_SERIES_KINETIS_K8X
10+
select SOC_PART_NUMBER_MK82FN256VLL15
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Kconfig - FRDM-K82F board
2+
#
3+
# Copyright (c) 2019 SEAL AG
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
if BOARD_FRDM_K82F
9+
10+
config BOARD
11+
default "frdm_k82f"
12+
13+
config OSC_XTAL0_FREQ
14+
default 12000000
15+
16+
config MCG_PRDIV0
17+
default 0x0
18+
19+
config MCG_VDIV0
20+
default 0x4
21+
22+
config MCG_FCRDIV
23+
default 1
24+
25+
if FLASH
26+
27+
config SPI
28+
default y
29+
30+
config SPI_NOR
31+
default y
32+
33+
endif # FXOS8700
34+
35+
if FXOS8700
36+
37+
config FXOS8700_DRDY_INT1
38+
default y
39+
40+
endif # FXOS8700
41+
42+
if GPIO_MCUX
43+
44+
config GPIO_MCUX_PORTA
45+
default y
46+
47+
config GPIO_MCUX_PORTB
48+
default y
49+
50+
config GPIO_MCUX_PORTC
51+
default y
52+
53+
config GPIO_MCUX_PORTD
54+
default y
55+
56+
config GPIO_MCUX_PORTE
57+
default y
58+
59+
endif # GPIO_MCUX
60+
61+
if I2C
62+
63+
config I2C_3
64+
default y
65+
66+
endif # I2C
67+
68+
if PINMUX_MCUX
69+
70+
config PINMUX_MCUX_PORTA
71+
default y
72+
73+
config PINMUX_MCUX_PORTB
74+
default y
75+
76+
config PINMUX_MCUX_PORTC
77+
default y
78+
79+
config PINMUX_MCUX_PORTD
80+
default y
81+
82+
config PINMUX_MCUX_PORTE
83+
default y
84+
85+
endif # PINMUX_MCUX
86+
87+
if PWM_MCUX_FTM
88+
89+
config PWM_3
90+
default y
91+
92+
endif # PWM_MCUX_FTM
93+
94+
if SPI
95+
96+
config SPI_1
97+
default y
98+
99+
endif # SPI
100+
101+
if UART_MCUX_LPUART
102+
103+
config UART_MCUX_LPUART_4
104+
default y if UART_CONSOLE
105+
106+
endif # UART_MCUX_LPUART
107+
108+
endif # BOARD_FRDM_K82F

boards/arm/frdm_k82f/board.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
set_ifndef(OPENSDA_FW daplink)
4+
5+
if(OPENSDA_FW STREQUAL jlink)
6+
board_set_debugger_ifnset(jlink)
7+
board_set_flasher_ifnset(jlink)
8+
elseif(OPENSDA_FW STREQUAL daplink)
9+
board_set_debugger_ifnset(pyocd)
10+
board_set_flasher_ifnset(pyocd)
11+
endif()
12+
13+
board_runner_args(jlink "--device=MK82FN256xxx15")
14+
board_runner_args(pyocd "--target=k82f25615")
15+
16+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
17+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
18+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
93.6 KB
Loading

boards/arm/frdm_k82f/doc/index.rst

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
.. _frdm_k82f:
2+
3+
NXP FRDM-K82F
4+
##############
5+
6+
Overview
7+
********
8+
9+
The FRDM-K82F is a low-cost development platform for Kinetis K80, K81,
10+
and K82 MCUs.
11+
12+
- Form-factor compatible with the Arduino R3 pin layout
13+
- Peripherals enable rapid prototyping, including a six-axis digital
14+
accelerometer and magnetometer to create full eCompass capabilities, a
15+
tri-colored LED and two user push-buttons for direct interaction, 2x32 Mb
16+
QuadSPI external flash, FlexIO camera header, touchpads and headers for use
17+
with Bluetooth and 2.4 GHz radio add-on modules
18+
- OpenSDAv2.1, the NXP open source hardware embedded serial and debug adapter
19+
running an open source bootloader, offers options for serial communication,
20+
flash programming, and run-control debugging
21+
22+
.. image:: ./frdm_k82f.jpg
23+
:width: 720px
24+
:align: center
25+
:alt: FRDM-K82F
26+
27+
Hardware
28+
********
29+
30+
- MK82FN256VLL15 MCU (150 MHz, 256 KB flash memory, 256 KB RAM, low-power,
31+
crystal-less USB, and 100 Low profile Quad Flat Package (LQFP))
32+
- Dual role USB interface with micro-B USB connector
33+
- RGB LED
34+
- FXOS8700CQ accelerometer and magnetometer
35+
- Two user push buttons
36+
- 2x 32 Mb QSPI flash
37+
- Flexible power supply option - OpenSDAv2.1 USB, Kinetis K82 USB, and external source
38+
- Easy access to MCU input/output through Arduino R3 compatible I/O connectors
39+
- Programmable OpenSDAv2.1 debug circuit supporting the CMSIS-DAP Interface
40+
software that provides:
41+
42+
- Mass storage device (MSD) flash programming interface
43+
- CMSIS-DAP debug interface over a driver-less USB HID connection providing
44+
run-control debugging and compatibility with IDE tools
45+
- Virtual serial port interface
46+
- Open source CMSIS-DAP software project
47+
48+
- FlexIO header
49+
50+
For more information about the K82F SoC and FRDM-K82F board:
51+
52+
- `K82F Website`_
53+
- `K82F Datasheet`_
54+
- `K82F Reference Manual`_
55+
- `FRDM-K82F Website`_
56+
- `FRDM-K82F User Guide`_
57+
- `FRDM-K82F Schematics`_
58+
59+
Supported Features
60+
==================
61+
62+
The frdm_k82f board configuration supports the following hardware features:
63+
64+
+-----------+------------+-------------------------------------+
65+
| Interface | Controller | Driver/Component |
66+
+===========+============+=====================================+
67+
| NVIC | on-chip | nested vector interrupt controller |
68+
+-----------+------------+-------------------------------------+
69+
| SYSTICK | on-chip | systick |
70+
+-----------+------------+-------------------------------------+
71+
| PINMUX | on-chip | pinmux |
72+
+-----------+------------+-------------------------------------+
73+
| ADC | on-chip | adc |
74+
+-----------+------------+-------------------------------------+
75+
| FLASH | on-chip | soc flash |
76+
+-----------+------------+-------------------------------------+
77+
| FLASH | off-chip | QSPI flash |
78+
+-----------+------------+-------------------------------------+
79+
| GPIO | on-chip | gpio |
80+
+-----------+------------+-------------------------------------+
81+
| I2C | on-chip | i2c |
82+
+-----------+------------+-------------------------------------+
83+
| PWM | on-chip | pwm |
84+
+-----------+------------+-------------------------------------+
85+
| RTC | on-chip | rtc |
86+
+-----------+------------+-------------------------------------+
87+
| SENSOR | off-chip | fxos8700 polling; |
88+
| | | fxos8700 trigger |
89+
+-----------+------------+-------------------------------------+
90+
| SPI | on-chip | spi |
91+
+-----------+------------+-------------------------------------+
92+
| UART | on-chip | serial port-polling; |
93+
| | | serial port-interrupt |
94+
+-----------+------------+-------------------------------------+
95+
| USB | on-chip | USB device |
96+
+-----------+------------+-------------------------------------+
97+
| WATCHDOG | on-chip | watchdog |
98+
+-----------+------------+-------------------------------------+
99+
100+
The default configuration can be found in the defconfig file:
101+
102+
``boards/arm/frdm_k82f/frdm_k82f_defconfig``
103+
104+
Other hardware features are not currently supported by the port.
105+
106+
System Clock
107+
============
108+
109+
The K82F SoC is configured to use the 12 MHz external oscillator on the board
110+
with the on-chip PLL to generate a 120 MHz system clock.
111+
112+
Serial Port
113+
===========
114+
115+
The K82F SoC has five UARTs. One is configured for the console, the remaining
116+
ones are not used.
117+
118+
USB
119+
===
120+
121+
The K82F SoC has a USB OTG (USBOTG) controller that supports both
122+
device and host functions through its micro USB connector (J11).
123+
Only USB device function is supported in Zephyr at the moment.
124+
125+
Programming and Debugging
126+
*************************
127+
128+
Build and flash applications as usual (see :ref:`build_an_application` and
129+
:ref:`application_run` for more details).
130+
131+
Configuring a Debug Probe
132+
=========================
133+
134+
A debug probe is used for both flashing and debugging the board. This board is
135+
configured by default to use the :ref:`opensda-daplink-onboard-debug-probe`.
136+
137+
Early versions of this board have an outdated version of the OpenSDA bootloader
138+
and require an update. Please see the `DAPLink Bootloader Update`_ page for
139+
instructions to update from the CMSIS-DAP bootloader to the DAPLink bootloader.
140+
141+
Option 1: :ref:`opensda-daplink-onboard-debug-probe` (Recommended)
142+
------------------------------------------------------------------
143+
144+
Install the :ref:`pyocd-debug-host-tools` and make sure they are in your search
145+
path.
146+
147+
Follow the instructions in :ref:`opensda-daplink-onboard-debug-probe` to program
148+
the `OpenSDA DAPLink FRDM-K82F Firmware`_.
149+
150+
Option 2: :ref:`opensda-jlink-onboard-debug-probe`
151+
--------------------------------------------------
152+
153+
Install the :ref:`jlink-debug-host-tools` and make sure they are in your search
154+
path.
155+
156+
Follow the instructions in :ref:`opensda-jlink-onboard-debug-probe` to program
157+
the `OpenSDA J-Link Firmware for FRDM-K82F`_.
158+
159+
Add the argument ``-DOPENSDA_FW=jlink`` when you invoke ``west build`` or
160+
``cmake`` to override the default runner from pyOCD to J-Link:
161+
162+
.. zephyr-app-commands::
163+
:zephyr-app: samples/hello_world
164+
:tool: all
165+
:board: frdm_k82f
166+
:gen-args: -DOPENSDA_FW=jlink
167+
:goals: build
168+
169+
Configuring a Console
170+
=====================
171+
172+
Regardless of your choice in debug probe, we will use the OpenSDA
173+
microcontroller as a usb-to-serial adapter for the serial console.
174+
175+
Connect a USB cable from your PC to J5.
176+
177+
Use the following settings with your serial terminal of choice (minicom, putty,
178+
etc.):
179+
180+
- Speed: 115200
181+
- Data: 8 bits
182+
- Parity: None
183+
- Stop bits: 1
184+
185+
Flashing
186+
========
187+
188+
Here is an example for the :ref:`hello_world` application.
189+
190+
.. zephyr-app-commands::
191+
:zephyr-app: samples/hello_world
192+
:board: frdm_k82f
193+
:goals: flash
194+
195+
Open a serial terminal, reset the board (press the SW1 button), and you should
196+
see the following message in the terminal:
197+
198+
.. code-block:: console
199+
200+
***** Booting Zephyr OS v1.14.0-xxx-gxxxxxxxxxxxx *****
201+
Hello World! frdm_k82f
202+
203+
Debugging
204+
=========
205+
206+
Here is an example for the :ref:`hello_world` application.
207+
208+
.. zephyr-app-commands::
209+
:zephyr-app: samples/hello_world
210+
:board: frdm_k82f
211+
:goals: debug
212+
213+
Open a serial terminal, step through the application in your debugger, and you
214+
should see the following message in the terminal:
215+
216+
.. code-block:: console
217+
218+
***** Booting Zephyr OS v1.14.0-xxx-gxxxxxxxxxxxx *****
219+
Hello World! frdm_k82f
220+
221+
.. _FRDM-K82F Website:
222+
https://www.nxp.com/design/development-boards/freedom-development-boards/mcu-boards/freedom-development-platform-for-kinetis-k82-k81-and-k80-mcus:FRDM-K82F
223+
224+
.. _FRDM-K82F User Guide:
225+
https://www.nxp.com/docs/en/user-guide/FRDMK82FUG.pdf
226+
227+
.. _FRDM-K82F Schematics:
228+
https://www.nxp.com/downloads/en/schematics/FRDM-K82F-SCH.pdf
229+
230+
.. _K82F Website:
231+
https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k8x-secure/kinetis-k82-150-mhz-hw-cryptographic-co-processor-quadspi-microcontrollers-mcus-based-on-arm-cortex-m4-core:K82_150
232+
233+
.. _K82F Datasheet:
234+
https://www.nxp.com/docs/en/data-sheet/K82P121M150SF5.pdf
235+
236+
.. _K82F Reference Manual:
237+
https://www.nxp.com/docs/en/reference-manual/K82P121M150SF5RM.pdf
238+
239+
.. _DAPLink Bootloader Update:
240+
https://os.mbed.com/blog/entry/DAPLink-bootloader-update/
241+
242+
.. _OpenSDA DAPLink FRDM-K82F Firmware:
243+
https://www.nxp.com/assets/downloads/data/en/snippets-boot-code-headers-monitors/k20dx_frdmk82f_if_crc_legacy_0x8000.bin
244+
245+
.. _OpenSDA J-Link Firmware for FRDM-K82F:
246+
https://www.segger.com/downloads/jlink/OpenSDA_FRDM-K82F

0 commit comments

Comments
 (0)