Upon upgrading my Zynqberry projects to 2022.1, I discovered that I wasn't able to program the QSPI flash of the TE0726/Zynqberry nor the TE0727/ZynqberryZero from Vivado or Vitis when the board wasn't booted straight up into JTAG boot mode. Since the chip bootstrapped for QSPI boot mode, the FSBL must be the one to change it during the boot process (thus why the special Zynqberry Zynq FSBL application is created in Vitis in my 2019.2 tutorials).
At first I thought that I could outsmart it by creating the same Zynqberry Zynq FSBL application in Vitis 2022.1 just like I had in 2019.2 and simply launch a debug run of it, but unfortunately I couldn't get the debug run to launch even with the Zynqberry booting up in QSPI boot mode (for the sake of full transparency, it worked ONCE and never again, and I never could recreate those initial conditions to get it to work again).
After some Googling and poking around on Trenz's wiki, I discovered that there was no current solution to programming the flash memory of a Zynq chip using Vivado/Vitis when the chip boots in QSPI mode initially in versions 2021.x and later. The only option offered on the wiki was to use a pre-2021.x version of Vivado/Vitis to program the flash of the Zynqberry boards.
The ultimate impact here is if I wanted to create an embedded Linux image for any of my Zynqberry boards using PetaLinux 2022.1, I would have to use Vitis 2019.2 (or any Vitis version 2020.x and earlier) to program the Linux boot binary onto the Zynqberry's QSPI flash memory.
Considering that I have Vitis/PetaLinux 2022.1 installed on my Ubuntu 22.04 VM and Vitis/PetaLinux 2019.2 installed on my Ubuntu 18.04 VM, this meant a file transfer between my VMs. This is no problem when using certain VM software like Parallels, but other VM software tools don't facilitate this quite as well. Not to mention, it's still a pain to keep track of which BOOT.BIN is which.
My ultimate solution to this was to create a boot image for the Zynqberry Zynq FSBL application in Vitis 2019.2 and program that onto my Zynqberry's QSPI flash memory in my Ubuntu 18.04 VM. This ensured that when I disconnected the Zynqberry from my Ubuntu 18.04 VM and connected it to my Ubuntu 22.04 VM, it would boot up in JTAG boot mode which would allow me to program my PetaLinux 2022.1 BOOT.BIN onto its flash memory using Vitis 2022.1.
Also remember to not have an SD card inserted in the Zynqberry orZynqberryZero when flashing the QSPI in any of the following steps.
Note: While I'm using Vitis 2022.1, this process should also work for any Vitis version 2021.x and later, so I'll be using the terms interchangeably.
QSPI Flash Application in Vitis 2019.2Like I mentioned before, I have created the Zynqberry Zynq FSBL application already in Vitis 2019.2. So follow those instructions here to create it. As far as I'm aware, this should also work in Vitis versions 2020.1, 2020.2, and 2020.3.
Create 2019.2 QSPI Flash Boot BinaryOnce the Zynqberry Zynq FSBL application has been created and built in Vitis 2019.2, right-click on the <QSPI app name>_system
from the Explorer window and select the option to Create Boot Image.
This creates a boot binary (BOOT.BIN) for the application in ./<Vitis workspace directory>/<QSPI app name>_system/_ide/bootimage/
.
To then program the boot binary for the Zynqberry Zynq FSBL application, again right-click on the <QSPI app name>_system
from the Explorer window and select the option to Program Flash.
Select the boot binary located in ./<Vitis workspace directory>/<QSPI app name>_system/_ide/bootimage/
for the Image File. Set the Offset to 0x0
, and the Flash Type to qspi-x4-single
. Select the Zynqberry Zynq FSBL.elf file located in /<Vitis workspace directory>/<QSPI app name>/Debug/
.
I personally always like to enable the options for Blank check after erase and Verify after flash, but it's not necessary.
Program Flash with 2021.x or Later Bare Metal or Linux Boot BinaryWith the proper FSBL to boot the Zynq into JTAG boot mode programmed onto the Zynqberry's QSPI flash, it can now be programmed using Vivado/Vitis 2021.x and later versions.
Plot twist: the Zynqberry Zynq FSBL application is still necessary to program the Zynqberry's QSPI flash from Vitis 2022.1 even though it wasn't possible to program the Zynqberry without it booting up in JTAG initially. This tells me a reboot happens in the program flash operation in Vitis before the actual programming, but I'm not sure what is different before that to prevent things from working without the Zynq being in JTAG boot mode initially.
Luckily, the exact process to create the Zynqberry Zynq FSBL application in 2019.2 works the exact same in 2022.1 so you can follow those same steps in Vitis 2022.1. You could also just transfer the.elf file from 2019.2 if preferred.
Select Xilinx > Program Flash from the toolbar in Vitis 2022.1 and select the desired boot binary from a PetaLinux project (or bare-metal application) for the Image File.
Set the Offset to 0x0
, and the Flash Type to qspi-x4-single
. Select the Zynqberry Zynq FSBL.elf file located in /<Vitis workspace directory>/<QSPI app name>/Debug/
or wherever it is located if transferred over from 2019.2.
I will update this post if I find a workaround that eliminates the need for a later version of Vivado/Vitis altogether.
Comments