Difference between revisions of "VEYE CS Camera on Radxa Boards"
(Created page with "'''<big>How to use VEYE and CS series cameras on Radxa's RK35XX board</big>''' 查看中文 ===Overview=== VEYE series cameras are the v...") |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | '''<big>How to use VEYE | + | '''<big>How to use VEYE series cameras on Radxa's RK35XX board</big>''' |
[[VEYE CS Camera on Radxa Boards/zh|查看中文]] | [[VEYE CS Camera on Radxa Boards/zh|查看中文]] | ||
Line 26: | Line 26: | ||
===Hardware Setup=== | ===Hardware Setup=== | ||
Radxa ZERO 3W provides a 22-pin connector compatible with Raspberry Pi, allowing our camera to be installed on its motherboard without the need for an adapter board. | Radxa ZERO 3W provides a 22-pin connector compatible with Raspberry Pi, allowing our camera to be installed on its motherboard without the need for an adapter board. | ||
− | ====Connection of | + | ====Connection of Camera and Radxa ZERO 3W Board==== |
− | + | ||
− | + | Both use a 15-to-22-pin FFC cable for connection, ensuring that the silver contact surface faces outward. | |
− | + | [[File:VEYE camera connect to Radxa ZERO 3W.jpg|link=http://wiki.veye.cc/index.php/File:VEYE%20camera%20connect%20to%20Radxa%20ZERO%203W.jpg|center|thumb|800x800px|VEYE camera connect to Radxa ZERO 3W]] | |
− | + | <br /> | |
− | |||
− | |||
− | |||
===Introduction to github repositories=== | ===Introduction to github repositories=== | ||
− | + | https://github.com/veyeimaging/rk35xx_radxa | |
includes: | includes: | ||
Line 43: | Line 40: | ||
*application demo | *application demo | ||
− | In addition, a compiled linux kernel installation package | + | In addition, a compiled linux kernel installation package is provided in the [https://github.com/veyeimaging/rk356x_radxa/releases releases]. |
− | + | ===Upgrade Radxa Debain system=== | |
− | + | ====Overview==== | |
− | |||
This section describes how to update the RK35xx system to support our camera modules. | This section describes how to update the RK35xx system to support our camera modules. | ||
− | + | We provide a deb installation package that can be installed directly. | |
− | + | ====Burn Radxa standard system==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Refer to the [https://wiki.t-firefly.com/en/ROC-RK3566-PC/01-bootmode.html Radxa documentation] to burn in a standard system. | Refer to the [https://wiki.t-firefly.com/en/ROC-RK3566-PC/01-bootmode.html Radxa documentation] to burn in a standard system. | ||
− | + | ====Using prebuilt Image and dtb file==== | |
Using the compiled debain installation package | Using the compiled debain installation package | ||
On the RK35xx board, | On the RK35xx board, | ||
− | Download the latest rk356x_Radxa_ubuntu.tar.gz from [https://github.com/veyeimaging/ | + | Download the latest rk356x_Radxa_ubuntu.tar.gz from [https://github.com/veyeimaging/rk35xx_radxa/releases/ https://github.com/veyeimaging/rk35xx_Radxa/releases/] . |
− | <code>tar -xavf | + | <code>tar -xavf rk356x_radxa_zero3w.tar.gz</code> |
− | <code>cd | + | <code>cd rk356x_radxa_zero3w/released_images/cam2m</code> |
− | <code>sudo dpkg -i linux- | + | <code>sudo dpkg -i linux-headers-5.10.160-36-rk356x_5.10.160-36_arm64_cam2m.deb</code> |
− | + | <code>sudo dpkg -i linux-image-5.10.160-36-rk356x_5.10.160-36_arm64_cam2m.deb</code> | |
− | |||
− | |||
− | + | <code>sudo reboot</code> | |
− | + | If the version does not match, it needs to be compiled from the source code. | |
− | + | ===Check system status=== | |
Run the following command to confirm whether the camera is probed. | Run the following command to confirm whether the camera is probed. | ||
*VEYE-MIPI-XXX | *VEYE-MIPI-XXX | ||
− | <code>dmesg | grep veye</code> | + | <code>sudo dmesg | grep veye</code> |
The output message appears as shown below: | The output message appears as shown below: | ||
− | <code>veyecam2m | + | <code>veyecam2m 2-003b: camera id is veyecam2m</code> |
− | <code>veyecam2m | + | <code>veyecam2m 2-003b: sensor is IMX327</code> |
*Run the following command to check the presence of video node. | *Run the following command to check the presence of video node. | ||
Line 106: | Line 87: | ||
<code>video0</code> | <code>video0</code> | ||
− | For | + | For Radxa Zero 3W, the camera is connected to i2c-2. |
− | + | ===Application examples=== | |
− | + | ====v4l2-ctl==== | |
− | + | =====Install v4l2-utils===== | |
<code>sudo apt-get install v4l-utils</code> | <code>sudo apt-get install v4l-utils</code> | ||
− | + | =====List the data formats supported by the camera===== | |
<code>v4l2-ctl --list-formats-ext</code> | <code>v4l2-ctl --list-formats-ext</code> | ||
− | + | =====Snap YUV picture===== | |
<code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap --stream-count=100 --stream-to=nv12-1920x1080.yuv</code> | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap --stream-count=100 --stream-to=nv12-1920x1080.yuv</code> | ||
Line 120: | Line 101: | ||
<code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=1 --stream-to=uyvy-1920x1080.yuv</code> | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=1 --stream-to=uyvy-1920x1080.yuv</code> | ||
− | + | You can use software like YUV Player or Vooya to play the images. | |
− | + | =====Check frame rate===== | |
− | |||
− | |||
<code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=-1 --stream-to=/dev/null</code> | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=-1 --stream-to=/dev/null</code> | ||
− | + | ====yavta==== | |
<code>git clone <nowiki>https://github.com/veyeimaging/yavta.git</nowiki></code> | <code>git clone <nowiki>https://github.com/veyeimaging/yavta.git</nowiki></code> | ||
Line 131: | Line 110: | ||
<code>./yavta -c1 -Fnv12-1920x1080.yuv --skip 0 -f NV12 -s 1920x1080 /dev/video0</code> | <code>./yavta -c1 -Fnv12-1920x1080.yuv --skip 0 -f NV12 -s 1920x1080 /dev/video0</code> | ||
− | + | ====gstreamer==== | |
We provide several gstreamer routines that implement the preview, capture, and video recording functions. See the [https://github.com/veyeimaging/rk356x_firefly/tree/main/linux/samples samples] directory on github for details. | We provide several gstreamer routines that implement the preview, capture, and video recording functions. See the [https://github.com/veyeimaging/rk356x_firefly/tree/main/linux/samples samples] directory on github for details. | ||
− | + | ====Import to OpenCV==== | |
First install OpenCV: | First install OpenCV: | ||
Line 139: | Line 118: | ||
We provide several routines to import camera data into opencv. See the [https://github.com/veyeimaging/rk356x_firefly/tree/main/linux/samples samples] directory on github for details. | We provide several routines to import camera data into opencv. See the [https://github.com/veyeimaging/rk356x_firefly/tree/main/linux/samples samples] directory on github for details. | ||
− | + | ===Compile drivers and dtb from source code=== | |
− | |||
− | |||
*RK356x | *RK356x | ||
− | + | https://github.com/veyeimaging/rk35xx_radxa/tree/main/linux/drivers/rk356x | |
− | |||
− | |||
− | |||
− | |||
===i2c script for parameter configuration=== | ===i2c script for parameter configuration=== | ||
Because of the high degree of freedom of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters. | Because of the high degree of freedom of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters. | ||
− | + | https://github.com/veyeimaging/rk35xx_radxa/tree/main/i2c_cmd | |
using -b option to identify which bus you want to use. | using -b option to identify which bus you want to use. | ||
Line 160: | Line 133: | ||
Video Control Toolkits Manual :[[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-327 I2C]] | Video Control Toolkits Manual :[[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-327 I2C]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===References=== | ===References=== | ||
− | * | + | *Radxa Zero 3W Manual |
− | |||
− | |||
− | |||
− | |||
− | + | https://docs.radxa.com/zero/zero3 | |
− | * | + | * BSP toolkit |
− | + | https://radxa-repo.github.io/bsp/ | |
===Document History=== | ===Document History=== | ||
− | *2024-04- | + | *2024-04-24 |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Release 1st version. | Release 1st version. |
Latest revision as of 14:47, 25 April 2024
How to use VEYE series cameras on Radxa's RK35XX board
1 Overview
VEYE series cameras are the video streaming mode MIPI cameras we designed. This article takes Radxa's ZERO 3W board as an example to introduce how to connect VEYE series cameras to RK3566/RK3568/RK3588 system.
We provide drivers for Linux.
1.1 Camera Module List
Series | Model | Status |
---|---|---|
VEYE Series | VEYE-MIPI-IMX327S | Done |
VEYE Series | VEYE-MIPI-IMX462 | Done |
VEYE Series | VEYE-MIPI-IMX385 | Done |
In addition, the driver for the Fpdlink connection mode has been finished on the Linux system.
2 Hardware Setup
Radxa ZERO 3W provides a 22-pin connector compatible with Raspberry Pi, allowing our camera to be installed on its motherboard without the need for an adapter board.
2.1 Connection of Camera and Radxa ZERO 3W Board
Both use a 15-to-22-pin FFC cable for connection, ensuring that the silver contact surface faces outward.
3 Introduction to github repositories
https://github.com/veyeimaging/rk35xx_radxa
includes:
- driver source code
- i2c toolkits
- application demo
In addition, a compiled linux kernel installation package is provided in the releases.
4 Upgrade Radxa Debain system
4.1 Overview
This section describes how to update the RK35xx system to support our camera modules.
We provide a deb installation package that can be installed directly.
4.2 Burn Radxa standard system
Refer to the Radxa documentation to burn in a standard system.
4.3 Using prebuilt Image and dtb file
Using the compiled debain installation package
On the RK35xx board,
Download the latest rk356x_Radxa_ubuntu.tar.gz from https://github.com/veyeimaging/rk35xx_Radxa/releases/ .
tar -xavf rk356x_radxa_zero3w.tar.gz
cd rk356x_radxa_zero3w/released_images/cam2m
sudo dpkg -i linux-headers-5.10.160-36-rk356x_5.10.160-36_arm64_cam2m.deb
sudo dpkg -i linux-image-5.10.160-36-rk356x_5.10.160-36_arm64_cam2m.deb
sudo reboot
If the version does not match, it needs to be compiled from the source code.
5 Check system status
Run the following command to confirm whether the camera is probed.
- VEYE-MIPI-XXX
sudo dmesg | grep veye
The output message appears as shown below:
veyecam2m 2-003b: camera id is veyecam2m
veyecam2m 2-003b: sensor is IMX327
- Run the following command to check the presence of video node.
ls /dev/video0
The output message appears as shown below.
video0
For Radxa Zero 3W, the camera is connected to i2c-2.
6 Application examples
6.1 v4l2-ctl
6.1.1 Install v4l2-utils
sudo apt-get install v4l-utils
6.1.2 List the data formats supported by the camera
v4l2-ctl --list-formats-ext
6.1.3 Snap YUV picture
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap --stream-count=100 --stream-to=nv12-1920x1080.yuv
For RK3566, also:
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=1 --stream-to=uyvy-1920x1080.yuv
You can use software like YUV Player or Vooya to play the images.
6.1.4 Check frame rate
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=-1 --stream-to=/dev/null
6.2 yavta
git clone https://github.com/veyeimaging/yavta.git
cd yavta;make
./yavta -c1 -Fnv12-1920x1080.yuv --skip 0 -f NV12 -s 1920x1080 /dev/video0
6.3 gstreamer
We provide several gstreamer routines that implement the preview, capture, and video recording functions. See the samples directory on github for details.
6.4 Import to OpenCV
First install OpenCV:
sudo apt install python3-opencv
We provide several routines to import camera data into opencv. See the samples directory on github for details.
7 Compile drivers and dtb from source code
- RK356x
https://github.com/veyeimaging/rk35xx_radxa/tree/main/linux/drivers/rk356x
8 i2c script for parameter configuration
Because of the high degree of freedom of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters.
https://github.com/veyeimaging/rk35xx_radxa/tree/main/i2c_cmd
using -b option to identify which bus you want to use.
- VEYE series
Video Control Toolkits Manual :VEYE-MIPI-327 I2C
9 References
- Radxa Zero 3W Manual
https://docs.radxa.com/zero/zero3
- BSP toolkit
https://radxa-repo.github.io/bsp/
10 Document History
- 2024-04-24
Release 1st version.