Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: zorhat on February 17, 2020, 03:20:17 PM

Title: TE0726 Several questions about Board bringup about design/petalinux/u-boot
Post by: zorhat on February 17, 2020, 03:20:17 PM
Hello all,

I am fairly new to Zynq and Petalinux. I have this TE0726 board for a while now(I think it is rev03) I am unable to startup my own compiled petalinux. I've had several points that I do not understand. The "Getting started (https://www.digikey.com/eewiki/display/Motley/Getting+Started+with+the+ZynqBerry)" guide of digikey works to some degree. I can setup my board with the precompiled BOOT bin and my choice of rootfs. When I try to create a project from scratch and compile petalinux as well, nothing works. I do not use any scripts to compile/generate my vivado project(I will add more PL in the future manually). There is only Zynq processor block(and AXI timer from the digikey example) for now to just test whether I can bring the board up. From design to board bringup I've several questions and any help/suggestion would be big help!

Thank you very much for reading so far. I am at a complete lost, this very basic scenario took way too much time and I do not know what to do from here on. Any help would be greatly appreciated. Thanks in advance once more,
Regards,
SB.
Title: Re: TE0726 Several questions about Board bringup about design/petalinux/u-boot
Post by: JH on February 17, 2020, 03:49:09 PM
Hi,
TE0726 can't primary boot from SD, because Xilinx Zynq devices in CLG225 package do not support SD Card boot directly from ROM bootloader. Use QSPI for primary boot and SD for secondary boot (uboot). --> See Xilinx Zynq TRM:
https://www.xilinx.com/support/documentation/user_guides/ug585-Zynq-7000-TRM.pdf

We provide Reference Designs which include Board part files (for correct PS setup ) and also linux template. Documentation and download Links are available:
https://wiki.trenz-electronic.de/display/PD/TE0726+Reference+Designs
--> Designs includes prebuilt binaries (Boot.bin, image.ub....) for tests.

I have never tested the digikey example design, so I can't help much for this tutorial. But it seems they have own contact mail: https://www.digikey.com/eewiki/display/Motley/Getting+Started+with+the+ZynqBerry#GettingStartedwiththeZynqBerry-Contact


br
John
Title: Re: TE0726 Several questions about Board bringup about design/petalinux/u-boot
Post by: zorhat on February 23, 2020, 03:41:33 PM
Thanks for the swift answer, and I am sorry for the delayed answer :) The "QSPI" clarification solved some of the issues I am having. After rebuilding my petalinux environment, I belive my u-boot is starting and my image.ub is loaded! Tough, this time I am unable to load the rootfs. As I've mentioned earlier After programming Boot.Bin to QSPI flash, I make two partitions on my sd card, 1st is fat32 and contains image.ub/system.dtb, 2nd partition is ext4 and overerwritten  by "dd" with the output file; "rootfs.ext4". (Maybe this step is incorrect for me) I've tried to mount rootfs.ext4 as a loopdevice and coppied internals to my 2nd ext4 Sd card partition manually, still it was not booting. My teminal log is attached and as you can see I've following error;
Warning: unable to open an initial console.
mmcblk1: p1 p2
Waiting for root device /dev/mmcblk0p2...


What would your suggestions be? Do I need additional init script for rootfs?

Note: Digikey example is mentioned for earlier to just give a context to my message, I am not following that example, I'm trying to configure my board from scract with my petalinux(when I manage to work it maybe I will try different/custom linux distros)
Title: Re: TE0726 Several questions about Board bringup about design/petalinux/u-boot
Post by: JH on February 25, 2020, 07:38:59 AM
Hi,
the easiest why is to include all on image.ub, like we do on our reference design
In case you want to have persistent filesystem (it seems so from your descibtion), try out our Demo2 with debian dektop:In this case filesystem is removed from image.ub and we use debian rootfs. Device tree is still included in image.ub container. This can also be excluded, you must set only correct location where it can be found from uboot and linux.brJohn

Title: Re: TE0726 Several questions about Board bringup about design/petalinux/u-boot
Post by: zorhat on February 27, 2020, 03:18:46 PM
Hi again,

Thank you for your answers. I am sure your demo/test applications will work without a hitch but what I want to learn is how things are done in behind the scenes. Therefore, I started from almost scratch and doing things step by step. I am trying to avoid using pre-written scripts(like in your demos) as much as I can for the time being. Thanks to your initial explanation I've made some progress. Right now I think I've almost got it but still I am unable to log into a terminal. As you can see from my log, the /sbin/init is started. Shouldn't this script drop me into a terminal/login prompt? If not, in your opinion, what am I missing ?
(fyi, I am using a virtual box linux to write things into SD card. Does this cause any problem?)
My relevant terminal log:

...
mmcblk1: p1 p2
Warning: unable to open an initial console.
EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)

VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
Run /sbin/init as init process
random: fast init done

udevd[765]: starting version 3.2.5
random: udevd: uninitialized urandom read (16 bytes read)
random: udevd: uninitialized urandom read (16 bytes read)
random: udevd: uninitialized urandom read (16 bytes read)
udevd[766]: starting eudev-3.2.5
EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
urandom_read: 2 callbacks suppressed
random: dd: uninitialized urandom read (512 bytes read)
random: dropbearkey: uninitialized urandom read (32 bytes read)
random: dropbearkey: uninitialized urandom read (32 bytes read)
random: dropbearkey: uninitialized urandom read (32 bytes read)
random: dropbear: uninitialized urandom read (32 bytes read)
Title: Re: TE0726 Several questions about Board bringup about design/petalinux/u-boot
Post by: JH on February 28, 2020, 10:22:15 AM
Hi,
that's the basic step:
https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetalinuxProjectCreation-ShortHOWTO

Here I've described how you I setup petalinux build environment and how you can modify a new project:
https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetaLinux2019.2

On demo2 use also second SD as Filesystem, we have described what we have changed manually (what's not done by hdf/xsa import automatically):
https://wiki.trenz-electronic.de/display/PD/TE0726+Zynqberry+Demo2
And for the file system sd image we provides additional scripts, which you can check.

There a lot of different ways possible to generate linux, how we does it and what we has done is described in the links above, I can't help much more sorry.
br
John