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

Building Petalinux for TE0720 + TE0703

Started by dc352, January 28, 2015, 05:12:08 PM

Previous topic - Next topic

dc352

Hi all

I have spent a few hours yesterday trying to build a Petalinux image for SD card.

I have:
1. created a VM of CentOS (btw, allow at least 30-40GB for the disk)
2. downloaded Petalinux 2014.4 from http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/petalinux.html
3. started the "run" file I downloaded in step 2 - so it's in directory <xilinx>

.. and thought it's time to give it a go
1. sourced settings with: cd <xilinx>; source settings.sh
2. Embarked on the workflow:
petalinux-create —type project —template zynq —name <myproject>
cd <xilinx>/etc/template/project/template-zynq/subsystems/linux/hw-description
petalinux-config --get-hw-description -p <myproject - absolute path>
petalinux-build
petalinux-boot —qemu —kernel
3. the last command just complained about IP address but the system actually booted up and seemed to work
4. The workflow manual (the same webpage where you download Petalinux from) says to run this to create a bin file for SD card:
   petalinux-package —boot —format BIN —fsbl images/linux/zynq_fsbl.elf —u-boot

unfortunately, you need a "bootgen" utility that is only available in SDK
5. I downloaded "Vivado full image for Linux with SDK" from http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools.html
6. 5GB later and 20 minutes of installation time I was able to run the petalinux-package
export PATH=$PATH:/<SDK inst. folder>/Xilinx/SDK/2014\.4/bin
   cd <myproject>
   petalinux-package —boot —format BIN —fsbl images/linux/zynq_fsbl.elf —u-boot
7. success and there is a BOOT.BIN file in <myproject>/images/linux as well as in "/tftpboot"   
8. I copied BOOT.BIN and image.ub to my SD card and tried - didn't work

Question:
I had to make a mistake somewhere in step 7 - possibly. Can you please advise what could the problem be?

Cheers


Oleksandr Kiyenko

Hi,

At first you should check that UART0 selected for u-boot and linux. If it not helps, enable debug messages in FSBL to see boot log.

Best regards
Oleksandr Kiyenko

dc352

Well, there is a dip switch on TE0703. When I switch it to OFF, I can boot to the default image from SPI FLASH.

picocom -b 115200 /dev/tty.usbserial-251633000242B

When I switch it to ON, I can't see any output on the tty device. Now, I figured out that I can add
#define FSBL_DEBG_INFO

to <project>/components/bootloader/zynq_fsbl/fsbl_debug.h - somewhere around line 58.

then I can run:
petalinux-build
petalinux-boot --qemu --kernel // just to test - yes, it boots
petalinux-package --boot --format BIN --fsbl images/linux/zynq_fsbl.elf --u-boot --force

copy it onto my SD card -> the same result. Not sure what logs  or where I should be able to see. There is no new file on the SD card.

Well, when I look at the content of /tftpboot then BOOT.BIN is about 350kB while zImage and vmlinux are 10MB+ . I would assume I need more than a couple of files to boot-up peta linux.

Anyway, I copied everything from /tftpboot to the SD card -> no change.

Anybody any thoughts?

Dan

Oleksandr Kiyenko

Hello,

I usually making BOOT.bin in Vivado/SDK to include bit file into the BOOT.bin. If you do it in Petalinux, BOOT.bin contain only FSBL.elf and u-boot.elf.
Please try to build project this way
1) In Vivado create bit file and export hardware
2) Open SDK and create FSBL project
3) Build Petalinux, but not download it to hardware (check that serial port is UART0)
4) Create BOOT.bin from bit, FSBL.elf and u-boot.elf
5) Write BOOT.bin from SDK and umage.ub from Petalinux to SD

Best regards
Alex

Antti Lukats

you can create complete BOOT.BIN in petalinux also the path to .BIT file must be given in the commandline that builds the BOOT.BIN

https://wiki.trenz-electronic.de/display/PD/Design+Flow

dc352

Thanks for replies so far. It's not quite what I was hoping for but I will give it another shot later this week.

We work on a project where we split the development between some tools for the arm cores / Linux app and an FPGA design. At this stage I don't really care about which BIT file I use and I hoped that when I download just Petalinux archive from Xilinx's website I will be able to build something that works.

At the moment it looks as if I have to use the Vivado and/or SDK to create at least an elf file - although there is one in the Petalinux archive I downloaded.

Re boot log - I'm not sure how to create that but I assume that I need JTAG cable for that?

To sum it up - my initial approach to do it with as little tools / software as possible but I didn't succeed yet. I will give it another go with a JTAG programmer, using Vivado/SDK - it's a bit of a learning curve for me but I can't see a way round it at the moment.

Cheers

PS: I found binaries for Petalinux 2014.2 that I can use out of the box but the challenge is to compile a C app so I will probably need to be able to build my own image anyway.

Antti Lukats

#6
IMPORTANT:

1 please do not take BOOT.BIN that is compiled for unknown board or product
2 please do not take FSBL.ELF that is compiled for unknown board or product
3 please do not take HDF file for unknown board or product
4 please do not take BIT file for unknown board or product
5 please do not take u-boot in any form that is compiled for unknown board or product
6 please do not take devicetree that is for unknown board or product
7 please do not take linux images that are compiled for unknown board or product

All the above listed items must MATCH the board or product you use.

Failure to obey the above may result in any kind of failures.

For software only development:

1) Xilinx SDK - take HDF file for your board/product. There is no need to ever start Vivado.
2) Petalinux SDK - take HDF file or start from BSP. There is no need to ever start Vivado.

BIT file is not at all needed for software development. Use of JTAG is not needed for software development (if you use console debug only).

For hardware only development:

It is possible to use Vivado only, but then the fabric clocks from PS are not available, and if clocks are required then must be available on PL pins. If PS Fabric clocks are required to be present the ARM CPU0 has to execute the FSBL (or the init has to be done by SDK debugger). Vivado can not initialize the PS portion.

This is not at all complicated. But the guidelines above must be obeyed.




dc352


Antti Lukats

you must still pay attention if you mix and match between project and files from different sources.

It is very easy to work, but some flow steps should not be skipped or avoided.

And yes, sometimes the things DO NOT work still.

It has happened a lot that FSBL and/or BOOT.BIN generated with petalinux do not work, but BOOT.BIN generated from same source with Xilinx SDK does. There is sometimes a "test and try" needed.

http://www.trenz-electronic.de/de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/Test_Designs/d3/TE0720-02-GPIO.html

2014.4 with FSBL and BOOT.BIN generated under petalinux, does boot and work.

To be honest this was the FIRST time petalinux generated BOOT.BIN really booted (without the use of Xilinx SDK).