Skip to main content

STM32MP257F-EV1 Board TEVS Camera Usage Guide

πŸš€ Introduction​

This article guides you how to get started using TechNexion camera modules on ST STM32MP257F-EV1 board.


πŸ“Έ Supported Camera Modules​

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

🧩 Supported Ti Developer Kit​

SoMBoard
STM32MP257FSTM32MP257F-EV1

πŸ”§ Hardware Setup Instructions​

1. Connect the Adapter Board and Camera Cable​

To set up TechNexion camera, connect the adapter board and camera cable to the MIPI CSI port on the EVK board.

Developer KitAdapter boardCamera Kit
STM32MP257F-EV1TEV-RPI22 AdaptorTechNexion EVK RPI22

2. Connect the STM32MP257F-EV1 Board to the Adapter Board​

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


πŸ’» Driver Installation Instructions​

note

It has been verified with stm32mp25-openstlinux-6.1-yocto-mickledore-mp2-v23.12.06", you can get from here : πŸ”— STM32MP2 OpenSTLinux Developer Package


Method 1 - TechNexion Pre-built Image​

We provide a pre-built image to simplify using TEVS camera. It will autorun a demo script to streaming camera.

πŸ”½ Downloading the Demo Image​

Prebuilt demo images are available for download on TechNexion's official server.

πŸ”— STM32MP257F Image Download Link

πŸ’Ύ Flashing the Image​

1. Install necessary tool.​

$ sudo apt-get update
$ sudo apt-get install -y tar

2. Extract the pre-build image​

$ tar zxvf stm32mp257f-ev1_yocto-6.1_20241224.tar.gz

3. Flash to Micro-SD Card​

Use dd to flash the image to the Micro-SD Card

# ${device} is your device path name, such as "/dev/sdb"
$ umount ${device}?
$ sudo dd if=stm32mp257f-ev1_yocto-6.1_20241224.img \
of=${device} bs=1M status=progress

Method 2 - Build the TEVS driver and device tree patch​

Please refernece πŸ”— How to install the SDK and follow the steps below:

1. Download the camera driver and device tree patch​

$ git clone git@github.com:TechNexion-Vision/stm32mp25-camera-driver.git
$ cd stm32mp25-tevs-driver/
~/stm32mp25-tevs-driver$ git checkout linux-6.1.28

2. Copy driver to your kernel source code​

~/stm32mp25-tevs-driver$ mv -r driver/media/i2c/tevs/ <fatch_kernel_folder>/driver/media/i2c/

3. Apply the device tree patch​

~/stm32mp25-tevs-driver$ patch -d ./linux-6.1.28 -p1 < TechNexion_TEVS_DeviceTree.patch

4. Modify makefile to add driver​

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

Add this line in Makefile.

obj-$(CONFIG_VIDEO_TEVS) += tevs/

Modify Kconfig to add camera config

~/<fatch_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.

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.


πŸ“Έ Instructions for Testing Camera​

Cannot Run Demo Application

The launch demo at start, which is /usr/local/demo/demo_launcher.py and this script is called by /usr/local/weston-start-at-staetup/start_up_demo_launcher.sh.
The pre-built image is based on ST's setup, so the default launch demo application does not support TechNexion cameras. To use TechNexion cameras, you can disable the demo manually.

The TEVS camera are have ISP calebration that can bypass the ST ISP (dcmipp_main_isp).

Camera subsystem setup :​

Setting camera subsystem the by using media control framework.

# set format 1280x720  for example
media-ctl -d /dev/media2 --set-v4l2 "'tevs 0-0048':0 [fmt:UYVY8_2X8/1280x720@1/30 field:none]"

media-ctl -d /dev/media2 --set-v4l2 "'dcmipp_dump_postproc':0 [fmt:UYVY8_2X8/1280x720@1/30 field:none]" -v
media-ctl -d /dev/media2 --set-v4l2 "'dcmipp_dump_postproc':1 [fmt:UYVY8_2X8/1280x720@1/30 field:none]" -v

media-ctl -d /dev/media2 --set-v4l2 "'stm32_csi2host.48020000.csi2hos':0 [fmt:UYVY8_2X8/1280x720@1/30 field:none]"
media-ctl -d /dev/media2 --set-v4l2 "'stm32_csi2host.48020000.csi2hos':1 [fmt:UYVY8_2X8/1280x720@1/30 field:none]"

πŸŽ₯ Start Camera Video Stream via GStreamer​

Launch GStreamer Pipeline​

Specify the capture device you just get (/dev/video2) and start gstreamer to get video stream with 1280x720 on the display :

$ gst-launch-1.0 v4l2src device=/dev/video2 ! \
video/x-raw, format=UYVY, width=1280,height=720, framerate=30/1 ! \
videoconvert ! waylandsink
note

More detail description on πŸ”— STM32MP25 V4L2 camera overview.