This PetaLinux project is to build and put together:
- the Linux kernel
- the root file system (rootfs)
- the programs (colorbars, sdr-app, wsjtx, jt9 etc) to run the main "EBAZ4205 SDR and Spectrum" project
Of course you need to have:
- PetaLinux 2022.2 installed on Ubuntu 20.04 LTS or
- PetaLinux 2023.1 on Ubuntu 22.04 LTS
-
Git or download/unzip this folder to your PC in a directory of your choice
-
cd to the PetaLinux folder
cd /home/guido/Github/EBAZ4205_SDR_spectrum/PetaLinux/
- source PetaLinux there, so that the petalinux command can be launched
source /tools/Xilinx/PetaLinux/2022.2/bin/settings.sh
- Specify the directory where you exported the XSA file (hardware description) by Vivado
petalinux-config --get-hw-description=/home/guido/Github/EBAZ4205_SDR_spectrum/Vivado
- Build the project. The very first time it will take a lot of time (more than one hour on my Intel i9 12900H 32GB RAM vs 5 minutes in case of rebuilding after a Vivado hardware modification)
petalinux-build
- Create the files composing the image (BOOT.bin system.dtb uImage ...) to be flashed on the SD card. You'll find all these files in PetaLinux/images/linux
petalinux-package --boot --force --fsbl ./images/linux/zynq_fsbl.elf --fpga ./project-spec/hw-description/ebaz4205_wrapper.bit --u-boot
- Create the wic file (SD card image) in ...PetaLinux/images/linux/petalinux-sdimage.wic
petalinux-package --wic
- Flash the file on an SD card (>= 8 GB) using Balena-Etcher
- Insert the SD card in the EBAZ4205 slot
- Connect any kind of tty terminal set at 115200,8,n,1 to the serial port of EBAZ4205
- Power on
After a few seconds, you should see the PetaLinux boot sequence.
If you want to build Linux applications for PetaLinux using your host PC (with Ubuntu) you need a sysroot. In fact Qt Creator installed on Ubuntu can build applications for the PetaLinux version installed in the Zynq7010 of your EBAZ4205 but, to do this, it needs a special compiler and linker which, running on Ubuntu, can build Cortex A9 32 bits executables for PetaLinux, using the proper shared libraries and their include files.
- cd to the PetaLinux folder
cd /home/guido/EBAZ4205_SDR_spectrum/PetaLinux/
- source PetaLinux there, so that the petalinux commands can be launched
source /tools/PetaLinux/2022.2/bin/settings.sh
- Temporarily exclude "openssh-sftp-server" from building (because of a PetaLinux bug, the sysroot cannot be created with it!)
petalinux-config -c rootfs
-
Navigate to "Filesystem Packages → console → network → openssh"
-
Uncheck [ ] openssh-sftp-server
-
exit saving
-
Build the sysroot
petalinux-build -s
At the end, you'll find the SDK installer in ...PetaLinux/images/linux/sdk.sh
- Execute sdk.sh to explode the sysroot
cd to the PetaLinux/images/linux
cd /home/guido/EBAZ4205_SDR_spectrum/PetaLinux/images/linux
- Run sdk.sh. The default destination directory is: /opt/PetaLinux/2022.2/
./sdk.sh
- Revert what you did at step 3 re-including "openssh-sftp-server" in building
petalinux-config -c rootfs
- Navigate to "Filesystem Packages → console → network → openssh"
- Check [X] openssh-sftp-server
- exit saving