@@ -62,28 +62,88 @@ Programming and Debugging
6262
6363.. zephyr :board-supported-runners ::
6464
65+ There are multiple methods to program and debug Zephyr on the A53 core:
66+
67+ Option 1. Boot Zephyr by Using JLink Runner
68+ ===========================================
69+
70+ The default runner for the board is JLink, connect the EVK board's JTAG connector to
71+ the host computer using a J-Link debugger, power up the board and stop the board at
72+ U-Boot command line.
73+
74+ Then use "west flash" or "west debug" command to load the zephyr.bin
75+ image from the host computer and start the Zephyr application on A53 core0.
76+
77+ Flash and Run
78+ -------------
79+
80+ Here is an example for the :zephyr:code-sample: `hello_world ` application.
81+
82+ .. zephyr-app-commands ::
83+ :zephyr-app: samples/hello_world
84+ :host-os: unix
85+ :board: imx8mn_evk/mimx8mn6/a53
86+ :goals: flash
87+
88+ Then the following log could be found on UART4 console:
89+
90+ .. code-block :: console
91+
92+ *** Booting Zephyr OS build v4.1.0-3063-g38519ca2c028 ***
93+ Hello World! imx8mn_evk/mimx8mn6/a53
94+
95+ Debug
96+ -----
97+
98+ Here is an example for the :zephyr:code-sample: `hello_world ` application.
99+
100+ .. zephyr-app-commands ::
101+ :zephyr-app: samples/hello_world
102+ :host-os: unix
103+ :board: imx8mn_evk/mimx8mn6/a53
104+ :goals: debug
105+
106+ Option 2. Boot Zephyr by Using U-Boot Command
107+ =============================================
108+
65109U-Boot "cpu" command is used to load and kick Zephyr to Cortex-A secondary Core, Currently
66110it has been supported in latest U-Boot version by `patch serials `_.
67111
68112.. _patch serials :
69113 https://patchwork.ozlabs.org/project/uboot/list/?series=417536&archive=both&state=*
70114
71- Copy the compiled ``zephyr.bin `` to the first FAT partition of the SD card and
72- plug the SD card into the board. Power it up and stop the u-boot execution at
73- prompt.
115+ Step 1: Download Zephyr Image into DDR Memory
116+ ---------------------------------------------
117+
118+ Firstly need to download Zephyr binary image into DDR memory, it can use tftp:
119+
120+ .. code-block :: console
121+
122+ tftp 0x93c00000 zephyr.bin
74123
75- Use U-Boot to load and kick zephyr.bin to Cortex-A53 Core0:
124+ Or copy the Zephyr image ``zephyr.bin `` SD card and plug the card into the board, for example
125+ if copy to the FAT partition of the SD card, use the following U-Boot command to load the image
126+ into DDR memory (assuming the SD card is dev 1, fat partition ID is 1, they could be changed
127+ based on actual setup):
76128
77129.. code-block :: console
78130
79- fatload mmc 1:1 0x93c00000 zephyr.bin; dcache flush; icache flush; go 0x93c00000
131+ fatload mmc 1:1 0x93c00000 zephyr.bin;
80132
81- Or kick zephyr.bin to the other Cortex-A53 Core, for example Core2:
133+ Step 2: Boot Zephyr
134+ -------------------
135+
136+ Then use the following command to boot Zephyr on the core0:
82137
83138.. code-block :: console
84139
85- fatload mmc 1:1 0x93c00000 zephyr.bin; dcache flush; icache flush; cpu 2 release 0x93c00000
140+ dcache off; icache flush; go 0x93c00000;
141+
142+ Or use "cpu" command to boot from secondary Core, for example Core1:
143+
144+ .. code-block :: console
86145
146+ dcache flush; icache flush; cpu 1 release 0x93c00000
87147
88148 Use this configuration to run basic Zephyr applications and kernel tests,
89149for example, with the :zephyr:code-sample: `synchronization ` sample:
@@ -92,28 +152,19 @@ for example, with the :zephyr:code-sample:`synchronization` sample:
92152 :zephyr-app: samples/synchronization
93153 :host-os: unix
94154 :board: imx8mn_evk/mimx8mn6/a53
95- :goals: run
155+ :goals: build
96156
97157This will build an image with the synchronization sample app, boot it and
98158display the following ram console output:
99159
100160.. code-block :: console
101161
102- *** Booting Zephyr OS build zephyr-v3.1.0-3575-g44dd713bd883 ***
103- thread_a: Hello World from cpu 0 on mimx8mn_evk_a53!
104- thread_b: Hello World from cpu 0 on mimx8mn_evk_a53!
105- thread_a: Hello World from cpu 0 on mimx8mn_evk_a53!
106- thread_b: Hello World from cpu 0 on mimx8mn_evk_a53!
107- thread_a: Hello World from cpu 0 on mimx8mn_evk_a53!
108-
109- Use Jailhouse hypervisor, after root cell linux is up:
110-
111- .. code-block :: console
112-
113- #jailhouse enable imx8mn.cell
114- #jailhouse cell create imx8mn-zephyr.cell
115- #jailhouse cell load 1 zephyr.bin -a 0x93c00000
116- #jailhouse cell start 1
162+ *** Booting Zephyr OS build v4.1.0-3063-g38519ca2c028 ***
163+ thread_a: Hello World from cpu 0 on mimx8mn_evk!
164+ thread_b: Hello World from cpu 0 on mimx8mn_evk!
165+ thread_a: Hello World from cpu 0 on mimx8mn_evk!
166+ thread_b: Hello World from cpu 0 on mimx8mn_evk!
167+ thread_a: Hello World from cpu 0 on mimx8mn_evk!
117168
118169 .. include :: ../../common/board-footer.rst
119170 :start-after: nxp-board-footer
0 commit comments