Skip to content

Commit 7b1266a

Browse files
JiafeiPankartben
authored andcommitted
boards: imx8mp_evk: add JLink runner for A53 Core
Use JLink runner for flash and debug on A53 Core. Signed-off-by: Jiafei Pan <[email protected]>
1 parent 84fce99 commit 7b1266a

File tree

2 files changed

+89
-24
lines changed

2 files changed

+89
-24
lines changed

boards/nxp/imx8mp_evk/board.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2024 NXP
2+
# Copyright 2024-2025 NXP
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
@@ -18,3 +18,9 @@ if(CONFIG_SOC_MIMX8ML8_M7)
1818
board_runner_args(jlink "--device=MIMX8ML8_M7")
1919
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
2020
endif()
21+
22+
if(CONFIG_SOC_MIMX8ML8_A53)
23+
board_runner_args(jlink "--device=MIMX8ML8_A53_0" "--no-reset" "--flash-sram")
24+
25+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
26+
endif()

boards/nxp/imx8mp_evk/doc/index.rst

Lines changed: 82 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,50 @@ Programming and Debugging (A53)
6464

6565
.. zephyr:board-supported-runners::
6666
67+
There are multiple methods to program and debug Zephyr on the A53 core:
68+
69+
Option 1. Boot Zephyr by Using JLink Runner
70+
===========================================
71+
72+
The default runner for the board is JLink, connect the EVK board's JTAG connector to
73+
the host computer using a J-Link debugger, power up the board and stop the board at
74+
U-Boot command line.
75+
76+
Then use "west flash" or "west debug" command to load the zephyr.bin
77+
image from the host computer and start the Zephyr application on A53 core0.
78+
79+
Flash and Run
80+
-------------
81+
82+
Here is an example for the :zephyr:code-sample:`hello_world` application.
83+
84+
.. zephyr-app-commands::
85+
:zephyr-app: samples/hello_world
86+
:host-os: unix
87+
:board: imx8mp_evk/mimx8ml8/a53
88+
:goals: flash
89+
90+
Then the following log could be found on UART4 console:
91+
92+
.. code-block:: console
93+
94+
*** Booting Zephyr OS build v4.1.0-3063-g38519ca2c028 ***
95+
Hello World! imx8mp_evk/mimx8ml8/a53
96+
97+
Debug
98+
-----
99+
100+
Here is an example for the :zephyr:code-sample:`hello_world` application.
101+
102+
.. zephyr-app-commands::
103+
:zephyr-app: samples/hello_world
104+
:host-os: unix
105+
:board: imx8mp_evk/mimx8ml8/a53
106+
:goals: debug
107+
108+
Option 2. Boot Zephyr by Using U-Boot Command
109+
=============================================
110+
67111
U-Boot "cpu" command is used to load and kick Zephyr to Cortex-A secondary Core, Currently
68112
it is supported in : `Real-Time Edge U-Boot`_ (use the branch "uboot_vxxxx.xx-y.y.y,
69113
xxxx.xx is uboot version and y.y.y is Real-Time Edge Software version, for example
@@ -75,21 +119,45 @@ v2.9.0), and pre-build images and user guide can be found at `Real-Time Edge Sof
75119
.. _Real-Time Edge Software:
76120
https://www.nxp.com/rtedge
77121

78-
Copy the compiled ``zephyr.bin`` to the first FAT partition of the SD card and
79-
plug the SD card into the board. Power it up and stop the u-boot execution at
80-
prompt.
122+
Step 1: Download Zephyr Image into DDR Memory
123+
---------------------------------------------
124+
125+
Firstly need to download Zephyr binary image into DDR memory, it can use tftp:
126+
127+
.. code-block:: console
128+
129+
tftp 0xc0000000 zephyr.bin
130+
131+
Or copy the Zephyr image ``zephyr.bin`` SD card and plug the card into the board, for example
132+
if copy to the FAT partition of the SD card, use the following U-Boot command to load the image
133+
into DDR memory (assuming the SD card is dev 1, fat partition ID is 1, they could be changed
134+
based on actual setup):
81135

82-
Use U-Boot to load and kick zephyr.bin to Cortex-A53 Core0:
136+
.. code-block:: console
137+
138+
fatload mmc 1:1 0xc0000000 zephyr.bin;
139+
140+
Step 2: Boot Zephyr
141+
-------------------
142+
143+
Then use the following command to boot Zephyr on the core0:
83144

84145
.. code-block:: console
85146
86-
fatload mmc 1:1 0xc0000000 zephyr.bin; dcache flush; icache flush; go 0xc0000000
147+
dcache off; icache flush; go 0xc0000000;
87148
88-
Or kick zephyr.bin to the other Cortex-A53 Core, for example Core2:
149+
Or use "cpu" command to boot from secondary Core, for example Core1:
89150

90151
.. code-block:: console
91152
92-
fatload mmc 1:1 0xc0000000 zephyr.bin; dcache flush; icache flush; cpu 2 release 0xc0000000
153+
dcache flush; icache flush; cpu 1 release 0xc0000000
154+
155+
Option 3. Boot Zephyr by Using Remoteproc under Linux
156+
=====================================================
157+
158+
When running Linux on the A55 core, it can use the remoteproc framework to load and boot Zephyr,
159+
refer to Real-Time Edge user guide for more details. Pre-build images and user guide can be found
160+
at `Real-Time Edge Software`_.
93161

94162
Use this configuration to run basic Zephyr applications and kernel tests,
95163
for example, with the :zephyr:code-sample:`synchronization` sample:
@@ -98,28 +166,19 @@ for example, with the :zephyr:code-sample:`synchronization` sample:
98166
:zephyr-app: samples/synchronization
99167
:host-os: unix
100168
:board: imx8mp_evk/mimx8ml8/a53
101-
:goals: run
169+
:goals: build
102170

103171
This will build an image with the synchronization sample app, boot it and
104172
display the following console output:
105173

106174
.. code-block:: console
107175
108-
*** Booting Zephyr OS build zephyr-v3.1.0-3575-g44dd713bd883 ***
109-
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
110-
thread_b: Hello World from cpu 0 on mimx8mp_evk_a53!
111-
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
112-
thread_b: Hello World from cpu 0 on mimx8mp_evk_a53!
113-
thread_a: Hello World from cpu 0 on mimx8mp_evk_a53!
114-
115-
Use Jailhouse hypervisor, after root cell linux is up:
116-
117-
.. code-block:: console
118-
119-
#jailhouse enable imx8mp.cell
120-
#jailhouse cell create imx8mp-zephyr.cell
121-
#jailhouse cell load 1 zephyr.bin -a 0xc0000000
122-
#jailhouse cell start 1
176+
*** Booting Zephyr OS build v4.1.0-3063-g38519ca2c028 ***
177+
thread_a: Hello World from cpu 0 on mimx8mp_evk!
178+
thread_b: Hello World from cpu 0 on mimx8mp_evk!
179+
thread_a: Hello World from cpu 0 on mimx8mp_evk!
180+
thread_b: Hello World from cpu 0 on mimx8mp_evk!
181+
thread_a: Hello World from cpu 0 on mimx8mp_evk!
123182
124183
Programming and Debugging (M7)
125184
******************************

0 commit comments

Comments
 (0)