Boot to U-Boot with JTAG on ZCU102

Tags: petalinux linux u-boot xilinx zynqmp zcu102 jtag

Occasionally when using SD boot mode, the device will fail to boot. I am not sure why this happens, but it's happened to me at least 3 times. My guess is that the BOOT.BIN file somehow gets corrupted, but I cannot say for sure.

This is problematic when working remotely because I cannot physically remove the SD card to write a new BOOT.BIN image. Instead, what you can do is boot to U-Boot on the board's processor using JTAG.

The following script can be run in Xilinx's xsct tool and will download U-Boot to the APU and start it:

targets -set -nocase -filter {name =~ "*PSU*"}
mask_write 0xFFCA0038 0x1C0 0x1C0
targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}

catch {stop}; after 1000
dow  "images/linux/pmufw.elf"
after 2000
targets -set -nocase -filter {name =~ "*APU*"}
mwr 0xffff0000 0x14000000
mask_write 0xFD1A0104 0x501 0x0
targets -set -nocase -filter {name =~ "*A53*#0"}

source project-spec/hw-description/psu_init.tcl
targets -set -nocase -filter {name =~ "*A53*#0"}
dow  "images/linux/u-boot.elf"
after 2000

The paths in the script above assumes the use of PetaLinux. If that's not the case then just update the paths accordingly.

Note that this script does not download the bitstream, the FSBL, or the ARM Trusted Firmware (bl31.elf), so it is not good enough to use as a full-time JTAG boot script. But it does work to boot to a U-Boot prompt. From there, a new BOOT.BIN file can be downloaded using TFTP and written to the SD card.