At Kria-app docs, there is tutorial for Kria-BIST, BIST means for Built-In Self Test. BIST applications is targeted to test/check most or all interfaces on the Kria starter kit. Kria BIST is available for Kria-Ubuntu and for all three boards, but here in this tutorial we will check on “how to use BIST” for testing/checking the interfaces in Kria-Petalinux.
All the BIST test applications are here: https://github.com/Xilinx/kria-bist/tree/main/tests, it consists of test scripts for CAN, DISK, Ethernet, GPIO, I2C, SPI etc.
In this tutorial we will just bring up few interfaces only in Kria-Petalinux. If you want to test most or all interfaces on Kria Starter kit then you have to enable the corresponding package in petalinux-project or do dnf for installing after bootup. The prerequisites of Kria-BIST is are listed here: https://github.com/Xilinx/kria-bist/tree/main
We can find following information for BIST Application for Kria boards:
- BIST Home Page for Kria: xilinx.github.io/kria-apps-docs/kd240/build/html/docs/bist/docs/run.html
- KD240 BIST Home Page: xilinx.github.io/kria-apps-docs/kd240/build/html/docs/bist/bist_landing.html
- KD240 BIST Firmware (Hardware Overlay): https://github.com/Xilinx/kria-apps-firmware/tree/main/boards/kd240/bist
- KD240 BIST Application: https://github.com/Xilinx/kria-bist/tree/main
- Recreating KD240 BIST firmware: https://github.com/Xilinx/kria-vitis-platforms/tree/main/kd240/platforms/vivado/kd240_bist
In this tutorial we are going to use Petalinux 2023.1 version to test few of BIST application on KD240 (based on k24 SoM). The BIST app for KD240 is released for Kria-Ubuntu(22.04 LTS), while many engineers like to have BIST hardware app in their petalinux development so we created this tutorial.
This tutorial will also be applicable for other Kria Boards, KR260 and KV260. The custom carrier board based on K26 and K24 can also refer this tutorial for bringing up the Kria-BIST app.C. Creating Petalinux Project
1. Download Petalinux 2023.1 BSP
2. Create Petalinux Project from BSP:
petalinux-create -t project -s ./xilinx-kd240-starterkit-v2023.2-10140544.bsp -n kd240-2023_1-defaultHere "kd240-2023_1-default" is the petalinux project workspace directory.
cd kd240-2023_1-default3. Next configure the petalinux project and include necessary required packages for "BIST" test.
petalinux-config4. Now run the Rootfs config,
petalinux-config -c rootfsPackage needs to be included at petalinux “rootfs config” for the BIST Test:
· build-essential
· i2c-tools
· gstreamer
· git
· cmake5. Further additional packages to be included for BIST test are added in /project-spec/meta-user/conf/petalinuxbsp.conf:
· python3-pytest python3-periphery python3-can python3-pymodbus
· cmake6. Run the Petalinux Build Command:
petalinux-build7. Create SD Card Image:
Creating SD card image: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/1641152513/Kria+SOMs+Starter+Kits
KD240 ( 2023.1 only) :
petalinux-package --wic --images-dir images/linux/ --bootfiles "ramdisk.cpio.gz.u-boot,boot.scr,Image,system.dtb,system-zynqmp-sck-kd-g-revA.dtb" --disk-name "sda"8. Now burn the SD card with Balena Etcher, setup the KD240 connection and boot the SD Card. You have to have GPIO, Ethernet, SPI, I2C connections or devices plugged in with KD240 for testing. Not all devices is needed at once, you can connect the necessary devices for your own test only.
D. Getting bist test application to Kria KD240 boardGet the pytest application from bist from github:
git clone https://github.com/Xilinx/kria-bist.gitE. Install the firmware overlay for bist:Get the bist firmware from the kria-app-firmware git repo:https://github.com/Xilinx/kria-apps-firmware/tree/main/boards/kd240/bist
Next compile the dtsi to dtbo using device tree compiler:
dtc -@ -O dtb -o pl.dtbo kd240-bist.dtsiAfter getting *.dtbo, you can rename .bitinto *.bit.bin and copy dtbo, bit.bin and also shell.json [create shell.json yourself or download from here] files at KD240 board.
For xmutil to detect the hardware overlay, move the above files to /lib/firmware/xilinx folder by creating the kd240-bist folder.
cd /lib/firmware/xilinx
sudo mkdir kd240-bist
sudo mv <*.dtbo, *.bit.bin, shell.json> ./Now check the available firmware using xmutil tool:
Now load the firmware using xmutil tool:
sudo xmutil loadapp kd240-bistGet the bist test application from: https://github.com/Xilinx/kria-bist/tree/mainNext for running the pytest, go to the individual test folder.Here we are looking for GPIO test, so run following for listing the tests:
pytest --collect-only --board kd240Next run the test by running following command:
sudo pytest --board kd240 -m gpioAs like above you can also test (we have run the test andthetest passed):
· gpio
· disk
· i2c
· mtd
· tpmAlso, due to connection setup, some of the BIST test got failed on our KD240.
Kudos to Sanam@LogicTronix.com for creating this Tutorial!
For any queries around FPGA Design, Machine Learning Acceleration and Kria SoMs development, please contact us at info@logictronix.com.
LogicTronix is AMD-Xilinx Partner for FPGA Design and Machine Learning Acceleration!







Comments