News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

Boot TE0720 from QSPI and eMMC

Started by Nizlas, June 10, 2021, 02:40:28 PM

Previous topic - Next topic

Nizlas

Hello everyone,

for some days I am trying to boot TE0720 from QSPI (for BOOT.bin) and eMMC (for image.ub). Booting from SD card (BOOT.bin and image.ub on card) and from QSPI (BOOT.bin) + SD card (image.ub) works fine.

Here is what I do, when I try to boot from QSPI and eMMC:
1. change the setting in  petalinux-config ---> Subsystem AUTO Hardware Settings ---> SD/SDIO Settings ---> Primary SD/SDIO
2. check CONFIG_EXTRA_ENV_SETTINGS in platform-auto.h (sdbootdev is 1)
3. petalinux-build -c- u-boot
4. petalinux-package with zynq_fsbl_elf and system.bit from images/linux
5. Load boot.bin from step 4 with Vivado Hardware Manager to QSPI-Flash and image.ub via Linux to eMMC

When I boot from Sd-card I use the prebuilt BOOT.bin from Trenz test_board project. And everthing starts fine.
When I use the Petalinux generated BOOT.bin LED2 (D5) keeps flashing (50/50 4Hz), other LEDs turned off. Furthermore u-boot seems to look for the SD-card, as it says:

Unknown command 'dhcp' - try 'help'
Hit any key to stop autoboot:  0
no mmc device at slot 0


And there also is this Unknown command 'dhcp' warning, which only occurs with the BOOT.bin generated in Petalinux. I guess, I missed something to do with the BOOT.bin.

Can anyone please help me or tell me where I have to look.

Any help is highly appreciated, thanks a lot!



JH

Hi,
which petalinux version did you use? since 2020.x xilinx use  distro boot: https://wiki.trenz-electronic.de/display/PD/Distro+Boot+with+Boot.scr

Did you change something else on uboot? it seems uboot doesn't know "dhcp" command. dhcp is for ethernet to get IP from router

Did you formate emmc correctly and did you copy your files into emmc?

Do following:
1 start Design with ramdisk and formate emmc like you need (only one partion for image.ub or partition in case you want to use permanent  filesystem)
2 copy file into emmc
3 change boot.bin with your uboot which looks on emmc for files.

See also :
https://forums.xilinx.com/t5/Processor-System-Design-and-AXI/ZYNQ-Boot-Devices-QSPI-emmc/td-p/941862

br
John

Nizlas

Hi John,

thanks for your reply.

I am using Petalinux 2018.2.
My eMMC is formated as you can see in the attachment and the image.ub is placed into eMMC. Because I can boot from eMMC manually with bootm, I guess, it is correct.


How do I change my boot.bin? I use petalinux-package to generate it, after I configured my build for Linux as mentioned in the post.
However I am not totally sure which fsbl and bitstream I need to reference using petalinux-package. I reference the ones, that are located in images/linux, which are generated after petalinux-config --get-hw-description. Is that correct?

There is also this warning when I use petalinux-package: rlwrap: warning: your $TERM is 'xterm-256color' but rlwrap couldn't find it in the terminfo database. Expect some problems.: Inappropriate ioctl for device
.
Can I ignore it or is it something crucial?

Thanks a lot for your help.

Best regards

JH

Hi,
did you formate your partion as fat32?

Here is a tutorial how you petalinux for emmc boot:
https://www.beyond-circuits.com/wordpress/tutorial/tutorial27/

QuoteThere is also this warning when I use petalinux-package: rlwrap: warning: your $TERM is 'xterm-256color' but rlwrap couldn't find it in the terminfo database. Expect some problems.: Inappropriate ioctl for device
I do not know this error message, sorry. But I think you can ignore, it only looks like xterm console colouring did not work

br
John

Nizlas

Hi John,

thanks again for your help.

The partition is formated as vfat as explained in the tutorial.
Do I have to add something in the device tree to the compatible value as mentioned in the tutorial for the PicoZed? Right know it says:

&qspi {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";
    flash0: flash@0 {
        compatible = "jedec,spi-nor";
        reg = <0x0>;
        #address-cells = <1>;
        #size-cells = <1>;
    };
};



In the tutorial it says under Application FPGA, that I have to configure UBoot to use the correct interface. Where do I do that? Is it already done by selecting ps7_sd_1 in petalinux configuration menu?
I think, that my problem is still somewhere in configuring and packaging of u-boot. Is there some tutorial explaining this in detail?

After I connected SDIO1 CD Pin to logic 0, I even get no output on the console via UART.

And what does the 4Hz Blink of D5 mean? It only appears when I use the BOOT.bin from petalinux-package. With prebuild BOOT.bin none of the LEDs are blinking.

Best regards


JH

Hi,
QuoteAnd what does the 4Hz Blink of D5 mean? It only appears when I use the BOOT.bin from petalinux-package. With prebuild BOOT.bin none of the LEDs are blinking.
https://wiki.trenz-electronic.de/display/PD/TE0720+CPLD#TE0720CPLD-On-boardLEDs

QuoteDo I have to add something in the device tree to the compatible value
Or generic device tree is Ok, it's no matter for your problem.

QuoteIs it already done by selecting ps7_sd_1 in petalinux configuration menu?
depends on the petalinux version. check platform-auto.h to see what Xilinx has used from setup. you can overwrite this in platform-top.h  in case it's not correct.

br
John

Nizlas

Hi John,


I already found this
Quotehttps://wiki.trenz-electronic.de/display/PD/TE0720+CPLD#TE0720CPLD-On-boardLEDs

But I wonder why it stops blinking when I use prebuilt BOOT.bin and does not stop when I use the petalinux-package version.

I attached my platform-auto.h. sdbootdev is set to one which should be correct, right?

Do you maybe have an example BOOT.bin, which loads image.ub from eMMC, to cancel out one or another possible mistake?


Best regards


JH

Hi,

QuoteBut I wonder why it stops blinking when I use prebuilt BOOT.bin and does not stop when I use the petalinux-package version.
some of the LED/CPLD features depends on our FSBL changes. I think you did not create a patch for petalinux or? So you start it without our modifications:
https://wiki.trenz-electronic.de/display/PD/TE0720+Test+Board#TE0720TestBoard-fsbl.1

QuoteDo you maybe have an example BOOT.bin, which loads image.ub from eMMC, to cancel out one or another possible mistake?
No.

Only one demo with permanent file system on SD with TE0701:
https://wiki.trenz-electronic.de/display/PD/TE0720+HDMI701
But this will help you only partially or not at all

br
John


Nizlas

Hi John,

how do I patch the FSBL changes to petalinux? Is it done by just replacing the three mentioned files and adding the two new ones?

Best regards

JH

I would recommend to use vitis and our template included as local repository to generate FSBL and boot.bin.

Xilinx has some documentation about petalinux FSBL patch:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842475/PetaLinux+Yocto+Tips


to generate the patch file use git.
create  fork of https://github.com/Xilinx/embeddedsw
select branch of your vivado version
copy our modified FSBL (must be from the same vivado version!) into the FSBL folder of the git
commit changes to your fork
use git format-patch to generate patch file which can be used in petalinux.

--> Try out I can't help more on this topic, it's planned that we also add this patches to our reference designs but I can't tell you any timeline for this task

br
John

Nizlas

I will try to do it with Vitis. Can I use a newer version of vitis as my Vivado and Petalinux version is 2018.2, but Vitis is only available since 2019.
Can I create the XSA file somehow with Vivado 2018.2?

Or do I have to upgrade my whole toolchain to use vitis?

Best regards

JH

Hi,
QuoteCan I create the XSA file somehow with Vivado 2018.2?
Never do some crossing between different version! The strangest things can happen there!


We have also an 18.2 version with 18.2 fsbl template which works with older SDK:
https://shop.trenz-electronic.de/en/Download/?path=Trenz_Electronic/Modules_and_Module_Carriers/4x5/TE0820/Reference_Design/2018.2/test_board

We have some older documentation which also explain how you can include this FSBL template in your SDK project to replace original FSBL: https://wiki.trenz-electronic.de/display/PD/SDK+Projects


br
John

Nizlas

Hi John,

But I cannot create a Boot.bin with SDK which loads petalinux Image, can I? As I understood, the link explains how to setup a baremetal boot.bin.

I am getting a bit confused. Building the Image for Peatlinux boot from eMMC seems to be more complicated then I expected.
Isn't there a standard way to do it?

JH

Hi,
QuoteBut I cannot create a Boot.bin with SDK which loads petalinux Image, can I?
you can.

QuoteAs I understood, the link explains how to setup a baremetal boot.bin.
simple replace hello world app elf with u-boot elf file.

br
John

Nizlas

Hi John,

I was able to package a working boot.bin with the prebuilt files in petalinux. However, when I replace the pre-built u-boot.elf with the one I built in petalinux, the boot process stucks after fsbl and prints the following multiple times without going on.
Xilinx First Stage Boot Loader (TE modified)
Release 2018.2  Apr 19 2021-10:20:11

Device IDCODE ->        23728093
Revision ->     2
Device ->       8 (7z014s)

SoM: TE0720-03-1C14S SC REV:05
MAC: 80 1F 12 DF 35 4B
Xilinx First Stage Boot Loader (TE modified)
Release 2018.2  Apr 19 2021-10:20:11

Device IDCODE ->        23728093
Revision ->     2
Device ->       8 (7z014s)

SoM: TE0720-03-1C14S SC REV:05
MAC: 80 1F 12 DF 35 4B
Xilinx First Stage Boot Loader (TE modified)
Release 2018.2  Apr 19 2021-10:20:11

Device IDCODE ->        23728093
Revision ->     2
Device ->       8 (7z014s)

SoM: TE0720-03-1C14S SC REV:05
MAC: 80 1F 12 DF 35 4B



It seems like it is caught in a loop. It happens when booting from QSPI as well as from SD.


Do you have any idea, why the generated u-boot.elf leads to this?
Am I missing some u-boot configuration?




Best regards


JH

Hi,

you see only FSBL prints, so you has some problem with your u-boot which force a reboot.
Did you use the same Vivado/Petalinux version for all files?
Did you use our petalinux template?


br
John

Nizlas

Hi John,

Yes, Vivado and PetaLinux are both in Version 2018.2.

If I remember correctly PetaLinux was set up using your KICKstart guide:
https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetaLinux2018.2

Which template do you mean? Could you provide a link?
I only found this, when looking for a petalinux template:
https://wiki.trenz-electronic.de/display/PD/PetaLinux+TE-Template#PetaLinuxTETemplate-PetaLinux2018.2

Best regards

JH

Hi,
it's included into the project delivery in the subfolder os/petalinux, for 18.3:
https://shop.trenz-electronic.de/en/Download/?path=Trenz_Electronic/Modules_and_Module_Carriers/4x5/TE0720/Reference_Design/2020.2/test_board

copy HDF into this folder and run "petalinux-config --get-hw-description"

br
John

Nizlas

Hi John,

I checked the template and by replacing files in project_spec/configs I was able to generate a working u-boot. After removing sd0 MIOs from my design, booting from QSPI + eMMC also seems to work fine.

Thanks again for your help!

Best regards

pmezquita

Hello Nizlas!

I'm trying to generate a BOOT.bin and a image.ub for the same part (xc7z014s) for a personal project but I am experimenting a lot of problems. I would appreciate if you can send me the petalinux project, or you can specify the changes you made to get petalinux working.

Thank you very much in advance.
Best regards
Pablo