Line 26: |
Line 26: |
| ===硬件准备及安装=== | | ===硬件准备及安装=== |
| Radxa ZERO 3W提供了兼容树莓派的22Pin端子,无需使用转接板即可将我们的相机安装到其主板上。 | | Radxa ZERO 3W提供了兼容树莓派的22Pin端子,无需使用转接板即可将我们的相机安装到其主板上。 |
− | ====摄像机与ADP-Tfirefly的连接==== | + | ====摄像机与Radxa ZERO 3W的主板连接==== |
− | 二者使用1.0mm间距*15P的FFC异面线连接,注意接触面向外。[[File:VEYE-MIPI-327S-ADP-Tfirefly 06.jpg|center|thumb|800x800px|VEYE camera connect to ADP-Tfirefly|link=http://wiki.veye.cc/index.php/File:VEYE-MIPI-327S-ADP-Tfirefly_06.jpg]]<br />
| + | 二者使用15转22P的FFC同面线连接,注意接触面向外。 |
− | ====ADP-Tfirefly与主板的连接====
| + | [[File:VEYE camera connect to Radxa ZERO 3W.jpg|center|thumb|800x800px|VEYE camera connect to Radxa ZERO 3W]] |
− | 二者使用0.5mm间距*30P的FFC同面线连接,注意接触面向内。[[File:VEYE-MIPI-327S-ADP-Tfirefly 05.jpg|center|thumb|800x800px|ADP-Tfirefly connect to Firefly board|link=http://wiki.veye.cc/index.php/File:VEYE-MIPI-327S-ADP-Tfirefly_05.jpg]]<br />
| |
− | ====整体连接图====
| |
− | [[File:VEYE-MIPI-327S-ADP-Tfirefly 04.jpg|center|thumb|800x800px|Firefly Board and VEYE camera overall|link=http://wiki.veye.cc/index.php/File:VEYE-MIPI-327S-ADP-Tfirefly_04.jpg]]
| |
− | ====Fpdlink-III摄像机连接示意图====
| |
− | [[File:FPDLINK Camera to RK3588S.png|center|thumb|800x800px|FPDLINK Camera to RK3588S|link=http://wiki.veye.cc/index.php/File:FPDLINK_Camera_to_RK3588S.png]]<br />
| |
| ===github库介绍=== | | ===github库介绍=== |
− | https://github.com/veyeimaging/rk35xx_firefly | + | https://github.com/veyeimaging/rk35xx_radxa |
| | | |
| 包括以下主要内容: | | 包括以下主要内容: |
Line 43: |
Line 38: |
| *应用层demo | | *应用层demo |
| | | |
− | 此外,在[https://github.com/veyeimaging/rk356x_firefly/releases releases]中,提供了编译好的linux内核安装包以及Android系统镜像。 | + | 此外,在[https://github.com/veyeimaging/rk356x_firefly/releases releases]中,提供了编译好的linux内核安装包。 |
− | ===Ubuntu系统=== | + | ===更新主板的Radxa Debain系统=== |
− | ====更新Firefly主板的Ubuntu系统(RK356x)====
| + | ====概述==== |
− | =====概述=====
| + | 本章节描述怎样更新RK356x系统以支持我们的摄像头模组。我们提供了deb安装包,可以直接安装。 |
− | 本章节描述怎样更新RK356x系统以支持我们的摄像头模组。
| |
− | | |
− | 对于kernel4.19的版本,我们提供了deb安装包,可以直接安装。对于kernel5.10的版本,我们提供了烧写镜像。
| |
− | | |
− | 未提供安装包的版本,需要参考后面的章节,从驱动源码进行编译。
| |
− | | |
− | 尽管我们现在以Ubuntu系统为例进行介绍,其他linux发行版也可以参考本文。
| |
− | =====对于kernel5.10的版本=====
| |
− | 对于ROC-RK3588S-PC,我们提供了发布系统的烧写镜像。
| |
− | | |
− | 下载[https://github.com/veyeimaging/rk356x_firefly/releases/ https://github.com/veyeimaging/rk35xx_firefly/releases/]中对应你使用的摄像机型号的最新镜像。
| |
− | | |
− | 参考Firefly[https://wiki.t-firefly.com/zh_CN/ROC-RK3588S-PC/upgrade_bootmode.html 文档],烧写系统。
| |
− | =====对于kernel4.19的版本=====
| |
| ======烧写Firefly官方标准系统====== | | ======烧写Firefly官方标准系统====== |
| 参考Firefly[https://wiki.t-firefly.com/zh_CN/ROC-RK3566-PC/01-bootmode.html 文档],烧写标准系统。 | | 参考Firefly[https://wiki.t-firefly.com/zh_CN/ROC-RK3566-PC/01-bootmode.html 文档],烧写标准系统。 |
Line 66: |
Line 47: |
| 在RK35xx板子上,执行: | | 在RK35xx板子上,执行: |
| | | |
− | 下载[https://github.com/veyeimaging/rk356x_firefly/releases/ https://github.com/veyeimaging/rk35xx_firefly/releases/]中最新的rk356x_firefly_ubuntu.tar.gz。 | + | 下载[https://github.com/veyeimaging/rk356x_firefly/releases/ https://github.com/veyeimaging/rk35xx_radxa/releases/]中最新的rk356x_radxa_zero3w.tar.gz。 |
| | | |
− | <code>tar -xavf rk356x_firefly.tar.gz</code> | + | <code>tar -xavf rk356x_radxa_zero3w.tar.gz</code> |
| | | |
− | <code>cd rk356x_firefly/released_images/ROC-RK3566-PC/ubuntu/</code> | + | <code>cd rk356x_radxa_zero3w/released_images/cam2m</code> |
| | | |
− | <code>sudo dpkg -i linux-image-4.19.232_4.19.232-21_arm64.deb</code> | + | <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> |
− | ====更新Firefly主板的Ubuntu系统(RK358x)====
| |
− | 对于ROC-RK3588S-PC,我们提供了发布系统的烧写镜像。
| |
| | | |
− | 下载[https://github.com/veyeimaging/rk356x_firefly/releases/ https://github.com/veyeimaging/rk35xx_firefly/releases/]中对应你使用的摄像机型号的最新镜像。
| + | <code>sudo reboot</code> |
| | | |
− | 参考Firefly[https://wiki.t-firefly.com/zh_CN/ROC-RK3588S-PC/upgrade_bootmode.html 文档],烧写系统。
| + | 如果版本不匹配,需要从源代码进行编译。 |
| ====系统状态检测==== | | ====系统状态检测==== |
| 完成系统安装后,在Firefly板端执行以下命令来检测是否正确连接摄像头。 | | 完成系统安装后,在Firefly板端执行以下命令来检测是否正确连接摄像头。 |
Line 86: |
Line 65: |
| *VEYE-MIPI-XXX | | *VEYE-MIPI-XXX |
| | | |
− | <code>dmesg | grep veye</code> | + | <code>sudo dmesg | grep veye</code> |
| | | |
| 应当有类似如下提示: | | 应当有类似如下提示: |
| | | |
− | <code>veyecam2m 4-003b: camera id is veyecam2m</code> | + | <code>veyecam2m 2-003b: camera id is veyecam2m</code> |
| | | |
− | <code>veyecam2m 4-003b: sensor is IMX327</code> | + | <code>veyecam2m 2-003b: sensor is IMX327</code> |
| | | |
| *执行如下命令检查video0设备节点 | | *执行如下命令检查video0设备节点 |
Line 102: |
Line 81: |
| <code>video0</code> | | <code>video0</code> |
| | | |
− | 正确识别摄像头之后,MIPI-CSI2接口的摄像头识别为/dev/video0。对于ROC-RK3566-PC,挂载在i2c-4;对于ROC-RK3588S-PC,挂载在i2c-7。 | + | 正确识别摄像头之后,MIPI-CSI2接口的摄像头识别为/dev/video0。对于Radxa zero 3W,相机挂载在i2c-2。 |
| ====应用范例==== | | ====应用范例==== |
| =====v4l2-ctl===== | | =====v4l2-ctl===== |
Line 116: |
Line 95: |
| <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> |
| | | |
− | 播放图片
| + | 可以使用yuv player或者vooya等软件播放图片。 |
− | | |
− | <code>ffplay -f rawvideo -video_size 1920x1080 -pix_fmt nv12 nv12-1920x1080.yuv</code>
| |
| ======查看帧率====== | | ======查看帧率====== |
| <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap --stream-count=-1 --stream-to=/dev/null</code> | | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap --stream-count=-1 --stream-to=/dev/null</code> |
Line 128: |
Line 105: |
| <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应用范例===== | | =====gstreamer应用范例===== |
− | 我们提供了几个gstreamer例程,实现了预览,抓拍,录像等功能。详见github上的[https://github.com/veyeimaging/rk356x_firefly/tree/main/linux/samples samples]目录。 | + | 我们提供了几个gstreamer例程,实现了预览,抓拍,录像等功能。详见github上的[https://github.com/veyeimaging/rk356x_radxa/tree/main/linux/samples samples]目录。 |
| =====OpenCV的导入===== | | =====OpenCV的导入===== |
| 首先安装OpenCV: | | 首先安装OpenCV: |
Line 134: |
Line 111: |
| <code>sudo apt install python3-opencv</code> | | <code>sudo apt install python3-opencv</code> |
| | | |
− | 我们提供了几个将摄像头数据导入opencv的例程。详见github上的[https://github.com/veyeimaging/rk356x_firefly/tree/main/linux/samples samples]目录。 | + | 我们提供了几个将摄像头数据导入opencv的例程。详见github上的[https://github.com/veyeimaging/rk356x_radxa/tree/main/linux/samples samples]目录。 |
− | | |
− | 此外,Firefly的这个[https://wiki.t-firefly.com/zh_CN/Firefly-Linux-Guide/demo_OpenCV_support.html 页面]也有一定的参考价值。
| |
| ====从源码编译驱动和dtb==== | | ====从源码编译驱动和dtb==== |
| | | |
| *RK356x | | *RK356x |
| | | |
− | https://github.com/veyeimaging/rk35xx_firefly/tree/main/linux/drivers/rk356x | + | https://github.com/veyeimaging/rk35xx_radxa/tree/main/linux/drivers/rk356x |
− | | |
− | *RK358x
| |
− | | |
− | https://github.com/veyeimaging/rk35xx_firefly/tree/main/linux/drivers/rk358x
| |
| ===i2c脚本使用说明=== | | ===i2c脚本使用说明=== |
| 由于我们的摄像头参数自由度比较高,并没有采用V4L2参数进行控制,而是使用脚本进行参数配置。 | | 由于我们的摄像头参数自由度比较高,并没有采用V4L2参数进行控制,而是使用脚本进行参数配置。 |
| | | |
− | https://github.com/veyeimaging/rk35xx_firefly/tree/main/i2c_cmd | + | https://github.com/veyeimaging/rk35xx_radxa/tree/main/i2c_cmd |
| | | |
| 注意脚本使用中,采用-b [i2cbus]参数来指明摄像头使用的i2c bus。 | | 注意脚本使用中,采用-b [i2cbus]参数来指明摄像头使用的i2c bus。 |
| | | |
| [[VEYE MIPI 290/327 for Raspberry Pi/zh|VEYE系列参数控制软件包使用说明]] | | [[VEYE MIPI 290/327 for Raspberry Pi/zh|VEYE系列参数控制软件包使用说明]] |
− |
| |
− | [[CS-MIPI-X for Raspberry Pi/zh|CS系列参数控制软件包使用说明]]
| |
− | ===Android系统===
| |
− | ====更新Android系统====
| |
− |
| |
− | *ROC-RK3566-PC
| |
− |
| |
− | 下载<nowiki/>https://github.com/veyeimaging/rk35xx_firefly/releases/<nowiki/>中最新的rk356x_firefly_android.tar.gz。
| |
− |
| |
− | *ROC-RK3588S-PC
| |
− |
| |
− | 下载<nowiki/>https://github.com/veyeimaging/rk35xx_firefly/releases/<nowiki/>中最新的rk358x_firefly_android.tar.gz。
| |
− |
| |
− | 参考firefly的文档烧写系统。
| |
− | ====系统状态检测====
| |
− | 完成系统安装后,通过adb登录在Firefly板端,执行以下命令来检测是否正确连接摄像头。
| |
− |
| |
− | *VEYE-MIPI-XXX
| |
− |
| |
− | <code>dmesg | grep veye</code>
| |
− |
| |
− | 应当有类似如下提示:
| |
− |
| |
− | <code>veyecam2m 4-003b: camera id is veyecam2m</code>
| |
− |
| |
− | <code>veyecam2m 4-003b: sensor is IMX327</code>
| |
− |
| |
− | *执行如下命令检查video0设备节点
| |
− |
| |
− | <code>ls /dev/video0</code>
| |
− |
| |
− | 可以看到
| |
− |
| |
− | <code>video0</code>
| |
− |
| |
− | 正确识别摄像头之后,MIPI-CSI2接口的摄像头挂载到i2c-4,识别为/dev/video0。
| |
− | ====应用范例====
| |
− | 使用系统自带的相机程序即可打开摄像头。
| |
− | ====从源码编译系统====
| |
− |
| |
− | *RK356x
| |
− |
| |
− | https://github.com/veyeimaging/rk35xx_firefly/tree/main/android/rk356x/drivers
| |
− |
| |
− | *RK358x
| |
− |
| |
− | https://github.com/veyeimaging/rk35xx_firefly/tree/main/android/rk358x/drivers
| |
− | ===已知问题===
| |
− |
| |
− | #RK3588的VICAP模块不支持输出UYVY格式,因此请使用NV12格式。
| |
| | | |
| ===参考资料=== | | ===参考资料=== |
| | | |
− | *ROC-RK3566-PC 手册 | + | *Radxa Zero 3W Manual |
− | | |
− | https://wiki.t-firefly.com/zh_CN/ROC-RK3566-PC/
| |
| | | |
− | *ROC-RK3588S-PC 手册
| + | https://docs.radxa.com/zero/zero3 |
| | | |
− | https://wiki.t-firefly.com/zh_CN/ROC-RK3588S-PC/
| + | * BSP toolkit |
| | | |
− | *Firefly Linux 开发指南
| + | https://radxa-repo.github.io/bsp/ |
− | | |
− | https://wiki.t-firefly.com/zh_CN/Firefly-Linux-Guide/index.html | |
| ===本文修改记录=== | | ===本文修改记录=== |
| | | |
− | *2024-04-17 | + | *2024-04-24 |
− | | |
− | Support kernel v5.10 on RK3566.
| |
− | | |
− | *2023-05-22
| |
− | | |
− | 在ubuntu系统下,已经调通Fpdlink连接模式的驱动。
| |
− | | |
− | *2022-12-28
| |
− | | |
− | 增加对RK3588的支持。
| |
− | | |
− | *2022-12-06
| |
− | | |
− | 支持Android系统。
| |
− | | |
− | *2022-10-22
| |
− | | |
| | | |
| 发布第一个版本。 | | 发布第一个版本。 |