Skip to content

Commit d2d0e85

Browse files
NeilChen93kartben
authored andcommitted
boards: frdm_mcxa153: add frdm_mcxa153 board
add frdm_mcxa153 board support. Test with samples/hello_world, samples/basic/blinky. Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
1 parent 720f726 commit d2d0e85

File tree

12 files changed

+475
-0
lines changed

12 files changed

+475
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#
2+
# Copyright 2025 NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
zephyr_library()
8+
zephyr_library_sources(board.c)

boards/nxp/frdm_mcxa153/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_FRDM_MCXA153
5+
select BOARD_EARLY_INIT_HOOK
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_FRDM_MCXA153
5+
select SOC_MCXA153 if BOARD_FRDM_MCXA153
6+
select SOC_PART_NUMBER_MCXA153VLH

boards/nxp/frdm_mcxa153/board.c

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
/*
2+
* Copyright 2025 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
#include <zephyr/init.h>
6+
#include <zephyr/device.h>
7+
#include <zephyr/dt-bindings/clock/mcux_lpc_syscon_clock.h>
8+
#include <fsl_clock.h>
9+
#include <fsl_spc.h>
10+
#include <soc.h>
11+
12+
/* Core clock frequency: 96MHz */
13+
#define CLOCK_INIT_CORE_CLOCK 960000000U
14+
#define BOARD_BOOTCLOCKFRO96M_CORE_CLOCK 960000000U
15+
/* System clock frequency. */
16+
extern uint32_t SystemCoreClock;
17+
18+
void board_early_init_hook(void)
19+
{
20+
uint32_t coreFreq;
21+
spc_active_mode_core_ldo_option_t ldoOption;
22+
spc_sram_voltage_config_t sramOption;
23+
24+
/* Get the CPU Core frequency */
25+
coreFreq = CLOCK_GetCoreSysClkFreq();
26+
27+
/* The flow of increasing voltage and frequency */
28+
if (coreFreq <= BOARD_BOOTCLOCKFRO96M_CORE_CLOCK) {
29+
/* Set the LDO_CORE VDD regulator level */
30+
ldoOption.CoreLDOVoltage = kSPC_CoreLDO_NormalVoltage;
31+
ldoOption.CoreLDODriveStrength = kSPC_CoreLDO_NormalDriveStrength;
32+
(void)SPC_SetActiveModeCoreLDORegulatorConfig(SPC0, &ldoOption);
33+
/* Configure Flash to support different voltage level and frequency */
34+
FMU0->FCTRL =
35+
(FMU0->FCTRL & ~((uint32_t)FMU_FCTRL_RWSC_MASK)) | (FMU_FCTRL_RWSC(0x2U));
36+
/* Specifies the operating voltage for the SRAM's read/write timing margin */
37+
sramOption.operateVoltage = kSPC_sramOperateAt1P1V;
38+
sramOption.requestVoltageUpdate = true;
39+
(void)SPC_SetSRAMOperateVoltage(SPC0, &sramOption);
40+
}
41+
42+
CLOCK_SetupFROHFClocking(CLOCK_INIT_CORE_CLOCK); /*!< Enable FRO HF(96MHz) output */
43+
44+
CLOCK_SetupFRO12MClocking(); /*!< Setup FRO12M clock */
45+
46+
CLOCK_AttachClk(kFRO_HF_to_MAIN_CLK); /* !< Switch MAIN_CLK to FRO_HF */
47+
48+
/* The flow of decreasing voltage and frequency */
49+
if (coreFreq > BOARD_BOOTCLOCKFRO96M_CORE_CLOCK) {
50+
/* Configure Flash to support different voltage level and frequency */
51+
FMU0->FCTRL =
52+
(FMU0->FCTRL & ~((uint32_t)FMU_FCTRL_RWSC_MASK)) | (FMU_FCTRL_RWSC(0x2U));
53+
/* Specifies the operating voltage for the SRAM's read/write timing margin */
54+
sramOption.operateVoltage = kSPC_sramOperateAt1P1V;
55+
sramOption.requestVoltageUpdate = true;
56+
(void)SPC_SetSRAMOperateVoltage(SPC0, &sramOption);
57+
/* Set the LDO_CORE VDD regulator level */
58+
ldoOption.CoreLDOVoltage = kSPC_CoreLDO_NormalVoltage;
59+
ldoOption.CoreLDODriveStrength = kSPC_CoreLDO_NormalDriveStrength;
60+
(void)SPC_SetActiveModeCoreLDORegulatorConfig(SPC0, &ldoOption);
61+
}
62+
63+
/*!< Set up clock selectors - Attach clocks to the peripheries */
64+
65+
/*!< Set up dividers */
66+
CLOCK_SetClockDiv(kCLOCK_DivAHBCLK, 1U); /* !< Set AHBCLKDIV divider to value 1 */
67+
CLOCK_SetClockDiv(kCLOCK_DivFRO_HF_DIV, 1U); /* !< Set FROHFDIV divider to value 1 */
68+
69+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
70+
RESET_ReleasePeripheralReset(kGPIO0_RST_SHIFT_RSTn);
71+
CLOCK_EnableClock(kCLOCK_GateGPIO0);
72+
#endif
73+
74+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio1))
75+
RESET_ReleasePeripheralReset(kGPIO1_RST_SHIFT_RSTn);
76+
CLOCK_EnableClock(kCLOCK_GateGPIO1);
77+
#endif
78+
79+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio2))
80+
RESET_ReleasePeripheralReset(kGPIO2_RST_SHIFT_RSTn);
81+
CLOCK_EnableClock(kCLOCK_GateGPIO2);
82+
#endif
83+
84+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio3))
85+
RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn);
86+
CLOCK_EnableClock(kCLOCK_GateGPIO3);
87+
#endif
88+
89+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart0))
90+
CLOCK_SetClockDiv(kCLOCK_DivLPUART0, 1u);
91+
CLOCK_AttachClk(kFRO12M_to_LPUART0);
92+
#endif
93+
94+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart1))
95+
CLOCK_SetClockDiv(kCLOCK_DivLPUART1, 1u);
96+
CLOCK_AttachClk(kFRO12M_to_LPUART1);
97+
#endif
98+
99+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porta))
100+
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
101+
#endif
102+
103+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portb))
104+
RESET_ReleasePeripheralReset(kPORT1_RST_SHIFT_RSTn);
105+
#endif
106+
107+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portc))
108+
RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn);
109+
#endif
110+
111+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(portd))
112+
RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn);
113+
#endif
114+
115+
/* Set SystemCoreClock variable. */
116+
SystemCoreClock = CLOCK_INIT_CORE_CLOCK;
117+
}

boards/nxp/frdm_mcxa153/board.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright 2025 NXP
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
board_runner_args(jlink "--device=MCXA153")
8+
board_runner_args(linkserver "--device=MCXA153:FRDM-MCXA153")
9+
board_runner_args(pyocd "--target=mcxA153")
10+
11+
include(${ZEPHYR_BASE}/boards/common/linkserver.board.cmake)
12+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
13+
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)

boards/nxp/frdm_mcxa153/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: frdm_mcxa153
3+
full_name: FRDM-MCXA153
4+
vendor: nxp
5+
socs:
6+
- name: mcxa153
76.2 KB
Binary file not shown.

boards/nxp/frdm_mcxa153/doc/index.rst

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
.. zephyr:board:: frdm_mcxa153
2+
3+
Overview
4+
********
5+
6+
FRDM-MCXA153 are compact and scalable development boards for rapid prototyping of
7+
MCX A14x and A15x MCUs. They offer industry standard headers for easy access
8+
to the MCU's I/Os, integrated open-standard serial interfaces, external flash
9+
memory and an on-board MCU-Link debugger. Additional tools like NXP's Expansion
10+
Board Hub for add-on boards and the Application Code Hub for software examples
11+
are available through the MCUXpresso Developer Experience.
12+
13+
Hardware
14+
********
15+
16+
- MCX-A153 Arm Cortex-M33 microcontroller running at 96 MHz
17+
- 128KB dual-bank on chip Flash
18+
- 32 KB RAM
19+
- USB full-speed with on-chip FS PHY. USB Type-C connectors
20+
- 1x I3C
21+
- On-board MCU-Link debugger with CMSIS-DAP
22+
- Arduino Header, mikroBUS
23+
24+
For more information about the MCX-A153 SoC and FRDM-MCXA153 board, see:
25+
26+
- `MCX-A153 SoC Website`_
27+
- `MCX-A153 Datasheet`_
28+
- `MCX-A153 Reference Manual`_
29+
- `FRDM-MCXA153 Website`_
30+
- `FRDM-MCXA153 User Guide`_
31+
- `FRDM-MCXA153 Board User Manual`_
32+
- `FRDM-MCXA153 Schematics`_
33+
34+
Supported Features
35+
==================
36+
37+
.. zephyr:board-supported-hw::
38+
39+
Connections and IOs
40+
===================
41+
42+
The MCX-A153 SoC has 4 gpio controllers and has pinmux registers which
43+
can be used to configure the functionality of a pin.
44+
45+
+------------+-----------------+----------------------------+
46+
| Name | Function | Usage |
47+
+============+=================+============================+
48+
| PIO0_2 | UART | UART RX |
49+
+------------+-----------------+----------------------------+
50+
| PIO0_3 | UART | UART TX |
51+
+------------+-----------------+----------------------------+
52+
53+
System Clock
54+
============
55+
56+
The MCX-A153 SoC is configured to use FRO running at 96MHz as a source for
57+
the system clock.
58+
59+
Serial Port
60+
===========
61+
62+
The FRDM-MCXA153 SoC has 3 LPUART interfaces for serial communication.
63+
LPUART 0 is configured as UART for the console.
64+
65+
Programming and Debugging
66+
*************************
67+
68+
.. zephyr:board-supported-runners::
69+
70+
Build and flash applications as usual (see :ref:`build_an_application` and
71+
:ref:`application_run` for more details).
72+
73+
Configuring a Debug Probe
74+
=========================
75+
76+
A debug probe is used for both flashing and debugging the board. This board is
77+
configured by default to use the MCU-Link CMSIS-DAP Onboard Debug Probe.
78+
79+
Using LinkServer
80+
----------------
81+
82+
Linkserver is the default runner for this board, and supports the factory
83+
default MCU-Link firmware. Follow the instructions in
84+
:ref:`mcu-link-cmsis-onboard-debug-probe` to reprogram the default MCU-Link
85+
firmware. This only needs to be done if the default onboard debug circuit
86+
firmware was changed. To put the board in ``ISP mode`` to program the firmware,
87+
short jumper JP8.
88+
89+
Using J-Link
90+
------------
91+
92+
There are two options. The onboard debug circuit can be updated with Segger
93+
J-Link firmware by following the instructions in
94+
:ref:`mcu-link-jlink-onboard-debug-probe`.
95+
To be able to program the firmware, you need to put the board in ``ISP mode``
96+
by shorting the jumper JP8.
97+
The second option is to attach a :ref:`jlink-external-debug-probe` to the
98+
10-pin SWD connector (J18) of the board. Additionally, the jumper JP20 must
99+
be shorted.
100+
For both options use the ``-r jlink`` option with west to use the jlink runner.
101+
102+
.. code-block:: console
103+
104+
west flash -r jlink
105+
106+
Configuring a Console
107+
=====================
108+
109+
Connect a USB cable from your PC to J15, and use the serial terminal of your choice
110+
(minicom, putty, etc.) with the following settings:
111+
112+
- Speed: 115200
113+
- Data: 8 bits
114+
- Parity: None
115+
- Stop bits: 1
116+
117+
Flashing
118+
========
119+
120+
Here is an example for the :zephyr:code-sample:`hello_world` application.
121+
122+
.. zephyr-app-commands::
123+
:zephyr-app: samples/hello_world
124+
:board: frdm_mcxa153
125+
:goals: flash
126+
127+
Open a serial terminal, reset the board (press the RESET button), and you should
128+
see the following message in the terminal:
129+
130+
.. code-block:: console
131+
132+
*** Booting Zephyr OS build v3.6.0-4478-ge6c3a42f5f52 ***
133+
Hello World! frdm_mcxa3/mcxa153
134+
135+
Debugging
136+
=========
137+
138+
Here is an example for the :zephyr:code-sample:`hello_world` application.
139+
140+
.. zephyr-app-commands::
141+
:zephyr-app: samples/hello_world
142+
:board: frdm_mcxa153/mcxa153
143+
:goals: debug
144+
145+
Open a serial terminal, step through the application in your debugger, and you
146+
should see the following message in the terminal:
147+
148+
.. code-block:: console
149+
150+
*** Booting Zephyr OS build v3.6.0-4478-ge6c3a42f5f52 ***
151+
Hello World! frdm_mcxa153/mcxa153
152+
153+
Troubleshooting
154+
===============
155+
156+
.. include:: ../../common/segger-ecc-systemview.rst
157+
:start-after: segger-ecc-systemview
158+
159+
.. include:: ../../common/board-footer.rst
160+
:start-after: nxp-board-footer
161+
162+
.. _MCX-A153 SoC Website:
163+
https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/mcx-arm-cortex-m/mcx-a-series-microcontrollers/mcx-a13x-14x-15x-mcus-with-arm-cortex-m33-scalable-device-options-low-power-and-intelligent-peripherals:MCX-A13X-A14X-A15X
164+
165+
.. _MCX-A153 Datasheet:
166+
https://www.nxp.com/docs/en/data-sheet/MCXAP64M96FS3.pdf
167+
168+
.. _MCX-A153 Reference Manual:
169+
https://www.nxp.com/webapp/Download?colCode=MCXAP64M96FS3RM
170+
171+
.. _FRDM-MCXA153 Website:
172+
https://www.nxp.com/design/design-center/development-boards-and-designs/FRDM-MCXA153
173+
174+
.. _FRDM-MCXA153 User Guide:
175+
https://www.nxp.com/document/guide/getting-started-with-frdm-mcxa153:GS-FRDM-MCXAXX
176+
177+
.. _FRDM-MCXA153 Board User Manual:
178+
https://www.nxp.com/docs/en/user-manual/UM12012.pdf
179+
180+
.. _FRDM-MCXA153 Schematics:
181+
https://www.nxp.com/webapp/Download?colCode=SPF-90829_A1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2025 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
7+
#include <nxp/mcx/MCXA153VLH-pinctrl.h>
8+
9+
&pinctrl {
10+
pinmux_lpuart0: pinmux_lpuart0 {
11+
group0 {
12+
pinmux = <LPUART0_RXD_P0_2>,
13+
<LPUART0_TXD_P0_3>;
14+
drive-strength = "low";
15+
slew-rate = "fast";
16+
input-enable;
17+
};
18+
};
19+
};

0 commit comments

Comments
 (0)