# Setting up the Board and Application Deployment ## Introduction This document shows how to set up the board and run the Built-In Self Test (BIST) application. This guide and its prebuilts are targeted for Ubuntu 24.04 and AMD 2024.1 toolchain. ## Revision History ### Version - v1.2 Refreshed app for Ubuntu 24.04 compatibility with updates across test files and documentation. #### Change Log Test Updates: * Ethernet: Refined interface detection logic to ensure correct enumeration of interfaces. * CAN: Updated python-can usage to align with the latest API and remove deprecated parameters. * Display & PWM: Standardized timeout handling by replacing inputimeout with timeout_handler. * GPIO: Addressed a corner case in 1wire_brake_ctrl to ensure correct test passes. * TTY: Adjusted pymodbus imports and parameters for compatibility with Ubuntu 24.04. * Common: Introduced timeout_handler.py for consistent user input timeout management across tests. Documentation: * Updated for compatibility with Ubuntu 24.04. * Added known issues specific to Ubuntu 24.04. ### Version - v1.1 Added additional support for KD240 starter kit on Ubuntu 22.04. ### Version - v1.0 Initial release on Ubuntu 22.04 with support for KV260 and KR260 starter kits. ## Set up the Host Machine ***Note***: Setting up the host machine is only required to test the ethernet and SFP+ interfaces. If this is skipped, the tests for these interfaces fail. * Install the NIC card into the host machine. * The host machine can be assigned an IP in two ways: * DHCP IP Assignment * Static IP Assignment * Configure the host machine to have a DHCP/Static IP and set the `BIST_REMOTE_HOST_IP` environment variable on the AMD Kria ™ board. Example: ``` export BIST_REMOTE_HOST_IP= ``` * Install iperf3. * For Ubuntu, use the following command: ``` sudo apt install iperf3 ``` * For Windows, use the appropriate download link from [this page](https://iperf.fr/iperf-download.php). * Start an iperf3 server on the host machine using the following command: ``` iperf3 -s -p 5201 ``` ## Set up the Board Supported Starter Kits The BIST application requires the following hardware setup to run the full suite of hardware tests. See the board specific pages: 1. [KV260 Board Setup](setup_kv260.md) 2. [KR260 Board Setup](setup_kr260.md) 2. [KD240 Board Setup](setup_kd240.md) ## Tested Artifacts Testing was performed with the following artifacts: ### KD240 platform artifacts | Component | Version | |--------------------------|----------------------| | Boot Fiwmare | K24-BootFW-01.04.bin | | Linux Kernel | 6.8.0-1015 | | xlnx-firmware-kd240-bist | 1.0-0xlnx1 | ### KR260 platform artifacts | Component | Version | |--------------------------|------------------------| | Boot Firmware | K26-BootFW-01.04.bin | | Linux Kernel | 6.8.0-1015 | | xlnx-firmware-kr260-bist | 1.0.1-0xlnx1 | ### KV260 platform artifacts | Component | Version | |--------------------------|----------------------| | Boot Firmware | K26-BootFW-01.04.bin | | Linux Kernel | 6.8.0-1015 | | xlnx-firmware-kv260-bist | 1.0-0xlnx1 | Please refer to the [Kria Wiki](https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/3020685316/Kria+SOM+Boot+Firmware+Update#K26-Boot-Firmware-Updates) to obtain latest linux image and boot firmware. ### Application docker image | Docker Image | Version | |---------------------------|--------------------- | | xilinx/kria-bist | 1.2-noble-24.04 | ## Boot Linux Before continuing with the BIST application specific instructions, if not yet done so, boot Linux with instructions from: 1. [Kria Starter Kit Linux Boot on KV260](https://xilinx.github.io/kria-apps-docs/kv260/2022.1/build/html/docs/linux_boot.html) 2. [Kria Starter Kit Linux Boot on KR260](https://xilinx.github.io/kria-apps-docs/kr260/build/html/docs/linux_boot.html) 3. [Kria Starter Kit Linux Boot on KD240](https://xilinx.github.io/kria-apps-docs/kd240/linux_boot.html) ## Download and Load the BIST PL Firmware * Install firmware binaries. ```bash sudo apt install xlnx-firmware-kv260-bist // For kv260-bist sudo apt install xlnx-firmware-kr260-bist // For kr260-bist sudo apt install xlnx-firmware-kd240-bist // For kd240-bist ``` * List the installed the application firmware binaries. The firmware consists of bitstream, device tree overlay (dtbo) file. The firmware is loaded dynamically on user request once Linux is fully booted. The xmutil utility can be used for that purpose. After installing the FW, execute xmutil listapps to verify that it is captured under the listapps function, and to have dfx-mgrd, re-scan and register all accelerators in the firmware directory tree. ```bash sudo xmutil listapps ``` * Load a new application firmware binary. When there is already another accelerator/firmware being activated, unload it first, then load the desired BIST firmware. ```bash sudo xmutil unloadapp sudo xmutil loadapp kv260-bist // For kv260-bist sudo xmutil loadapp kr260-bist // For kr260-bist sudo xmutil loadapp kd240-bist // For kd240-bist ``` ## Setup SSH with X-forwarding **NOTE**: Setting up an SSH connection is only required to test the ximagesink tests of the video module on KV260 board. If this is skipped, those tests will fail * To run the bist test suite, the test instructions should run over an SSH connection with X-forwarding enabled. Examples: * On Host, run: ```bash ssh -X ubuntu@ ``` **NOTE**: If all ethernet cables are plugged in, feel free to use any IP. * On Windows, download [Mobaxterm](https://mobaxterm.mobatek.net/download.html), which automatically enables X-forwarding when creating a new ssh connection. ## Miscellaneous Preparation * Verify if the SSH terminal is using the correct authority file. * The output should look something like this. ```bash xauth -v list Using authority file /home/ubuntu/.Xauthority kria/unix:10 MIT-MAGIC-COOKIE-1 f5212118305f75678a69daa4a6eda703 ``` * If incorrect or no authority file is present, do the following steps: ```bash rm -rf ~/.Xaut* ``` * Reboot the target board. ```bash sudo reboot ``` * Check the `xauth -v list` after reboot(in SSH terminal), it should display the correct authority file on the output console. * The BIST application tests the fan. Therefore, if a fan is present stop the fancontrol service before running the docker for the testing to function as intended. ```bash sudo systemctl stop fancontrol ``` * On KV260/KR260 disable desktop environment before running the docker for the display testing to function as intended. On KD240 this step can be skipped as we are using a headless Ubuntu Server image. * Check if default target is set to `graphical.target` ```bash sudo systemctl get-default ``` * If above command returns `graphical.target`, set default target to multi-user. This step is to ensure that by default we always start without Ubuntu display manager. ```bash sudo systemctl set-default multi-user.target ``` * Reboot the system for the change to take effect. ```bash sudo reboot ``` * Remember to start the fancontrol service after exiting the docker container. ```bash sudo systemctl start fancontrol ``` * After running the application and exiting the docker container, the Ubuntu desktop environment can be enabled again. * Set default target to graphical. This step is to ensure that by default we always start with an Ubuntu display manager. ```bash sudo systemctl set-default graphical.target ``` * Reboot the system for the change to take effect. ```bash sudo reboot ``` ## Download and Run the BIST Docker Image * Pull the docker image from dockerhub. ```bash docker pull xilinx/kria-bist:1.2-noble-24.04 ``` * The storage volume on the SD card can be limited with multiple docker images installed. If there are space issues, use the following command to remove existing docker images. ```bash docker rmi --force ``` * You can find the images installed with the following command: ```bash docker images ``` * Launch the docker container using the following command: ```bash docker run \ --env=DISPLAY \ --env=XDG_SESSION_TYPE \ --net=host \ --privileged \ --volume=/home/ubuntu/.Xauthority:/root/.Xauthority:rw \ -v /tmp:/tmp \ -v /dev:/dev \ -v /sys:/sys \ -v /etc/vart.conf:/etc/vart.conf \ -v /lib/firmware/xilinx:/lib/firmware/xilinx \ -v /run:/run \ -it xilinx/kria-bist:1.2-noble-24.04 bash ``` * It launches the bist image in a new container and drops the user into a bash shell. ``` root@xlnx-docker/# ``` ## Setup IP addresses on the Kria board * Set the `BIST_REMOTE_HOST_IP` environment variable on Kria board Example: ``` export BIST_REMOTE_HOST_IP= ``` * You can assign IP addresses in two ways: * DHCP IP Assignment - IP addresses are auto-assigned. * Static IP Assignment - You need to set a Static IP for the eth interfaces under test. Make sure that the Static IPs are in the same subnet as the remote host machine. ## Run the BIST Application The application is installed under `/opt/xilinx/kria-bist`. Navigate to the "tests" directory from where the BIST tests are to be run. ```bash cd /opt/xilinx/kria-bist/tests ``` ### Usage Commonly used command line switches for BIST. ```bash pytest-3 [OPTIONS] OPTIONS: --collect-only Collect the tests --board Specify target board -k Run an individual test -m Specify module name ``` ### Output and Logs The pytest command line output has two separate sessions as follows: * Test session It displays the number of collected, deselected, and selected tests. Current running test is also shown. For example: ```bash ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0 rootdir: /opt/xilinx/kria-bist/tests configfile: pytest.ini collected 34 items / 33 deselected / 1 selected gpio/test_bist_gpio.py::test_gpio[pmod0] ``` * Live Log call This displays the current status of the test. 1. Start of test: Indicates that the test has started. 2. Test observations: Prints the test observation on the command line. 3. Test passed/failed: Declares the test result, that is, pass/fail. 4. End of Test: Indicates that the test has ended. For example: ```bash -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test Write pattern: 0001, Read pattern 0001 : Match Write pattern: 0010, Read pattern 0010 : Match Write pattern: 0100, Read pattern 0100 : Match Write pattern: 1000, Read pattern 1000 : Match Test passed End of test PASSED [100%] ======================= 1 passed, 33 deselected in 1.02s ======================= ``` * A log file (`kria_bist_pytest.log`) is created in the current directory. ### Examples * Run the entire BIST test suite for a target board. ```bash pytest-3 --board kv260 // For KV260 pytest-3 --board kr260 // For KR260 pytest-3 --board kd240 // For KD240 ``` * Run individual tests. The following example runs the pmod0 test on the KV260 as target board. ```bash pytest-3 -k pmod0 --board kv260 ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0 rootdir: /opt/xilinx/kria-bist/tests configfile: pytest.ini collected 34 items / 33 deselected / 1 selected gpio/test_bist_gpio.py::test_gpio[pmod0] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test Write pattern: 0001, Read pattern 0001 : Match Write pattern: 0010, Read pattern 0010 : Match Write pattern: 0100, Read pattern 0100 : Match Write pattern: 1000, Read pattern 1000 : Match Test passed End of test PASSED [100%] ======================= 1 passed, 33 deselected in 1.01s ======================= ``` * Collect test cases. Collect all the tests for a target board. ```bash pytest-3 --collect-only --board kv260 ========================== test session starts =============================== platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0 rootdir: /opt/xilinx/kria-bist/tests configfile: pytest.ini collected 40 items ====================== 40 tests collected in 1.02s =========================== ``` * Collect all tests for a specific testmodule for a target board. ```bash pytest-3 --collect-only --board kv260 -m video ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0 rootdir: /opt/xilinx/kria-bist/tests configfile: pytest.ini collected 34 items / 26 deselected / 8 selected ================ 8/34 tests collected (26 deselected) in 0.99s ================= ``` * Run all tests for a target board and the module. ```bash pytest-3 --board kv260 -m video ============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-7.4.4, pluggy-1.4.0 rootdir: /opt/xilinx/kria-bist/tests configfile: pytest.ini collected 34 items / 26 deselected / 8 selected video/test_bist_video.py::test_video[ar1335_ap1302_ximagesink] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test Please observe the pop-up window Do you see color bar test pattern in the window [Y/N]? ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds y User reports that pattern was observed in the window Test passed End of test PASSED video/test_bist_video.py::test_video[ar1335_ap1302_perf] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds Actual fps: 30.0, Target fps:30 - Actual fps within accepted range Test passed End of test PASSED video/test_bist_video.py::test_video[tpg_ap1302_ximagesink] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test Please observe the pop-up window Do you see color bar test pattern in the window [Y/N]? ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds y User reports that pattern was observed in the window Test passed End of test PASSED video/test_bist_video.py::test_video[tpg_ap1302_perf] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds Actual fps: 30.003, Target fps:30 - Actual fps within accepted range Test passed End of test PASSED video/test_bist_video.py::test_video[imx219_filesink] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds (gst-launch-1.0:89): GStreamer-CRITICAL **: 21:29:17.009: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed (gst-launch-1.0:89): GStreamer-CRITICAL **: 21:29:17.009: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed (gst-launch-1.0:89): GStreamer-CRITICAL **: 21:29:17.010: gst_structure_fixate_field_nearest_fraction: assertion 'IS_MUTABLE (structure)' failed Test Image and Golden Image match Test passed End of test PASSED video/test_bist_video.py::test_video[imx219_perf] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds Actual fps: 30.004, Target fps:30 - Actual fps within accepted range Test passed End of test PASSED video/test_bist_video.py::test_video[ar1335_filesink] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds (gst-launch-1.0:89): GStreamer-CRITICAL **: 21:29:17.009: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed (gst-launch-1.0:89): GStreamer-CRITICAL **: 21:29:17.009: gst_structure_fixate_field_nearest_int: assertion 'IS_MUTABLE (structure)' failed (gst-launch-1.0:89): GStreamer-CRITICAL **: 21:29:17.010: gst_structure_fixate_field_nearest_fraction: assertion 'IS_MUTABLE (structure)' failed Test Image and Golden Image match Test passed End of test PASSED video/test_bist_video.py::test_video[ar1335_perf] -------------------------------- live log call --------------------------------- ------------------------------------------ Start of test ** (gst-launch-1.0:23): CRITICAL **: 18:29:06.145: Unsupported property type GstParamArray for property crop-bounds Actual fps: 30.004, Target fps:30 - Actual fps within accepted range Test passed End of test PASSED [100%] ==================== 8 passed, 26 deselected in 42.11s ======================= ``` ## Next Steps * [BIST Overview](./overview)

Copyright © 2025 Advanced Micro Devices, Inc

Terms and Conditions