Download the latest PetaLinux from the Xilinx download page: link
Navigate to the downloads folder and install using the executable installer file:
$ cd Downloads
Allow permissions for the installer and run the executable:
$ sudo chmod +x ./petalinux-v2021.1-final-installer.run
$ ./petalinux-v2021.1-final-installer.run -d <install destination>
Download KV260 BSPDownload the KV260 BSP from the Xilinx Downloads page: link
Source the settings.sh file inside of the install directory for PetaLinux:
$ source <install destination>/setting.sh
Create the PetaLinux project from the BSPRun the following command to create the project using the BSP file we downloaded earlier:
$ petalinux-create -t project -s /home/<user>/Downloads/xilinx-k26-starterkit-v2021.1-final.bsp -n kv260_RealSense
Once created step into the folder:
$ cd kv260_RealSense
Set Board VariantSo PetaLinux knows we're using the starter kit we need to set the variable using this command:
$ echo 'BOARD_VARIANT = "kv"' >> project-spec/meta-user/conf/petalinuxbsp.conf
Add build essentials packageFirst we need to bring up the rootfs config console
$ petalinux-config -c rootfs
Once the console has booted up navigate to:
Petalinux Package Groups-->packagegroup-petalinux-self-hosted
Select all 3 packages and exit the console
Fix minor known bugs before buildNavigate to petalinuxbsp.conf
Make sure the your file is identical to the one shown:
Run the following command to run the PetaLinux build process:
$ petalinux-build
Package up the PetaLinux filesCreate the SD card image with this command:
$ petalinux-package --wic --bootfiles "ramdisk.cpio.gz.u-boot boot.scr Image system.dtb"
The generated image file will be located at images/linux/petalinux-sdimage.wic.
You can now use disk to flash your micro SD card:
Make sure that you increase the size of root to run store librealsense.
Booting the KV260 BoardConnect the board to your computer using serial.
Using the login: Petalinux, the first time you will be asked to create a new password, once this is done the shell will start
use the following command to install missing librarie:
$ sudo dnf install libxinerama-dev
Installing LibrealsenseIn the root clone the librealsense git repository:
$ git clone https://github.com/IntelRealSense/librealsense
next install udev rules:
$ sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
$ sudo udevadm control --reload-rules && udevadm trigger
Create build folder:
$ mkdir build
$ cd build
Run Cmake from the build folder
$ cmake ..
Next run Make to start compiling librealsense:
$ make
Once compiled, install librealsense:
$ make install
Running a RealSense Camera:Export the LD_LIBRARY_PATH to access the compiled RealSense Libraries:
$ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib64/"
Now plug in and test your camera works using rs-enumerate-devices:
Success!
Comments