Skip to content

Commit b32a86a

Browse files
mmahadevan108nashif
authored andcommitted
boards: frdm_mcxn947: Add a variant for executing from QSPI
1. The boards always boots from internal flash. However it does have an external QSPI that can be used to store Zephyr. Add a variant to support running Zephyr from QSPI Flash. Running Zephyr from QSPI requires a bootloader like MCUboot to be pogrammed to internal flash. 2. Create a common dts file to add features that are enabled for CPU 0 that is included by both vairants i.e internal flash (default) and QSPI variant. Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent bdfd1d2 commit b32a86a

8 files changed

+313
-172
lines changed

boards/nxp/frdm_mcxn947/Kconfig.frdm_mcxn947

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
config BOARD_FRDM_MCXN947
5-
select SOC_MCXN947_CPU0 if BOARD_FRDM_MCXN947_MCXN947_CPU0
5+
select SOC_MCXN947_CPU0 if BOARD_FRDM_MCXN947_MCXN947_CPU0 || BOARD_FRDM_MCXN947_MCXN947_CPU0_QSPI
66
select SOC_MCXN947_CPU1 if BOARD_FRDM_MCXN947_MCXN947_CPU1
77
select SOC_PART_NUMBER_MCXN947VDF

boards/nxp/frdm_mcxn947/board.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ board:
33
vendor: nxp
44
socs:
55
- name: mcxn947
6+
variants:
7+
- name: qspi
8+
cpucluster: 'cpu0'

boards/nxp/frdm_mcxn947/doc/index.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,42 @@ see the following message in the terminal:
205205
*** Booting Zephyr OS build v3.6.0-479-g91faa20c6741 ***
206206
Hello World! frdm_mcxn947/mcxn947/cpu0
207207
208+
Flashing to QSPI
209+
================
210+
211+
Here is an example for the :ref:`hello_world` application.
212+
213+
.. zephyr-app-commands::
214+
:zephyr-app: zephyr/samples/hello_world -DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE=\"bootloader/mcuboot/root-rsa-2048.pem\" -DCONFIG_BOOTLOADER_MCUBOOT=y
215+
:board: frdm_mcxn947/mcxn947/cpu0/qspi
216+
:goals: flash
217+
218+
219+
In order to load Zephyr application from QSPI you should program a bootloader like
220+
MCUboot bootloader to internal flash. Here are the steps.
221+
222+
.. zephyr-app-commands::
223+
:zephyr-app: bootloader/mcuboot/boot/zephyr
224+
:board: frdm_mcxn947/mcxn947/cpu0/qspi
225+
:goals: flash
226+
227+
Open a serial terminal, reset the board (press the RESET button), and you should
228+
see the following message in the terminal:
229+
230+
.. code-block:: console
231+
232+
*** Booting MCUboot v2.1.0-rc1-2-g9f034729d99a ***
233+
*** Using Zephyr OS build v3.6.0-4046-gf279a03af8ab ***
234+
I: Starting bootloader
235+
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
236+
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
237+
I: Boot source: none
238+
I: Image index: 0, Swap type: none
239+
I: Bootloader chainload address offset: 0x0
240+
I: Jumping to the first image slot
241+
*** Booting Zephyr OS build v3.6.0-4046-gf279a03af8ab ***
242+
Hello World! frdm_mcxn947/mcxn947/cpu0/qspi
243+
208244
Debugging
209245
=========
210246

boards/nxp/frdm_mcxn947/frdm_mcxn947_mcxn947_cpu0.dts

Lines changed: 1 addition & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -6,179 +6,9 @@
66

77
/dts-v1/;
88

9-
#include <nxp/nxp_mcxn94x.dtsi>
10-
#include "frdm_mcxn947.dtsi"
9+
#include "frdm_mcxn947_mcxn947_cpu0.dtsi"
1110

1211
/ {
1312
model = "NXP FRDM_N94 board";
1413
compatible = "nxp,mcxn947", "nxp,mcx";
15-
16-
cpus {
17-
/delete-node/ cpu@1;
18-
};
19-
20-
chosen {
21-
zephyr,sram = &sram0;
22-
zephyr,flash = &flash;
23-
zephyr,flash-controller = &fmu;
24-
zephyr,code-partition = &slot0_partition;
25-
zephyr,console = &flexcomm4_lpuart4;
26-
zephyr,shell-uart = &flexcomm4_lpuart4;
27-
zephyr,canbus = &flexcan0;
28-
};
29-
30-
aliases{
31-
watchdog0 = &wwdt0;
32-
pwm-0 = &flexpwm1_pwm0;
33-
};
34-
};
35-
36-
/*
37-
* Default for this board is to allocate SRAM0-5 to cpu0 but the
38-
* application can have an application specific device tree to
39-
* allocate the SRAM0-7 differently.
40-
*
41-
* For example, SRAM0-6 could be allocated to cpu0 with only SRAM7
42-
* for cpu1. This would require the value of sram0 to have a DT_SIZE_K
43-
* of 384. You would have to make updates to cpu1 sram settings as well.
44-
*/
45-
&sram0 {
46-
compatible = "mmio-sram";
47-
reg = <0x20000000 DT_SIZE_K(320)>;
48-
};
49-
50-
&gpio4 {
51-
status = "okay";
52-
};
53-
54-
&gpio1 {
55-
status = "okay";
56-
};
57-
58-
&gpio0 {
59-
status = "okay";
60-
};
61-
62-
&gpio2 {
63-
status = "okay";
64-
};
65-
66-
&green_led {
67-
status = "okay";
68-
};
69-
70-
&red_led {
71-
status = "okay";
72-
};
73-
74-
&user_button_2 {
75-
status = "okay";
76-
};
77-
78-
&edma0 {
79-
status = "okay";
80-
};
81-
82-
&flexcomm1 {
83-
status = "okay";
84-
};
85-
86-
&flexcomm1_lpspi1 {
87-
status = "okay";
88-
};
89-
90-
&flexcomm2 {
91-
status = "okay";
92-
};
93-
94-
&flexcomm2_lpi2c2 {
95-
status = "okay";
96-
};
97-
98-
/*
99-
*LPFLEXCOMM supports UART and I2C on the same instance, enable this for
100-
* LFLEXCOMM2
101-
*/
102-
&flexcomm2_lpuart2 {
103-
status = "okay";
104-
};
105-
106-
&flexcomm4 {
107-
status = "okay";
108-
};
109-
110-
&flexcomm4_lpuart4 {
111-
status = "okay";
112-
};
113-
114-
&flexspi {
115-
status = "okay";
116-
};
117-
118-
&w25q64jvssiq {
119-
status = "okay";
120-
};
121-
122-
&dac0 {
123-
status = "okay";
124-
};
125-
126-
&enet {
127-
status = "okay";
128-
};
129-
130-
&enet_mac {
131-
status = "okay";
132-
};
133-
134-
&enet_mdio {
135-
status = "okay";
136-
};
137-
138-
&wwdt0 {
139-
status = "okay";
140-
};
141-
142-
&flexpwm1_pwm0 {
143-
status = "okay";
144-
};
145-
146-
&flexcan0 {
147-
status = "okay";
148-
};
149-
150-
&ctimer0 {
151-
status = "okay";
152-
};
153-
154-
&usdhc0 {
155-
status = "okay";
156-
sdmmc {
157-
compatible = "zephyr,sdmmc-disk";
158-
status = "okay";
159-
};
160-
};
161-
162-
&vref {
163-
status = "okay";
164-
};
165-
166-
&lpadc0 {
167-
status = "okay";
168-
};
169-
170-
zephyr_udc0: &usb1 {
171-
status = "okay";
172-
};
173-
174-
&lpcmp0 {
175-
status = "okay";
176-
};
177-
178-
&lptmr0 {
179-
status = "okay";
180-
};
181-
182-
&flexio0 {
183-
status = "okay";
18414
};

0 commit comments

Comments
 (0)