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

TE0726 Several questions about Board bringup about design/petalinux/u-boot

Started by zorhat, February 17, 2020, 03:20:17 PM

Previous topic - Next topic

zorhat

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" 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!

  • When I add a zynq block in vivado, I can enable several UART/SPI modules. For the time being, I've aded UART1, SD1, USB0 and I2C1. As my understanding, I should chose MIO8-9 for UART1 since these ports are connected to FTDI chip in schematics. Also I should use SD1 MIO1-6 for SD card configuration. Is my assumption correct? Do I need additional configuration for UART or SD card on vivado side?
  • After configuring as mentioned above, I've export configuration from vivado and launch sdk. Without any code implementaiton on sdk side, I load up my VM and start petalinux compilation. Before building I see in the zynq7000.dtsi my Serial0 is as"disabled". And in the system-conf.dtsi, serial0 is defined as alias to UART1. I add "&uart1{ status="okay"};" to end of my system-user.dtsi to enable it. Is this step correct? It is weird for me to additionally enable it in a second dtsi layer. Eventough configuration is done on vivado side, Is seeing uart1 as disabled in zynq7000.dtsi correct behavior for petalinux?
  • As I understand, TE0726 can boot from SD card without any pin manipulation(Unlike some other test boards). To achive boot from SD, I set up my SD card to have 512MB fat32 partition and 29GB ext4 partition. I copy image.ub, BOOT.bin and system.dtb to fat32 partition. And I've dd coppied rootfs.ext4 from petalinux-build to ext4 partition. Is this correct? Do I need to specify anything in "petalinux-config kernel" or  "petalinux-config rootfs" steps?
  • While packaging the compiled files, I pass following : petalinux-package --boot --fsbl <zynqfsbl.elf> --fpga <designwrapper.bit> --u-boot <u-boot.elf>. All of the files are located inside images/linux directory (except for bit file). Is this packing correct? Do I need to modify anything manually? As an extension question, I was unable to program the flash of board with precompiled fsbl. I had to re-create a simple fsbl as specified in this AR. Do I need to use this new fsbl for BOOT.BIN packing?
  • Finally, I've written my SD card as previously mentioned and started my board. There is nothing in the virtual terminal. Not even uboot is started. I've used a debug enabled fsbl and still nothing. I am sure that my terminal is working, as I've verified it with precompiled image.

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.

JH

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

zorhat

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)

JH

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


zorhat

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)

JH

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