Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions boards/nxp/frdm_mcxa577/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright 2025 NXP
#
# SPDX-License-Identifier: Apache-2.0
#

zephyr_library()
zephyr_library_sources(board.c)
5 changes: 5 additions & 0 deletions boards/nxp/frdm_mcxa577/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

config BOARD_FRDM_MCXA577
select BOARD_EARLY_INIT_HOOK
6 changes: 6 additions & 0 deletions boards/nxp/frdm_mcxa577/Kconfig.frdm_mcxa577
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2025 NXP
# SPDX-License-Identifier: Apache-2.0

config BOARD_FRDM_MCXA577
select SOC_MCXA577
select SOC_PART_NUMBER_MCXA577VLL
152 changes: 152 additions & 0 deletions boards/nxp/frdm_mcxa577/board.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/*
* Copyright 2025 NXP
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/init.h>
#include <zephyr/device.h>
#include <zephyr/dt-bindings/clock/mcux_lpc_syscon_clock.h>
#include <fsl_clock.h>
#include <fsl_spc.h>
#include <soc.h>

/* Core clock frequency: 12MHz in FPGA */
#define CLOCK_INIT_CORE_CLOCK 12000000U
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In index.rst 49, it says "The MCX-A577 SoC is configured to use FRO running at 180MHz as a source for the system clock.", here is 12000000, is that a mismatch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a problem, will update to 12000000. the 12000000 is for FPGA, need further update after testing with silicon.

/* System clock frequency. */
extern uint32_t SystemCoreClock;

void board_early_init_hook(void)
{
/* Get the CPU Core frequency */
CLOCK_SetupFRO12MClocking();
CLOCK_AttachClk(kFRO12M_to_MAIN_CLK);
CLOCK_SetClockDiv(kCLOCK_DivFRO_HF, 1);
CLOCK_SetClockDiv(kCLOCK_DivFRO_LF, 1);

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porta))
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GatePORT0);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portb))
RESET_ReleasePeripheralReset(kPORT1_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GatePORT1);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portc))
RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GatePORT2);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portd))
RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GatePORT3);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porte))
RESET_ReleasePeripheralReset(kPORT4_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GatePORT4);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portf))
CLOCK_EnableClock(kCLOCK_GatePORT5);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
RESET_ReleasePeripheralReset(kGPIO0_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO0);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio1))
RESET_ReleasePeripheralReset(kGPIO1_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO1);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio2))
RESET_ReleasePeripheralReset(kGPIO2_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO2);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio3))
RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO3);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio4))
RESET_ReleasePeripheralReset(kGPIO4_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO4);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio5))
RESET_ReleasePeripheralReset(kGPIO5_RST_SHIFT_RSTn);
CLOCK_EnableClock(kCLOCK_GateGPIO5);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart0))
CLOCK_SetClockDiv(kCLOCK_DivLPUART0, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART0);
RESET_ReleasePeripheralReset(kLPUART0_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart1))
CLOCK_SetClockDiv(kCLOCK_DivLPUART1, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART1);
RESET_ReleasePeripheralReset(kLPUART1_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart2))
CLOCK_SetClockDiv(kCLOCK_DivLPUART2, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART2);
RESET_ReleasePeripheralReset(kLPUART2_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart3))
CLOCK_SetClockDiv(kCLOCK_DivLPUART3, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART3);
RESET_ReleasePeripheralReset(kLPUART3_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart4))
CLOCK_SetClockDiv(kCLOCK_DivLPUART4, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART4);
RESET_ReleasePeripheralReset(kLPUART4_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart5))
CLOCK_SetClockDiv(kCLOCK_DivLPUART5, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPUART5);
RESET_ReleasePeripheralReset(kLPUART5_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c0))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C0, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C0);
RESET_ReleasePeripheralReset(kLPI2C0_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c1))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C1, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C1);
RESET_ReleasePeripheralReset(kLPI2C1_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c2))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C2, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C2);
RESET_ReleasePeripheralReset(kLPI2C2_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c3))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C3, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C3);
RESET_ReleasePeripheralReset(kLPI2C3_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpi2c4))
CLOCK_SetClockDiv(kCLOCK_DivLPI2C4, 1u);
CLOCK_AttachClk(kFRO_LF_DIV_to_LPI2C4);
RESET_ReleasePeripheralReset(kLPI2C4_RST_SHIFT_RSTn);
#endif

/* Set SystemCoreClock variable. */
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
}
13 changes: 13 additions & 0 deletions boards/nxp/frdm_mcxa577/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright 2025 NXP
#
# SPDX-License-Identifier: Apache-2.0
#

board_runner_args(jlink "--device=MCXA577")
board_runner_args(linkserver "--device=MCXA577:FRDM-MCXA577")
board_runner_args(pyocd "--target=MCXA577")

include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
6 changes: 6 additions & 0 deletions boards/nxp/frdm_mcxa577/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: frdm_mcxa577
full_name: FRDM-MCXA577
vendor: nxp
socs:
- name: mcxa577
Binary file added boards/nxp/frdm_mcxa577/doc/frdm_mcxa577.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
160 changes: 160 additions & 0 deletions boards/nxp/frdm_mcxa577/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
.. zephyr:board:: frdm_mcxa577

Overview
********

FRDM-MCXA577 is a compact and scalable development board for rapid prototyping of MCX A577
MCUs. They offer industry standard headers for easy access to the MCUs input/output (I/O),
integrated open-standard serial interfaces, external flash memory and an onboard MCU-Link
debugger.

Hardware
********

- MCX-A577 Arm Cortex-M33 microcontroller running at 12MHz
- 2048KB dual-bank on chip Flash
- 640 KB RAM
- 2x FlexCAN with FD, 1x RGB LED, 3x SW buttons
- On-board MCU-Link debugger with CMSIS-DAP
- Arduino Header, SmartDMA/Camera Header, mikroBUS

For more information about the MCX-A577 SoC and FRDM-MCXA577 board, see:

- `MCX-A577 SoC Website`_
- `FRDM-MCXA577 Website`_
- `FRDM-MCXA577 User Guide`_

Supported Features
==================

.. zephyr:board-supported-hw::

Connections and IOs
===================

The MCX-A577 SoC has 5 gpio controllers and has pinmux registers which
can be used to configure the functionality of a pin.

+------------+-----------------+----------------------------+
| Name | Function | Usage |
+============+=================+============================+
| PIO0_2 | UART | UART RX |
+------------+-----------------+----------------------------+
| PIO0_3 | UART | UART TX |
+------------+-----------------+----------------------------+

System Clock
============

The MCX-A577 SoC is configured to use FRO LF running at 12MHz as a source for
the system clock.

Serial Port
===========

The FRDM-MCXA577 SoC has 6 LPUART interfaces for serial communication.
LPUART0 is configured as UART for the console.

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

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 MCU-Link CMSIS-DAP Onboard Debug Probe.

Using LinkServer
----------------

Linkserver is the default runner for this board, and supports the factory
default MCU-Link firmware. Follow the instructions in
:ref:`mcu-link-cmsis-onboard-debug-probe` to reprogram the default MCU-Link
firmware. This only needs to be done if the default onboard debug circuit
firmware was changed. To put the board in ``ISP mode`` to program the firmware,
short jumper JP4.

Using J-Link
------------

There are two options. The onboard debug circuit can be updated with Segger
J-Link firmware by following the instructions in
:ref:`mcu-link-jlink-onboard-debug-probe`.
To be able to program the firmware, you need to put the board in ``ISP mode``
by shortening the jumper JP4.
The second option is to attach a :ref:`jlink-external-debug-probe` to the
10-pin SWD connector (J11) of the board. Additionally, the jumper JP6 must
be shorted.
For both options use the ``-r jlink`` option with west to use the jlink runner.

.. code-block:: console

west flash -r jlink

Configuring a Console
=====================

Connect a USB cable from your PC to J13, and use the serial terminal of your choice
(minicom, putty, etc.) with the following settings:

- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1

Flashing
========

Here is an example for the :zephyr:code-sample:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: frdm_mcxa577
:goals: flash

Open a serial terminal, reset the board (press the RESET button), and you should
see the following message in the terminal:

.. code-block:: console

*** Booting Zephyr OS build v3.6.0-4478-ge6c3a42f5f52 ***
Hello World! frdm_mcxa577/mcxa577

Debugging
=========

Here is an example for the :zephyr:code-sample:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: frdm_mcxa577/mcxa577
: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 build v3.6.0-4478-ge6c3a42f5f52 ***
Hello World! frdm_mcxa577/mcxa577

Troubleshooting
===============

.. include:: ../../common/segger-ecc-systemview.rst.inc

.. include:: ../../common/board-footer.rst.inc

.. _MCX-A577 SoC Website:
https://www.nxp.com/products/MCX-A57X

.. _FRDM-MCXA577 Website:
https://www.nxp.com/design/design-center/development-boards-and-designs/FRDM-MCXA577

.. _FRDM-MCXA577 User Guide:
https://www.nxp.com/document/guide/getting-started-with-frdm-mcxa577:GS-FRDM-MCXA577
18 changes: 18 additions & 0 deletions boards/nxp/frdm_mcxa577/frdm_mcxa577-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright 2025 NXP
* SPDX-License-Identifier: Apache-2.0
*/

#include <nxp/mcx/MCXA577VPN-pinctrl.h>

&pinctrl {
pinmux_lpuart0: pinmux_lpuart0 {
group0 {
pinmux = <LPUART0_RXD_P0_2>,
<LPUART0_TXD_P0_3>;
drive-strength = "low";
slew-rate = "fast";
input-enable;
};
};
};
Loading