Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: ainam. on March 05, 2021, 04:33:20 PM

Title: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 05, 2021, 04:33:20 PM
For a long time now I have been looking to find a way to install the build files on a Petalinux image or ubuntu.

I have been successful in making an image that runs with an ubuntu system even with my mods.

But I still can't build driver code because of the missing build folder in /lib/modules/uname -r

I can't find it anywhere as a download as well. Please can someone tell me where to download them from or to add them in the petalinux-build process.
I looked there as well but couldn't find anything still.
Where are those linux-headers ?
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 08, 2021, 06:32:47 AM
Hi,
what you ask is all xilinx (or better open source) stuff:
https://www.xilinx.com/support/answers/75775.html
https://github.com/Xilinx/linux-xlnx

br
John
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 09, 2021, 01:12:10 PM
I have been going through a lot of ideas. One is to make the mkubuntu_bionic_beaver.sh run.

I changed the ubuntu version to 20.04.2 and let it run again.

I get this Error Message in the log:


update-alternatives: using /usr/bin/konsole to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode
Setting up adwaita-icon-theme (3.36.1-2ubuntu0.20.04.2) ...
update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode
Setting up ca-certificates-java (20190405ubuntu1) ...
/usr/bin/head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
the keytool command requires a mounted proc fs (/proc).
dpkg: error processing package ca-certificates-java (--configure):
installed ca-certificates-java package post-installation script subprocess returned error exit status 1
Setting up default-jre-headless (2:1.11-72) ...
Setting up libgtk-3-0:arm64 (3.24.20-0ubuntu1) ...
dpkg: dependency problems prevent configuration of openjdk-11-jre-headless:arm64:
openjdk-11-jre-headless:arm64 depends on ca-certificates-java (>= 20190405~); however:
  Package ca-certificates-java is not configured yet.

dpkg: error processing package openjdk-11-jre-headless:arm64 (--configure):
dependency problems - leaving unconfigured
Setting up scilab-minimal-bin (6.1.0+dfsg1-1ubuntu3) ...
Setting up libgtksourceview-3.0-1:arm64 (3.24.11-2) ...
Setting up humanity-icon-theme (0.6.15) ...
Setting up scilab-cli (6.1.0+dfsg1-1ubuntu3) ...
Setting up mousepad (0.4.2-1) ...
Setting up firefox (86.0+build3-0ubuntu0.20.04.1) ...
update-alternatives: using /usr/bin/firefox to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/firefox to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
Please restart all running instances of firefox, or you will experience problems.
Setting up ubuntu-mono (19.04-0ubuntu3) ...
Processing triggers for systemd (245.4-4ubuntu3.4) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for ca-certificates (20210119~20.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

the keytool command requires a mounted proc fs (/proc).
E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
done.
Processing triggers for libgdk-pixbuf2.0-0:arm64 (2.40.0+dfsg-3ubuntu0.2) ...
Errors were encountered while processing:
ca-certificates-java
openjdk-11-jre-headless:arm64
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@sneu80484-vm-ubuntu-20:/# exit


I am running this on VM. How can that be fixed, please?
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 09, 2021, 02:45:42 PM
Hi,
mkubuntu_bionic_beaver.sh
is not content of any of our 2020.2 designs.

ubuntu desktop was only tested with the 19.2 demo design and petalinux 2019.2 (which use other linux kernel) where you has used it.

Something goes wrong when the scripts try to install libgdk-pixbuf2.0-0:arm64 for the file system.

Sorry I can't help you to bring it up this  for another version at the moment. We put all our sources to the given demo designs.
br
John
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 09, 2021, 02:48:55 PM
Hello John,

when will the new version be available?

If I go back on version 2019.2 and 18.04.2 will you support me to bring this up? I switched to the new version because I had problems with the older version.
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 09, 2021, 03:01:11 PM
Hi,
until now you didn't toll me which board you use and also not which design you try to bring up.

We have a wiki description for every design and also prebuilt binaries.

So please tell me which design you use, which Hardware and which part of the description did not work like expected.

br
John
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 09, 2021, 03:13:51 PM
right, sorry.

I have the 821 FPGA module and I have the 701 board. 4x5 Carrier.
What we have done is modified the Petalinux in a way that it only allocates half a gb on the OS. We are using the Petalinux image.ub and the system.dtb file from the petalinux-build.

The ubuntu system we downloaded from your website and it works absolutely fine. But we can't compile driver code because the /lib/modules/$(uname -r)/build is missing. I looked everywhere and I tried every command but I can't make this folder.

Does this answer your questions?
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 10, 2021, 08:13:10 AM
Hi,
this is normally a question for Xilinx forum and Xilinx support.

What you search for is this one:
https://wiki.trenz-electronic.de/display/PD/TE0820+HDMI701#TE0820HDMI701-KeyFeatures

TE0820 modules are similar to TE0821. That's the only reason why you ubuntu binaries from or download works more or less  with your TE0821 module.

What you can try is following:

1 download 19.2 TE0820 HDMI701 demo design
2.download 19.2 TE0821 test board design
3. copy TE0821 test_borad/board_files/* into the TE0820 HDMi701/board_files/* folder
4 remove HDMO701/board_files/TE0820_board_files.csv and TE0820* board files. --> Important: Keep /board_files/preset_extension in the design, do not delete this
5. create the project with your selected TE0821 assembly variant
6. Follow  TE0820 HDMi701 Wiki instruction to regenerate all files by yourself

Sorry I can't help more at the moment.
br
John



Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 11, 2021, 10:32:45 AM
Hello John,

thank you for your set of instructions. But I am afraid I am still running into some errors.

I had to do some minor changes to the script file to make it run but in the end the image it produces doesn't work.

In the log I see these messages/errors:


var/backups/
var/local/
var/opt/
./os/petalinux/mkubuntu_BionicBeaver.sh: line 128: cd: ./build/tmp/deploy/images/plnx-zynqmp/: No such file or directory
./os/petalinux/mkubuntu_BionicBeaver.sh: line 132: ../petalinux-user-image-plnx-zynqmp.cpio: No such file or directory
cp: cannot stat 'lib/modules/4.19.0-xilinx-v2019.2/': No such file or directory
'./block_design' -> '/tmp/ROOT/lib/modules/./block_design'
'./block_design/zusys_bd.tcl' -> '/tmp/ROOT/lib/modules/./block_design/zusys_bd.tcl'
'./board_files' -> '/tmp/ROOT/lib/modules/./board_files'
'./board_files/preset_extension' -> '/tmp/ROOT/lib/modules/./board_files/preset_extension'
'./board_files/preset_extension/hdmi701_preset.tcl' -> '/tmp/ROOT/lib/modules/./board_files/preset_extension/hdmi701_preset.tcl'


There seem to be some files missing where can I find the missing files or what script do I run to create/download the files?

Regards
Anns
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 11, 2021, 11:49:48 AM
Hi,
you use petalinux 19.2 with the default kernel?
you has build the petalinux project before you has start the provide ubuntu script?

br
John
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 11, 2021, 11:52:46 AM
Hello John,

yes I am using 2019.2 of petalinux. I have built the image.ub with that.
I added that image.ub into the folder images/linux/ to run the mkubuntu_..sh

br
Anns
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 11, 2021, 01:00:42 PM
QuoteI added that image.ub into the folder images/linux/
I do not understand,  you mean it was generate there after you has used petalinux-build command? And you use also our provided petalinux template?

Your error message say there is some folder missing: ./build/tmp/deploy/images/plnx-zynqmp/
This is a temporary folder which will be normally generated by the build process. Is this folder there on your place?

br
John
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 11, 2021, 01:06:40 PM
Hello John,

I have been cheating a bit. We are running the design on a server where I don't have sudo access. I used a different linux system where I moved all the design files to build this image.

Ok that means this will not work. Thank you John I will see what I can do to fix this.

Regards
Anns
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 11, 2021, 01:11:02 PM
Hi,

QuoteI have been cheating a bit
Ok. :-)

Do not try this if you do not know what the effects will be. Your Vivado project, XSA export to Vitis and petalinux, ---> fsbl, uboot...linux all work together and even small changes can cause it to stop working.


br
John
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: ainam. on March 11, 2021, 01:17:05 PM
Yes thank you John,

two last questions, please. What folder structure would you suggest, where is what?

Also how do you stop from the tmp folders to be removed after the build script is finished?

Anns
Title: Re: Petalinux Header Files 5.4.0-xilinx-v2020.2
Post by: JH on March 12, 2021, 06:09:54 AM

Quotetwo last questions, please. What folder structure would you suggest, where is what?
for our project delivery:
https://wiki.trenz-electronic.de/display/PD/Project+Delivery+-+Xilinx+devices#ProjectDeliveryXilinxdevices-Directorystructure
for petalinux itself (19.2):
https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetalinuxConfiguration
see also petalinux user guide from Xilinx for whole project structure

QuoteAlso how do you stop from the tmp folders to be removed after the build script is finished?
"/build/tmp/" is related to the petalinux build process, you must check Xilinx documentation and maybe ask on Xilinx forum

"mkubuntu_..sh" from our project delivery is an extended script which generated ubuntu file system as image from the petalinux project and ubuntu sources from www.  You can open it with text editior and check what you must do normally step by step.

br
John