Skip to content

Commit 5e47efa

Browse files
JiafeiPankartben
authored andcommitted
boards: imx93_evk: add jlink runner support for a55 core
Added jlink runner support for A-core platform on i.MX93 EVK board, so that can use "west flash" to download zephyr.bin to DDR memory and then boot the Zephyr on Cortex-A55 Core0. Signed-off-by: Jiafei Pan <[email protected]>
1 parent eac798f commit 5e47efa

File tree

3 files changed

+106
-9
lines changed

3 files changed

+106
-9
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1+
#
2+
# Copyright 2025 NXP
3+
#
14
# SPDX-License-Identifier: Apache-2.0
25

36
zephyr_library()
47
zephyr_library_sources(board.c)
8+
9+
if(CONFIG_SOC_MIMX9352_A55)
10+
file(WRITE ${CMAKE_BINARY_DIR}/zephyr/runner.jlinkscript
11+
"LE
12+
loadfile "${CMAKE_BINARY_DIR}/zephyr/zephyr.bin" ${CONFIG_SRAM_BASE_ADDRESS}
13+
WReg PC ${CONFIG_SRAM_BASE_ADDRESS}
14+
g
15+
q")
16+
endif()

boards/nxp/imx93_evk/board.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
#
2+
# Copyright 2025 NXP
3+
#
14
# SPDX-License-Identifier: Apache-2.0
5+
6+
if(CONFIG_SOC_MIMX9352_A55)
7+
8+
board_runner_args(jlink "--device=MIMX9352_A55_0" "--no-reset" "--flash-script=${CMAKE_BINARY_DIR}/zephyr/runner.jlinkscript")
9+
10+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
11+
12+
endif()

boards/nxp/imx93_evk/doc/index.rst

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,60 @@ Programming and Debugging (A55)
118118

119119
.. zephyr:board-supported-runners::
120120
121-
U-Boot "cpu" command is used to load and kick Zephyr to Cortex-A secondary Core, Currently
122-
it is supported in : `Real-Time Edge U-Boot`_ (use the branch "uboot_vxxxx.xx-y.y.y,
121+
There are multiple method to program and debug Zephyr on the A55 core:
122+
123+
Option 1. Boot Zephyr by Using JLink Runner
124+
===========================================
125+
126+
The default runner for the board is JLink, connect the EVK board's JTAG connector to
127+
the host computer using a J-Link debugger, power up the board and stop the board at
128+
U-Boot command line, execute the following U-boot command to disable D-Cache:
129+
130+
.. code-block:: console
131+
132+
dcache off
133+
134+
then use "west flash" or "west debug" command to load the zephyr.bin
135+
image from the host computer and start the Zephyr application on A55 core0.
136+
137+
Flash and Run
138+
-------------
139+
140+
Here is an example for the :zephyr:code-sample:`synchronization` application.
141+
142+
.. zephyr-app-commands::
143+
:zephyr-app: samples/synchronization
144+
:host-os: unix
145+
:board: imx93_evk/mimx9352/a55
146+
:goals: flash
147+
148+
Then the following log could be found on UART2 console:
149+
150+
.. code-block:: console
151+
152+
*** Booting Zephyr OS build Booting Zephyr OS build v3.7.0-2055-g630f27a5a867 ***
153+
thread_a: Hello World from cpu 0 on imx93_evk!
154+
thread_b: Hello World from cpu 0 on imx93_evk!
155+
thread_a: Hello World from cpu 0 on imx93_evk!
156+
thread_b: Hello World from cpu 0 on imx93_evk!
157+
158+
Debug
159+
-----
160+
161+
Here is an example for the :zephyr:code-sample:`hello_world` application.
162+
163+
.. zephyr-app-commands::
164+
:zephyr-app: samples/hello_world
165+
:host-os: unix
166+
:board: imx93_evk/mimx9352/a55
167+
:goals: debug
168+
169+
Option 2. Boot Zephyr by Using U-Boot Command
170+
=============================================
171+
172+
U-Boot "go" command can be used to start Zephyr on A55 core0 and U-Boot "cpu" command
173+
is used to load and kick Zephyr to the other A55 secondary Cores. Currently "cpu" command
174+
is supported in : `Real-Time Edge U-Boot`_ (use the branch "uboot_vxxxx.xx-y.y.y,
123175
xxxx.xx is uboot version and y.y.y is Real-Time Edge Software version, for example
124176
"uboot_v2023.04-2.9.0" branch is U-Boot v2023.04 used in Real-Time Edge Software release
125177
v2.9.0), and pre-build images and user guide can be found at `Real-Time Edge Software`_.
@@ -129,23 +181,45 @@ v2.9.0), and pre-build images and user guide can be found at `Real-Time Edge Sof
129181
.. _Real-Time Edge Software:
130182
https://www.nxp.com/rtedge
131183

132-
Copy the compiled ``zephyr.bin`` to the first FAT partition of the SD card and
133-
plug the SD card into the board. Power it up and stop the u-boot execution at
134-
prompt.
184+
Step 1: Download Zephyr Image into DDR Memory
185+
---------------------------------------------
186+
187+
Firstly need to download Zephyr binary image into DDR memory, it can use tftp:
188+
189+
.. code-block:: console
190+
191+
tftp 0xd0000000 zephyr.bin
135192
136-
Use U-Boot to load and kick zephyr.bin to Cortex-A55 Core1:
193+
Or copy the Zephyr image ``zephyr.bin`` SD card and plug the card into the board, for example
194+
if copy to the FAT partition of the SD card, use the following U-Boot command to load the image
195+
into DDR memory (assuming the SD card is dev 1, fat partition ID is 1, they could be changed
196+
based on actual setup):
137197

138198
.. code-block:: console
139199
140-
fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; cpu 1 release 0xd0000000
200+
fatload mmc 1:1 0xd0000000 zephyr.bin;
141201
202+
Step 2: Boot Zephyr
203+
-------------------
142204

143-
Or use the following command to kick zephyr.bin to Cortex-A55 Core0:
205+
Then use the following command to boot Zephyr on the core0:
144206

145207
.. code-block:: console
146208
147-
fatload mmc 1:1 0xd0000000 zephyr.bin; dcache flush; icache flush; go 0xd0000000
209+
dcache off; icache flush; go 0xd0000000;
210+
211+
Or use "cpu" command to boot from secondary Core, for example Core1:
212+
213+
.. code-block:: console
214+
215+
dcache flush; icache flush; cpu 1 release 0xd0000000
216+
217+
Option 3. Boot Zephyr by Using Remoteproc under Linux
218+
=====================================================
148219

220+
When running Linux on the A55 core, it can use the remoteproc framework to load and boot Zephyr,
221+
refer to Real-Time Edge user guide for more details. Pre-build images and user guide can be found
222+
at `Real-Time Edge Software`_.
149223

150224
Use this configuration to run basic Zephyr applications and kernel tests,
151225
for example, with the :zephyr:code-sample:`synchronization` sample:

0 commit comments

Comments
 (0)