Skip to content

alliedvision/alvium-manifest-kv260

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Alvium CSI2 driver for Xilinx Kria KV260 Vision AI Starter Kit

Overview

This repository contains the manifest files for building the Allied Vision Alvium reference image for the Xilinx Kria KV260 Vision AI Starter Kit.

Compatibility

This release is tested with:

  • Xilinx Kria KV260 Vision AI Starter Kit
  • Alvium MIPI CSI-2 cameras with firmware 12

The release is based on the Xilinx Yocto layers 2023.1 and contains the V4L2Viewer 2.2.1. The CSI2 clock frequency is configured to 750000000 Hz.

This release supports v4l2 and GenICam for CSI2 access. For GenICam for CSI2 access, Vimba X 2023-2 is required.

Quick Start

Prerequisites

  • Kria KV260 Vision AI Starter Kit
  • Host PC: Install the requirements as defined in the Yocto Project Reference Manual
  • Alvium camera with Firmware 12
  • SD Card 8 GB

Installation

Tip: For the prebake image, skip steps 1-4 and start with step 5.

To install the driver and layer:

  1. Install the repo tool
    mkdir -p ~/.bin
    export PATH="${HOME}/.bin:${PATH}"
    curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
    chmod a+rx ~/.bin/repo
    echo "export PATH=\"\${HOME}/.bin:\${PATH}\""  >> ~/.bashrc
  2. Initialize project directory
    mkdir -p kv260-yocto
    cd kv260-yocto
    repo init https://github.com/alliedvision/alvium-manifest-kv260
    repo sync
  3. Prepare yocto build
    source setup-avt-release.sh
  4. Build the AVT Image with the command:
    bitbake avs-image-alvium-validation
  5. Flash the image to the SD card. If you have built the image with yocto, you can find the image here: <build_dir>/tmp/deploy/images/k26-smk-kv/avs-image-alvium-validation-k26-smk-kv.wic.bz2
  6. Boot the board.
  7. Check if the camera firmware version is 12 or higher. If the camera has an earlier firmware, perform an update with Vimba X Firmware Updater.

SDK Installation

Tip: For the prebake image, skip step 1 - 2 and start with step 3.

  1. Perform steps 1 - 3 from previous instructions.
  2. Build the SDK installer with the command:
    bitbake avs-image-alvium-validation -c populate_sdk
  3. Install the SDK on your system by running the installer script. If you have built the sdk, you can find it here: <build_dir>/tmp/deploy/sdk/poky-glibc-x86_64-avs-image-alvium-validation-cortexa72-cortexa53-k26-smk-kv-toolchain-4.1.4.sh
  4. If you have installed the sdk to the default location. You can setup the build environment by running:
    source /opt/poky/4.1.4/environment-setup-cortexa72-cortexa53-poky-linux 

Board configuration

Before a camera can be used a bitstream must be loaded into the FPGA part of the ZynqMP. The bitstream must be loaded as root. This is done using the following commands:

    su
    avt-load-bitstream <bitstream name>

The following bitstreams are available:

  • raw8: This bitstream is needed for GenICam for CSI2 streaming. The camera streams in Mono or Bayer format using v4l2.
  • yuv: The camera can stream with YUV422.
  • rgb: The camera can stream with RGB24.

Limitations

General

  • Only one fixed format per bitstream is support
  • Only the port IAS1 on the Allied Vision Adapter Board works

Video4Linux2 compliance

Set following v4l2-compliance test are expected to fail:

  • VIDIOC_QUERY_EXT_CTRL/QUERYMENU
  • VIDIOC_QUERYCTRL
  • VIDIOC_G/S_CTRL
  • VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT
  • VIDIOC_G_FMT
  • VIDIOC_TRY_FMT
  • VIDIOC_S_FMT
  • VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF

Allied Vision V4L2Viewer

  • The V4L2Viewer does not support all formats that the hardware supports.

Vimba X

  • When using the weston terminal, you have to manually set the GenICam TL search environment variable.
    export GENICAM_GENTL64_PATH=<path to VimbaX directory>/cti

Getting started

Video4Linux2

cat /sys/bus/i2c/devices/1-003c/device_temperature

e.g. for Alvium 1500 C-500c on Port IAS1 of kv260:

avt-load-bitstream yuv
v4l2-ctl -d /dev/v4l-subdev2 --set-ctrl exposure=20000000,gain=100,brightness=0 --set-subdev-selection top=0,left=0,width=1920,height=1080
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080,framerate=30/1,io-mode=dmabuf ! waylandsink sync=false -v

Vimba X

To get get your Alvium CSI-2 camera and Vimba X up and running, read: Getting Started with GenICam for CSI-2 and Vimba X

Beta Disclaimer

Please be aware that all code revisions not explicitly listed in the Github Release section are considered a Beta Version.

For Beta Versions, the following applies in addition to the BSD 3-Clause License:

THE SOFTWARE IS PRELIMINARY AND STILL IN TESTING AND VERIFICATION PHASE AND IS PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS AND IS BELIEVED TO CONTAIN DEFECTS. THE PRIMARY PURPOSE OF THIS EARLY ACCESS IS TO OBTAIN FEEDBACK ON PERFORMANCE AND THE IDENTIFICATION OF DEFECTS IN THE SOFTWARE, HARDWARE AND DOCUMENTATION.