PetaLinux Beginners Guide

tutorial

#1

Hi,
We have recently updated the documentation for Ultra96 and added in a guide that goes through the process of getting a PetaLinux Build setup and running on your board.
I’ve kept this guide to a bare minimum as the PetaLinux SDK is fairly comprehensive.


#2

Hello. I installed and builded petalinux project step by step watching this tutorial. After I insert SD card to my ultra96 board it boots fine, everything works as expected except then I try to turn off board by pressing power switch it does not react to it, I have to manualy turn off ultra96 board by pressing power button and holding it for 10 seconds. In my opinion power button interrupt does not work properly. Is it known issue or this happens only to me? Factory reset image works fine


#3

The Ultra96 has an On/Off controller tied to the Power Push Button. While operating, a push of the button will toggle a signal that is intended to be the power off interrupt to the processor. However, this has to be built into the design. This is part of the posted PetaLinux 2018.2 BSP if you want to see an example of this.

If the interrupt is not connected/enabled, you can also shutdown Linux the standard way from the command line with “shutdown -h now”

Bryan


#4

The Power Push Button definitely doesn’t work with the posted PetaLinux 2018.2 BSP.

shutdown -h now also does not power off the board.

Has anyone any ideas of how to get this working?

Many thanks

Andy


#5

I just built this the day before. Working fine on my end.
Please check

  1. if the Dip switches are set to beet from sdcard.
  2. SD card is properly inserted
  3. sd card is properly flashed.

#6

Hi Thanks for the reply,

Yep dip switch is set correctly, sd card is properly inserted and card is flashed correctly.

Everything boots up and work correctly apart from the power off does not work.

I have done the build 2 times following your instructions, I have also tried with the linux partition from the original card,

I will try a third time but my guess here is that it will be the same.

Do you have any info of how this should work, I have looked at the vivido project and there is nothing there at the FPGA so I am guessing it is at another level?

Many thanks

Andy


#7

Ok, sorry I didn’t catch that you were talking about power off specifically.
I do need to test that.
As for shutdown you can try the “shutdown -p now” command


#8

Ah, ok :slight_smile:

I tried that and poweroff, nothing seems to work. Something is just not connected up correctly somewhere.

I have looked at the “power” documents for the chip and it seems to be highly complicated.

I will post on the Xilinx site and reply here with any info.

Thanks for the help and the original guide.

Andy


#9

Hi Ric,

Info on how to fix has been posted here: https://forums.xilinx.com/t5/Embedded-Linux/Ultra96-BSP-Power-Off-not-working/m-p/914349/highlight/false#M30466

Cheers

Andy


#10

Cc: @ric96

I need help fixing segmentation faults occurring when petalinux-build runs on Debian testing. Those, and the fact that petalinux-build is unable to fetch packages in general. This is not a network issue.

Following the guide, petalinux-create works OK but petalinux-build fails with thousands of package fetching errors:

Summary: There were 1795 WARNING messages shown.
Summary: There were 3589 ERROR messages shown, returning a non-zero exit code.

I built various Yocto distros in the same environment many times before. Can you tell me what I should do differently for PetaLinux to build? My environment is pretty standard: no network proxy or NAT, and the file system is native - ext4. I have plenty of free space in the drive partition for those packages. The drive partition is on a fast USB3 drive.

I tried PetaLinux 2018.2 and 2018.3 with the same result. (To use 2018.2 on Debian one has to fix the xsct script and remove the locale sanity check in Yocto but that has been known for a while and I’ll omit describing the fixes. 2018.3 has those fixed already.) There are local file system fetch errors that look like that:

WARNING: open-amp-master+gitAUTOINC+7f2d8ca88d-r0 do_populate_sysroot_setscene: Failed to fetch URL file://1a/sstate:open-amp:aarch64-xilinx-linux:master+gitAUTOINC+7f2d8ca88d:r0:aarch64:3:1a910149d8adb0bb279c3c5b3f930b54_populate_sysroot.tgz;downloadfilename=1a/sstate:open-amp:aarch64-xilinx-linux:master+gitAUTOINC+7f2d8ca88d:r0:aarch64:3:1a910149d8adb0bb279c3c5b3f930b54_populate_sysroot.tgz, attempting MIRRORS if available
ERROR: open-amp-master+gitAUTOINC+7f2d8ca88d-r0 do_populate_sysroot_setscene: Fetcher failure: Unable to find file file://1a/sstate:open-amp:aarch64-xilinx-linux:master+gitAUTOINC+7f2d8ca88d:r0:aarch64:3:1a910149d8adb0bb279c3c5b3f930b54_populate_sysroot.tgz;downloadfilename=1a/sstate:open-amp:aarch64-xilinx-linux:master+gitAUTOINC+7f2d8ca88d:r0:aarch64:3:1a910149d8adb0bb279c3c5b3f930b54_populate_sysroot.tgz anywhere. The paths that were searched were:
    /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/sstate-cache
    /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/sstate-cache
ERROR: open-amp-master+gitAUTOINC+7f2d8ca88d-r0 do_populate_sysroot_setscene: No suitable staging package found
WARNING: Logfile for failed setscene task is /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work/aarch64-xilinx-linux/open-amp/master+gitAUTOINC+7f2d8ca88d-r0/temp/log.do_populate_sysroot_setscene.2291
WARNING: man-pages-4.11-r0 do_populate_sysroot_setscene: Failed to fetch URL file://86/sstate:man-pages:aarch64-xilinx-linux:4.11:r0:aarch64:3:869e25f469cb2d68ebfe057caf1ff951_populate_sysroot.tgz;downloadfilename=86/sstate:man-pages:aarch64-xilinx-linux:4.11:r0:aarch64:3:869e25f469cb2d68ebfe057caf1ff951_populate_sysroot.tgz, attempting MIRRORS if available
ERROR: man-pages-4.11-r0 do_populate_sysroot_setscene: Fetcher failure: Unable to find file file://86/sstate:man-pages:aarch64-xilinx-linux:4.11:r0:aarch64:3:869e25f469cb2d68ebfe057caf1ff951_populate_sysroot.tgz;downloadfilename=86/sstate:man-pages:aarch64-xilinx-linux:4.11:r0:aarch64:3:869e25f469cb2d68ebfe057caf1ff951_populate_sysroot.tgz anywhere. The paths that were searched were:
    /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/sstate-cache
    /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/sstate-cache
ERROR: man-pages-4.11-r0 do_populate_sysroot_setscene: No suitable staging package found
WARNING: Logfile for failed setscene task is /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work/aarch64-xilinx-linux/man-pages/4.11-r0/temp/log.do_populate_sysroot_setscene.2294

There are also remote fetch errors:

WARNING: gcc-source-7.2.0-7.2.0-r0 do_fetch: Failed to fetch URL http://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.xz, attempting MIRRORS if available
ERROR: gcc-source-7.2.0-7.2.0-r0 do_fetch: Fetcher failure: Fetch command export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1001/bus"; export SSH_AGENT_PID="1936"; export SSH_AUTH_SOCK="/tmp/ssh-1SQkSKSmd9MF/agent.1883"; export GIT_SSL_CAINFO="/opt/Xilinx/petalinux-2018.2/components/yocto/source/aarch64/buildtools/sysroots/x86_64-petalinux-linux/etc/ssl/certs/ca-certificates.crt"; export PATH="/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/opt/Xilinx/petalinux-2018.2/components/yocto/source/aarch64/layers/core/scripts:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot/usr/bin/crossscripts:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/usr/sbin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/usr/bin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/sbin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/bin:/opt/Xilinx/petalinux-2018.2/components/yocto/source/aarch64/layers/core/bitbake/bin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/hosttools"; export HOME="/home/vk"; /usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate -P /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/downloads 'http://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.xz' --progress=dot -v failed with exit code 139, output:
--2019-01-12 11:06:33--  http://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.xz
Resolving ftp.gnu.org... Segmentation fault

ERROR: gcc-source-7.2.0-7.2.0-r0 do_fetch: Fetcher failure for URL: 'http://ftp.gnu.org/gnu/gcc/gcc-7.2.0/gcc-7.2.0.tar.xz'. Unable to fetch URL from any source.
ERROR: gcc-source-7.2.0-7.2.0-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/temp/log.do_fetch.19395
ERROR: Task (/opt/Xilinx/petalinux-2018.2/components/yocto/source/aarch64/layers/core/meta/recipes-devtools/gcc/gcc-source_7.2.bb:do_fetch) failed with exit code '1'

Note the segmentation fault. Here is a detailed log for this segmentation fault:

DEBUG: Fetching ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz using command '/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certifi
cate -P /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/downloads 'ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz''
DEBUG: Fetcher accessed the network with the command /usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate -P /opt/Xilinx/projects/xilinx-ultr
a96-reva-2018.2/build/downloads 'ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz'
DEBUG: Running export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1001/bus"; export SSH_AGENT_PID="1936"; export SSH_AUTH_SOCK="/tmp/ssh-1SQkSKSmd9MF/agent.
1883"; export GIT_SSL_CAINFO="/opt/Xilinx/petalinux-2018.2/components/yocto/source/aarch64/buildtools/sysroots/x86_64-petalinux-linux/etc/ssl/certs/ca-certifi
cates.crt"; export PATH="/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/opt/Xilinx/petalinux-2018.2/compon
ents/yocto/source/aarch64/layers/core/scripts:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/usr/bin
/aarch64-xilinx-linux:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot/usr/bin/crossscripts:/opt/Xilinx/proje
cts/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/usr/sbin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/wor
k-shared/gcc-7.2.0-r0/recipe-sysroot-native/usr/bin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/s
bin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/work-shared/gcc-7.2.0-r0/recipe-sysroot-native/bin:/opt/Xilinx/petalinux-2018.2/components/yocto
/source/aarch64/layers/core/bitbake/bin:/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/tmp/hosttools"; export HOME="/home/vk"; /usr/bin/env wget -t 2 -
T 30 -nv --passive-ftp --no-check-certificate -P /opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/downloads 'ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz' --progress=dot -v
--2019-01-12 11:06:33--  ftp://gcc.gnu.org/pub/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz
           => '/opt/Xilinx/projects/xilinx-ultra96-reva-2018.2/build/downloads/gcc-7.2.0.tar.xz'
Resolving gcc.gnu.org... Segmentation fault

The URL is reachable and the package is downloadable.