Skip to main content

TI Starter Kit EVM Board TEVS Camera Usage Guide

πŸš€ Introduction​

This article guides you how to get started using TechNexion camera modules on Ti starter kit.


πŸ“Έ Supported Camera Modules​

Camera SeriesProducts
TEVS
TEVS-AR0144
TEVS-AR0145
TEVS-AR0234
TEVS-AR0521
TEVS-AR0522
TEVS-AR0821
TEVS-AR0822
TEVS-AR1335
More Camera Products Details

Check here ! πŸ”— TechNexion Embedded Vision Solutions
Find out the solution which can accelerate your time to market for embedded vision projects.

Ti Processor SDK version

TechNexion is using ti-processor-sdk-linux with 09.01.00.0X (Dec 2023), if you need to support other versions, you can grab the source codes from πŸ”— GitHub – TechNexion TI EVK camera driver and build it by yourself.


🧩 Supported Ti Developer Kit​

SoMBoard
AM62xTi SK-AM62X starter kit for Sitaraβ„’ processors
AM62ATi SK-AM62A-LP starter kit for low-power
TDA4VMTi SK-TDA4VM starter kit for edge AI vision systems

πŸ”§ Hardware Setup Instructions​

1. Connect the Adapter Board and Camera Cable​

With different board you need prepare match adapter board and cable for the connect pins.
Here is the table for you can easily to confirm what you need for your solution.

Developer KitAdapter boardCamera Kit
Ti SK-AM62TEV-RPI15 AdaptorTechNexion EVK RPI15
Ti SK-AM62A-LPTEV-RPI22 AdaptorTechNexion EVK RPI22
Ti SK-TDA4VMTEV-RPI15 AdaptorTechNexion EVK RPI15

Follow this demo video to connect adapter and cable to the CSI connector on board.


🧰 Camera Installation Instructions​

Method 1 - Using TechNexion Pre-built image​

Prepare Yocto demo image for testing TechNexion camera​

To test TechNexion TEVS Series cameras, you need a demo image that includes the required Device Tree Blobs (DTBs) and camera drivers.

Download and Select the Correct Image for Your EVK​

Prebuilt demo images can be available for download via TechNexion's server.

πŸ”— SK-AM62X Image Download Link
πŸ”— SK-AM62A-LP Image Download Link
πŸ”— SK-TDA4VM Image Download Link

Flashing the Image​

You can flash the image to an SD Card using the following methods.

Micro-SD Card

The capacity must be higher 16GB.

Use balenaEtcher to write the image to your SD card:

πŸ”—


Method 2 - Build custom Linux kernel with camera driver​

  1. Download the camera driver and device tree blobs.​

    $ git clone git@github.com:TechNexion-Vision/tn-ti_6.1.46_09.01.00.006.git
    $ cd ti_evk_camera/
    ~/ti_evk_camera$ git checkout tn-ti_6.1.46_09.01.00.006
  2. Copy to your kernel source code.​

    ~/ti_evk_camera$ mv -r driver/media/i2c/tevs/ <fetch_kernel_folder>/driver/media/i2c/
    ~/ti_evk_camera$ mv arch/arm64/boot/dts/ti/k3-j721e-sk-tevs.dtso <fetch_kernel_folder>/arch/arm64/boot/dts/ti/
  3. Modify makefile to add driver​

    $ cd <fetch_kernel_folder>/driver/media/i2c/
    ~/<fetch_kernel_folder>/driver/media/i2c/$ vi Makefile

    Add this line in Makefile.

    obj-$(CONFIG_VIDEO_TEVS) += tevs/

    Modify Kconfig to add camera config

    ~/<fetch_kernel_folder>/driver/media/i2c/$ vi Kconfig

    Add this part under "Camera sensor devices" menu in Kconfig.

    config VIDEO_TEVS
    tristate "TechNexion TEVS sensor support"
    depends on OF
    depends on GPIOLIB && VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API
    depends on MEDIA_CAMERA_SUPPORT
    default y
    select V4L2_FWNODE
    help
    This is a Video4Linux2 sensor driver for the TechNexion
    TEVS camera sensor with a MIPI CSI-2 interface.
  4. Modify makefile to add device tree.​

    $ cd <fetch_kernel_folder>/arch/arm64/boot/dts/ti/
    ~/<fetch_kernel_folder>/arch/arm64/boot/dts/ti/$ vi Makefile

    Add this line in Makefile.

    #For SK-AM62X
    dtb-$(CONFIG_ARCH_K3) += k3-am625-sk-csi2-tevs.dtbo
    #For SK-AM62A
    dtb-$(CONFIG_ARCH_K3) += k3-am62a7-sk-csi2-tevs.dtbo
    #For SK-TDA4VM
    dtb-$(CONFIG_ARCH_K3) += k3-j721e-sk-tevs.dtbo
  5. Compile the kernel & module driver​

    Finally you can start compile your new Image files, then copy and replace the Image files and add camera dtb overlay file in the SD card.


πŸ“Έ Camera Testing Instructions​

Specify Camera DTBO in uEnv.txt​

  1. Find uEnv.txt file in prebuild image.
# Open on SK-TDA4VM, the directory should be here:
$ /run/media/BOOT-mmcblk1p1/uEnv.txt
# Open on HOST-PC, the directory should be here:
$ /media/username/BOOT/uEnv.txt
  1. Add camera dtb specifies the name_overlays variable in uEnv.txt.
#SK-AM62X
name_overlays= k3-am625-sk-csi2-tevs.dtbo
#SK-AM62A
name_overlays= k3-am62a7-sk-csi2-tevs.dtbo
#SK-TDA4VM
name_overlays= k3-j721e-sk-tevs.dtbo

πŸŽ₯ Start Camera Video Stream via GStreamer​

Check Camera Availability​

Use the v4l2-ctl tool to list connected video devices.

$ v4l2-ctl --list-device

Example output:

# CSI 0 (cam1)
j721e-csi2rx (platform:4504000.ticsi2rx):
/dev/video{X}
# CSI 1 (cam2)
j721e-csi2rx (platform:4510000.ticsi2rx):
/dev/video{X}

Launch GStreamer Pipeline​

The following is example.

Specify the capture device you just get /dev/video2 and start gstreamer to get video stream with 640x480 resolution on the display :

$ gst-launch-1.0 v4l2src device=/dev/video2 ! \
video/x-raw,width=640,height=480 ! \
waylandsink sync=false

🚨 Troubleshooting​

Usecase

Take TEVS-AR0234 on SK-TDA4VM CAM2 connector for example.

Cannot Run Edge AI Demo Application

The pre-built image is based on TI's setup, so the default demo application does not support TechNexion cameras. To use TechNexion cameras, you can disable the demo service and launch the Weston desktop manually.

$ systemctl disable edgeai-init.service
$ systemctl restart weston
$ reboot

Find out the Camera​

Boot up SK-TDA4VM and check initialization of camera driver. it shows below messages, the driver is initialized correctly. If the drivers haven't been probed, please check the connector plugin correct.

$ dmesg -t | grep tevs

The message similar to the following :

root@tda4vm-sk:/opt/edgeai-gst-apps# dmesg|grep tevs
tevs 7-0048: tevs_probe() device node: tevs@48
tevs 7-0048: Version:24.8.0.1
tevs 7-0048: Product:TEVS-AR0234, HeaderVer:3, MIPI_Rate:800
tevs 7-0048: probe success

And then try to using media-ctl command to print the device topology from camera to CSI and the end to video device node.

$ media-ctl -d /dev/media1 -p

We can get which v4l2-subdev is camera in this print message and then we can use v4l2-ctl by it. image.png


Change Resolution​

For kernel 6.1 architecture you cannot easily change resolution in gsteamer pipeline.
You must need to using v4l2-ctl to view and set the camera's supported resolutions.

1. Check camera supported resolutions via v4l2-ctl​

$ v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesize pad=0
root@tda4vm-sk:/opt/edgeai-gst-apps# v4l2-ctl -d /dev/v4l-subdev2 --list-subdev-framesize pad=0
ioctl: VIDIOC_SUBDEV_ENUM_FRAME_SIZE (pad=0,stream=0)
Size Range: 640x480 - 640x480
Size Range: 1280x720 - 1280x720
Size Range: 1920x1080 - 1920x1080
Size Range: 1920x1200 - 1920x1200

2. Set Format​

$ media-ctl --set-v4l2 "'tevs 7-0048':0 [fmt:UYVY8_2X8/1280X720@1/30 field:none]"