# Boot to U-Boot with JTAG on ZCU102

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:

connect
targets -set -nocase -filter {name =~ "*PSU*"}
targets -set -nocase -filter {name =~ "*MicroBlaze PMU*"}

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

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


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.

## Notes

• It might be possible to skip the downloading of pmufw.elf as well. If I ever run into this situation again I will try it without that step.