@@ -115,88 +115,139 @@ Programming and Debugging (A55)
115115
116116.. zephyr :board-supported-runners ::
117117
118- Use this configuration to run basic Zephyr applications and kernel tests,
119- for example, with the :zephyr:code-sample: `synchronization ` sample:
118+ There are multiple methods to program and run Zephyr on the A55 core:
119+
120+ Option 1. Boot Zephyr by Using SPSDK Runner
121+ ===========================================
122+
123+ SPSDK runner leverages SPSDK tools (https://spsdk.readthedocs.io), it builds an
124+ bootable flash image ``flash.bin `` which includes all necessary firmware components,
125+ such as ELE+V2X firmware, System Manager, TCM OEI, TF-A images etc. Using west flash
126+ command will download the boot image flash.bin to DDR memory, SD card or eMMC flash.
127+ By using flash.bin, as no U-Boot image is available, so TF-A will boot up Zephyr on
128+ the first Cortex-A55 Core directly.
129+
130+ In order to use SPSDK runner, it requires fetching binary blobs, which can be achieved
131+ by running the following command:
132+
133+ .. code-block :: console
120134
121- 1. Build and run the Non-SMP application
135+ west blobs fetch hal_nxp
136+
137+ .. note ::
138+
139+ It is recommended running the command above after :file: `west update `.
140+
141+ SPSDK runner is enabled by configure item :kconfig:option: `CONFIG_BOARD_NXP_SPSDK_IMAGE `, currently
142+ it is not enabled by default for i.MX95 EVK board, so use this configuration to enable
143+ it, for example, with the :zephyr:code-sample: `synchronization ` sample:
122144
123145.. zephyr-app-commands ::
124146 :zephyr-app: samples/synchronization
125147 :host-os: unix
126148 :board: imx95_evk/mimx9596/a55
127149 :goals: build
150+ :gen-args: -DCONFIG_BOARD_NXP_SPSDK_IMAGE=y
128151
129- This will build an image (zephyr.bin) with the synchronization sample app.
152+ If :kconfig:option: `CONFIG_BOARD_NXP_SPSDK_IMAGE ` is available and enabled for the board variant,
153+ ``flash.bin `` will be built automatically. The programming could be through below commands.
154+ Before that, switch SW7[1:4] should be configured to 0b1001 for usb download mode
155+ to boot, and USB1 and DBG ports should be connected to PC. There are 4 serial ports
156+ enumerated (115200 8n1), and we use the first for M7 and the fourth for M33 System Manager.
157+ (The flasher is spsdk which already installed via scripts/requirements.txt.
158+ On linux host, usb device permission should be configured per Installation Guide
159+ of https://spsdk.readthedocs.io)
130160
131- Copy the compiled ``zephyr.bin `` to the first FAT partition of the SD card and
132- plug the SD card into the board. Power it up and stop the u-boot execution at
133- prompt.
161+ .. code-block :: none
134162
135- Use U-Boot to load and kick zephyr.bin to Cortex-A55 Core1:
163+ # load and run without programming. for next flashing, execute 'reset' in the
164+ # fourth serail port
165+ $ west flash
136166
137- .. code-block :: console
167+ # program to SD card, then set SW7[1:4]=0b1011 to reboot
168+ $ west flash --bootdevice sd
138169
139- fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; cpu 1 release 0xd0000000
170+ # program to emmc card, then set SW7[1:4]=0b1010 to reboot
171+ $ west flash --bootdevice=emmc
140172
141173
142- Or use the following command to kick zephyr.bin to Cortex-A55 Core0:
174+ Option 2. Boot Zephyr by Using U-Boot Command
175+ =============================================
143176
144- .. code-block :: console
177+ U-Boot "go" command can be used to start Zephyr on A55 core0 and U-Boot "cpu" command
178+ is used to load and kick Zephyr to the other A55 secondary Cores. Currently "cpu" command
179+ is supported in : `Real-Time Edge U-Boot `_ (use the branch "uboot_vxxxx.xx-y.y.y,
180+ xxxx.xx is uboot version and y.y.y is Real-Time Edge Software version, for example
181+ "uboot_v2023.04-2.9.0" branch is U-Boot v2023.04 used in Real-Time Edge Software release
182+ v2.9.0), and pre-build images and user guide can be found at `Real-Time Edge Software `_.
145183
146- fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; go 0xd0000000
184+ .. _Real-Time Edge U-Boot :
185+ https://github.com/nxp-real-time-edge-sw/real-time-edge-uboot
186+ .. _Real-Time Edge Software :
187+ https://www.nxp.com/rtedge
147188
189+ Step 1: Download Zephyr Image into DDR Memory
190+ ---------------------------------------------
148191
149- It will display the following console output :
192+ Firstly need to download Zephyr binary image into DDR memory, it can use tftp :
150193
151194.. code-block :: console
152195
153- *** Booting Zephyr OS build v3.6.0-4569-g483c01ca11a7 ***
154- thread_a: Hello World from cpu 0 on imx95_evk!
155- thread_b: Hello World from cpu 0 on imx95_evk!
156- thread_a: Hello World from cpu 0 on imx95_evk!
157- thread_b: Hello World from cpu 0 on imx95_evk!
158- thread_a: Hello World from cpu 0 on imx95_evk!
196+ tftp 0xd0000000 zephyr.bin
197+
198+ Or copy the Zephyr image `` zephyr.bin `` SD card and plug the card into the board, for example
199+ if copy to the FAT partition of the SD card, use the following U-Boot command to load the image
200+ into DDR memory (assuming the SD card is dev 1, fat partition ID is 1, they could be changed
201+ based on actual setup):
159202
160- 2. Build and run the SMP application
203+ .. code-block :: console
204+
205+ fatload mmc 1:1 0xd0000000 zephyr.bin;
206+
207+ Step 2: Boot Zephyr
208+ -------------------
209+
210+ Use this configuration to run basic Zephyr applications and kernel tests,
211+ for example, with the :zephyr:code-sample: `synchronization ` sample:
161212
162213.. zephyr-app-commands ::
163214 :zephyr-app: samples/synchronization
164215 :host-os: unix
165- :board: imx95_evk/mimx9596/a55/smp
216+ :board: imx95_evk/mimx9596/a55
166217 :goals: build
167218
168219This will build an image (zephyr.bin) with the synchronization sample app.
169220
170- Copy the compiled ``zephyr.bin `` to the first FAT partition of the SD card and
171- plug the SD card into the board. Power it up and stop the u-boot execution at
172- prompt.
173-
174- Use the following command to kick zephyr.bin to Cortex-A55 Core0:
221+ Then use the following command to boot Zephyr on the core0:
175222
176223.. code-block :: console
177224
178- fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush ; icache flush; go 0xd0000000
225+ dcache off ; icache flush; go 0xd0000000;
179226
227+ Or use "cpu" command to boot from secondary Core, for example Core1:
228+
229+ .. code-block :: console
230+
231+ dcache flush; icache flush; cpu 1 release 0xd0000000
180232
181233 It will display the following console output:
234+
182235.. code-block :: console
183236
184- *** Booting Zephyr OS build v3.7.0-rc3-15-g2f0beaea144a ***
185- Secondary CPU core 1 (MPID:0x100) is up
186- Secondary CPU core 2 (MPID:0x200) is up
187- Secondary CPU core 3 (MPID:0x300) is up
188- Secondary CPU core 4 (MPID:0x400) is up
189- Secondary CPU core 5 (MPID:0x500) is up
190- thread_a: Hello World from cpu 0 on imx95_evk!
191- thread_b: Hello World from cpu 4 on imx95_evk!
192- thread_a: Hello World from cpu 0 on imx95_evk!
193- thread_b: Hello World from cpu 3 on imx95_evk!
237+ *** Booting Zephyr OS build v3.6.0-4569-g483c01ca11a7 ***
194238 thread_a: Hello World from cpu 0 on imx95_evk!
195- thread_b: Hello World from cpu 1 on imx95_evk!
239+ thread_b: Hello World from cpu 0 on imx95_evk!
196240 thread_a: Hello World from cpu 0 on imx95_evk!
197- thread_b: Hello World from cpu 5 on imx95_evk!
241+ thread_b: Hello World from cpu 0 on imx95_evk!
198242 thread_a: Hello World from cpu 0 on imx95_evk!
199- thread_b: Hello World from cpu 2 on imx95_evk!
243+
244+ Option 3. Boot Zephyr by Using Remoteproc under Linux
245+ =====================================================
246+
247+ When running Linux on the A55 core, it can use the remoteproc framework to load and boot Zephyr,
248+ refer to Real-Time Edge user guide for more details. Pre-build images and user guide can be found
249+ at `Real-Time Edge Software `_.
250+
200251
201252Programming and Debugging (M7)
202253******************************
@@ -213,13 +264,47 @@ To program M7, an i.MX container image ``flash.bin`` must be made, which contain
213264multiple elements required, like ELE+V2X firmware, System Manager, TCM OEI, Cortex-M7
214265image and so on.
215266
216- The steps making flash.bin and programming should refer to ``Getting Started with
267+ SPSDK runner is used to build ``flash.bin ``, and it requires fetching binary blobs, which
268+ can be achieved by running the following command:
269+
270+ .. code-block :: console
271+
272+ west blobs fetch hal_nxp
273+
274+ .. note ::
275+
276+ It is recommended running the command above after :file: `west update `.
277+
278+ Two methods to build and program ``flash.bin ``.
279+
280+ 1. If :kconfig:option: `CONFIG_BOARD_NXP_SPSDK_IMAGE ` is not available for the board variant,
281+ the steps making flash.bin and programming should refer to ``Getting Started with
217282MCUXpresso SDK for IMX95LPD5EVK-19.pdf `` in i.MX95 `MCUX SDK release `_. Note that
218283for the DDR variant, one should use the Makefile targets containing the ``ddr `` keyword.
219-
220284See ``4.2 Run an example application ``, just rename ``zephyr.bin `` to ``m7_image.bin ``
221285to make flash.bin and program to SD/eMMC.
222286
287+ 2. If :kconfig:option: `CONFIG_BOARD_NXP_SPSDK_IMAGE ` is available and enabled for the board variant,
288+ ``flash.bin `` will be built automatically. The programming could be through below commands.
289+ Before that, switch SW7[1:4] should be configured to 0b1001 for usb download mode
290+ to boot, and USB1 and DBG ports should be connected to PC. There are 4 serial ports
291+ enumerated (115200 8n1), and we use the first for M7 and the fourth for M33 System Manager.
292+ (The flasher is spsdk which already installed via scripts/requirements.txt.
293+ On linux host, usb device permission should be configured per Installation Guide
294+ of https://spsdk.readthedocs.io)
295+
296+ .. code-block :: none
297+
298+ # load and run without programming. for next flashing, execute 'reset' in the
299+ # fourth serail port
300+ $ west flash
301+
302+ # program to SD card, then set SW7[1:4]=0b1011 to reboot
303+ $ west flash --bootdevice sd
304+
305+ # program to emmc card, then set SW7[1:4]=0b1010 to reboot
306+ $ west flash --bootdevice=emmc
307+
223308 Zephyr supports two M7-based i.MX95 boards: ``imx95_evk/mimx9596/m7 `` and
224309``imx95_evk/mimx9596/m7/ddr ``. The main difference between them is the memory
225310used. ``imx95_evk/mimx9596/m7 `` uses TCM (ITCM for code and, generally, read-only
0 commit comments