Difference between revisions of "VEYE CS Camera for Jetson TX2"

From wiki_veye
Jump to navigation Jump to search
(42 intermediate revisions by 2 users not shown)
Line 4: Line 4:
  
 
===Overview===
 
===Overview===
This guide shows how to use VEYE and CS series camera modules on Jetson Nano,TX2,AGX Xavier and Xavier NX.  Jetson SDK Version is
+
This guide shows how to use VEYE and CS series camera modules on Jetson Nano,Jetson Nano 2GB,TX2,TX2 NX,AGX Xavier and Xavier NX.  Jetson SDK Version is
  
 
*Jetpack4.2.2,L4T r32.2.1
 
*Jetpack4.2.2,L4T r32.2.1
*Jetpack4.3,L4Tr32.3.1
+
*Jetpack4.3,L4T r32.3.1
*Jetpack4.4,L4T,r32.4.3
+
*Jetpack4.4,L4T r32.4.3
 +
*Jetpack4.4.1,L4T r32.4.4
 +
*Jetpack4.5,L4T r32.5
 +
*Jetpack4.5.1,L4T r32.5.1
 +
*Jetpack4.6,L4T r32.6.1
  
 
We provide two ways to do so: '''Prebuilt Binaries''' or '''Source Code. Yes, It's Open Source!'''
 
We provide two ways to do so: '''Prebuilt Binaries''' or '''Source Code. Yes, It's Open Source!'''
  
 
VEYE and CS series camera modules are camera module with ISP functions build in. It output UYVY data using MIPI-CSI2. We provide '''V4L2 interface''' for video streaming apps , and '''Video Control Toolkits (which is Shell Script)''' to control the camera module directly, which is called DRA(Directly Register Access).
 
VEYE and CS series camera modules are camera module with ISP functions build in. It output UYVY data using MIPI-CSI2. We provide '''V4L2 interface''' for video streaming apps , and '''Video Control Toolkits (which is Shell Script)''' to control the camera module directly, which is called DRA(Directly Register Access).
 +
====How to check the current L4T version====
 +
On Jetson board
 +
 +
<code>cat /etc/nv_tegra_release</code>
 +
 +
If it shows:
 +
 +
<code># R32 (release), REVISION: 4.3......</code>
 +
 +
It means L4t Verion is 32.4.3
 
===Hardware Setup===
 
===Hardware Setup===
 
We have designed a 6cam interposer board  for TX2 devkit and Xavier, It support up to 6 cameras at the same time.   
 
We have designed a 6cam interposer board  for TX2 devkit and Xavier, It support up to 6 cameras at the same time.   
Line 20: Line 34:
 
It is connected as shown in figure:
 
It is connected as shown in figure:
 
[[File:TX2-6CAM-YT2.0-3.5I.jpg|alt=TX2 Devkit 6 cameras connection|center|thumb|800x800px|'''TX2 Devkit 6 cameras connection''']]
 
[[File:TX2-6CAM-YT2.0-3.5I.jpg|alt=TX2 Devkit 6 cameras connection|center|thumb|800x800px|'''TX2 Devkit 6 cameras connection''']]
<br />
+
<br />'''Be sure to screw the ADP adapter board to the bottom board.'''
  
 
====NVIDIA TX2 AGX Xavier====
 
====NVIDIA TX2 AGX Xavier====
[[File:AGX XAVIER 6cam.jpg|alt=Connect VEYE cameras to AGX Xavier|center|thumb|800x800px|Connect VEYE cameras to AGX Xavier (the green interposer board  is temporary,the official version is black. )]]
 
 
<br />
 
<br />
====NVIDIA Nano Xavier NX Devkit====
+
[[File:ADP-N1-V2.0 XAVIER 6CAM.jpg|link=http://wiki.veye.cc/index.php/File:ADP-N1-V2.0%20XAVIER%206CAM.jpg|alt=Connect VEYE cameras to AGX Xavier|center|thumb|800x800px|Connect VEYE cameras to AGX Xavier]]
 +
<br />'''Be sure to screw the ADP adapter board to the bottom board.'''
 +
====NVIDIA Nano ,TX2 NX and Xavier NX Devkit====
 
The Xavier NX interface is compatible with raspberry pi and Jetson Nano. The connection mode is shown in figure:
 
The Xavier NX interface is compatible with raspberry pi and Jetson Nano. The connection mode is shown in figure:
 
[[File:Xavier NX connection with VEYE-MIPI-327.jpg|alt=Xavier NX connection with VEYE-MIPI-327|center|thumb|800x800px|Xavier NX connection with VEYE-MIPI-327]]
 
[[File:Xavier NX connection with VEYE-MIPI-327.jpg|alt=Xavier NX connection with VEYE-MIPI-327|center|thumb|800x800px|Xavier NX connection with VEYE-MIPI-327]]
Line 32: Line 47:
 
[[File:Jetson nano to Veye327.jpg|link=http://wiki.veye.cc/index.php/File:Jetson%20nano%20to%20Veye327.jpg|alt=Jetson Nano A02 与VEYE模组连接|center|thumb|800x800px|VEYE327 connection with Jetson Nano A02]]
 
[[File:Jetson nano to Veye327.jpg|link=http://wiki.veye.cc/index.php/File:Jetson%20nano%20to%20Veye327.jpg|alt=Jetson Nano A02 与VEYE模组连接|center|thumb|800x800px|VEYE327 connection with Jetson Nano A02]]
  
===Upgrade Jetson Nano, Jetson TX2, AGX Xavier and Xavier NX system===
+
===Upgrade Jetson Nano, Jetson TX2, TX2 NX,AGX Xavier and Xavier NX system===
  
 
====Overview====
 
====Overview====
Line 39: Line 54:
 
In the Image, we added the camera driver, while the DTB indicates the camera model used. In general, you only need to use the Image and DTB, that we have prebuilt, and you don't need to build from source  when it is not necessary.
 
In the Image, we added the camera driver, while the DTB indicates the camera model used. In general, you only need to use the Image and DTB, that we have prebuilt, and you don't need to build from source  when it is not necessary.
  
In particular, for Xavier NX, we provide a burning image of the TF card.
+
<s>In particular, for Xavier NX, we provide a burning image of the TF card.</s>
  
====Buruing the prebuilt Image to upgrade Jetson Nano and Xavier NX Devkit====
+
====<s>Burning the prebuilt Image to upgrade Jetson Nano and Xavier NX Devkit</s>====
'''''This method is no longer recommended because in this mode, the DTB partition reverts to the default value in some cases. It is recommended to use pre-compiled Image and DTB for driver upgrade.'''''
+
'''''<s>This method is no longer recommended because in this mode, the DTB partition reverts to the default value in some cases. It is recommended to use pre-compiled Image and DTB for driver upgrade.</s>'''''
  
You can use the image prebuild by us to upgrade jetson Xavier NX system, which will support our camera.
+
<s>You can use the image prebuild by us to upgrade jetson Xavier NX system, which will support our camera.</s>
  
Using whole prebuilt image
+
<s>Using whole prebuilt image</s>
  
*download :
+
*<s>download :</s>
  
baiduyun:https://pan.baidu.com/s/1sWrcfEOivjuQ7T7P5bVcng
+
<s>baiduyun:https://pan.baidu.com/s/1sWrcfEOivjuQ7T7P5bVcng</s>
  
google driver:https://drive.google.com/drive/folders/1KHSMTdyw-ZczR1yJPj-5y9eIv7izbgt3?usp=sharing
+
<s>google driver:https://drive.google.com/drive/folders/1KHSMTdyw-ZczR1yJPj-5y9eIv7izbgt3?usp=sharing</s>
  
If Baidu cloud disk download is too slow, you can contact our company customer service ''xumm@csoneplus.com'' to obtain.
+
<s>If Baidu cloud disk download is too slow, you can contact our company customer service ''xumm@csoneplus.com'' to obtain.</s>
  
*How to burn<code><nowiki/></code>
+
*<s>How to burn</s><code><nowiki/></code>
  
refer to [https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write Official document]
+
<s>refer to [https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write Official document]</s>
  
 
====BSP package introduction====
 
====BSP package introduction====
Line 72: Line 87:
 
*i2c toolkits
 
*i2c toolkits
  
====Upgrade Jetson Nano and Xavier NX without HOST PC====
+
==== DTB file name and Jeton Board ====
 +
 
 +
=====Nano A02=====
 +
<code>tegra210-p3448-0000-p3449-0000-a02.dtb</code>
 +
 
 +
===== Nano B01 =====
 +
<code>tegra210-p3448-0000-p3449-0000-b00.dtb</code>
 +
 
 +
===== Nano 2GB =====
 +
<code>tegra210-p3448-0003-p3542-0000.dtb</code>
 +
=====TX2 Devkit=====
 +
<code>tegra186-quill-p3310-1000-c03-00-base.dtb</code>
 +
 
 +
===== TX2 NX(p3509-0000 carrier board) =====
 +
use the same carrier board with XAVIER NX Devkit
 +
 
 +
<code>tegra186-p3636-0001-p3509-0000-a01.dtb</code>
 +
=====AGX XAVIER=====
 +
<code>tegra194-p2888-0001-p2822-0000.dtb</code>
 +
=====XAVIER NX Devkit=====
 +
<code>tegra194-p3668-all-p3509-0000.dtb</code>
 +
====Upgrade Jetson Nano and Xavier NX 、AGX Xavier without HOST PC====
 +
Note: AGX Xavie Jetpack version >= 4.4 , support this upgrade mode. Earlier versions have not been verified and are not recommended.
  
 
=====Check the current L4T version=====
 
=====Check the current L4T version=====
Line 94: Line 131:
  
 
<code>sudo cp <path to your Image dir>/Image /boot/Image -f</code>
 
<code>sudo cp <path to your Image dir>/Image /boot/Image -f</code>
 +
 +
''For Xavier NX Devkit''
 +
 +
Need to use the signed file(For example,file inside Image_l4t_r32.*.*_veyecam_signed_4_xavier),copy Image and Image.sig to /boot/ dir on the Jetson Xavier board:
 +
 +
<code>sudo cp <path to your Image dir>/Image /boot/Image -f</code>
 +
 +
<code>sudo cp <path to your Image dir>/Image.sig /boot/Image -f</code>
 +
 +
Effective after restart.
  
 
=====Upgrade dtb=====
 
=====Upgrade dtb=====
Line 104: Line 151:
 
<code>FDT /boot/<DTB file name></code>
 
<code>FDT /boot/<DTB file name></code>
  
====Upgrade Jetson Board using Host PC====
+
Note: <DTB file name> should be replaced with the corresponding dtb name of the mainboard, ensure that the file specified in the FDT line actually exists correctly.
  
=====Setting Up the Host PC Environment=====
+
Effective after restart.
  
*Cross-compiling Toolchain
+
====Upgrade Jetson Board using Host PC====
 
 
Please refer to this [https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fxavier_toolchain.html%23wwpID0ESHA link] to install toolchain on your Host PC.
 
 
 
*L4T source code and Rootfs
 
 
 
You could use SDK Manager or [https://developer.nvidia.com/embedded/downloads directly download] to get source code.
 
 
 
Sync code as this if you use SDK Manager:
 
 
 
''- Jetpack4.2.2''
 
 
 
<code>./source_sync.sh -t tegra-l4t-r32.2.1</code>
 
 
 
''- Jetpack4.3''
 
 
 
<code>./source_sync.sh -t tegra-l4t-r32.3.1</code>
 
 
 
''- Jetpack4.4''
 
 
 
<code>./source_sync.sh -t tegra-l4t-r32.4.3</code>
 
 
 
*Setting Up the Environment
 
 
 
Assume SDK install directory is <TOPDIR>,source code is in $L4T_DIR/sources directory.
 
 
 
''- Nano@Jetpack4.2.2''
 
 
 
<code>export TOP_DIR=<absolute path to top dir;in my case is /home/xumm/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/></code>
 
 
 
''- Nano@Jetpack4.3''
 
 
 
<code>export TOP_DIR=<absolute path to top dir;in my case is /home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_JETSON_NANO_DEVKIT/></code>
 
 
 
''- Nano@Jetpack4.4''
 
 
 
<code>export TOP_DIR=<absolute path to top dir;in my case is /home/xumm/nvidia/nvidia_sdk/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/></code>
 
 
 
''- TX2@Jetpack4.2.2''
 
 
 
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/</code>
 
 
 
''- TX2@Jetpack4.3''
 
 
 
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_P3310/</code>
 
 
 
''- TX2@Jetpack4.4''
 
 
 
<code>export TOP_DIR=/home/xumm/nvidia/JetPack_4.4_Linux_JETSON_TX2/</code>
 
 
 
''- AGX XavierJetpack4.2.2''
 
 
 
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P2888/</code>
 
 
 
''- AGX XavierJetpack4.3''
 
 
 
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_P2888/</code>
 
 
 
''- AGX XavierJetpack4.4''
 
 
 
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.4_Linux_JETSON_AGX_XAVIER/</code>
 
  
- ''Xavier NX Jetpack4.4''
+
=====Burn the standard Image=====
 +
'''''Note: if your Jetson board has correctly burned the standard version Image, you can skip this step.'''''
  
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.4_Linux_JETSON_XAVIER_NX_DEVKIT</code>
+
You can burn the standard Image using SDK Manager or following the steps below.
  
- Common part
+
* Set PATH
  
<code>export L4T_DIR=$TOP_DIR/Linux_for_Tegra</code>
+
Assume SDK install directory is <TOPDIR>.
  
<code>export LOCALVERSION=-tegra</code>
+
<code>export TOP_DIR=<absolute path to top dir accroding to your jetpack version and board name;for example /home/xumm/nvidia/nvidia_sdk/JetPack_4.5_Linux_JETSON_XAVIER_NX_DEVKIT/></code>
  
<code>export LDK_ROOTFS_DIR=$TOP_DIR/Linux_for_Tegra/rootfs</code>
+
export L4T_DIR=$TOP_DIR/Linux_for_Tegra
 
 
<code>export ARCH=arm64</code>
 
 
 
<code>export CROSS_COMPILE=aarch64-linux-gnu-</code>
 
 
 
<code>export CROSS32CC=arm-linux-gnueabihf-gcc</code>
 
 
 
<code>export TEGRA_KERNEL_OUT=$L4T_DIR/sources/kernel/out_kernel</code>
 
 
 
<code>export KERNEL_PATH=$L4T_DIR/sources/kernel/out_kernel</code>
 
 
 
<code>export NVIDIA_PATH=$L4T_DIR/sources/kernel/nvidia</code>
 
 
 
<code>export NANO_DTS_PATH=$L4T_DIR/sources/hardware/nvidia/platform/t210/</code>
 
 
 
<code>export TX2_DTS_PATH=$L4T_DIR/sources/hardware/nvidia/platform/t18x</code>
 
 
 
<code>export XAVIER_DTS_PATH=$L4T_DIR/sources/hardware/nvidia/platform/t19x</code>
 
 
 
<code>cd $L4T_DIR/sources/kernel/kernel-4.9/</code>
 
  
 
*Build default image, flashing to Jetson Board, prepare L4T environment
 
*Build default image, flashing to Jetson Board, prepare L4T environment
Line 210: Line 178:
 
- Nano
 
- Nano
  
<code>sudo ./flash.sh jetson--qspi-sd mmcblk0p1</code>
+
<code><s>sudo ./flash.sh jetson-qspi-sd mmcblk0p1</s></code>
 +
 
 +
<code>sudo ./flash.sh jetson-nano-devkit mmcblk0p1</code>
 +
 
 +
<code>sudo ./flash.sh jetson-nano-2gb-devkit mmcblk0p1</code>
  
 
''- TX2''
 
''- TX2''
  
 
<code>sudo ./flash.sh jetson-tx2 mmcblk0p1</code>
 
<code>sudo ./flash.sh jetson-tx2 mmcblk0p1</code>
 +
 +
''- TX2 NX(p3509-0000 carrier board)''
 +
 +
<code>sudo ./flash.sh jetson-xavier-nx-devkit-tx2-nx mmcblk0p1</code>
  
 
''- AGX Xavier''  
 
''- AGX Xavier''  
Line 244: Line 220:
 
''- AGX Xavier and Xavier NX Devkit''
 
''- AGX Xavier and Xavier NX Devkit''
  
Need to use the signed file,copy Image and Image.sig to /boot/ dir on the Jetson Xavier board:
+
Need to use the signed file(For example,file inside Image_l4t_r32.*.*_veyecam_signed_4_xavier),copy Image and Image.sig to /boot/ dir on the Jetson Xavier board:
  
 
<code>sudo cp <path to your Image dir>/Image  /boot/Image -f</code>
 
<code>sudo cp <path to your Image dir>/Image  /boot/Image -f</code>
Line 274: Line 250:
 
- ''Nano''
 
- ''Nano''
  
<code>sudo ./flash.sh -r -k DTB jetson-nano-qspi-sd mmcblk0p1</code>
+
<code><s>sudo ./flash.sh -r -k DTB jetson-nano-qspi-sd mmcblk0p1</s></code>
 +
 
 +
<code>sudo ./flash.sh -r -k DTB  jetson-nano-devkit mmcblk0p1</code>
 +
 
 +
<code>sudo ./flash.sh -r -k DTB  jetson-nano-2gb-devkit mmcblk0p1</code>
  
 
''- TX2''
 
''- TX2''
  
 
<code>sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1</code>
 
<code>sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1</code>
 +
 +
''- TX2 NX(p3509-0000 carrier board)''
 +
 +
<code>sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-tx2-nx mmcblk0p1</code>
  
 
''- AGX Xavier''
 
''- AGX Xavier''
Line 295: Line 279:
 
<code>ls /sys/bus/i2c/drivers/</code>
 
<code>ls /sys/bus/i2c/drivers/</code>
  
There should have  veye327 csx307 cssc132 directory.
+
There should have  veye327 veyecam csx307 cssc132 directory.
 
=====For DTB=====
 
=====For DTB=====
 
DTB varies from platform  and from camera module.
 
DTB varies from platform  and from camera module.
  
- Nano A02
+
- Nano A02/ Nano 2G
  
 
<code>ls /proc/device-tree/host1x/i2c@546c0000/</code>
 
<code>ls /proc/device-tree/host1x/i2c@546c0000/</code>
Line 311: Line 295:
 
<code>ls /proc/device-tree/i2c@3180000/tca9548@70/i2c@*</code>
 
<code>ls /proc/device-tree/i2c@3180000/tca9548@70/i2c@*</code>
  
- AGX Xavier
+
or
  
<code>ls /proc/device-tree/i2c@3180000/tca9546@70/i2c@*</code>
+
<code>ls /proc/device-tree/i2c@3180000/tca9548@77/i2c@*</code>
  
- Xavier NX
+
- AGX Xavier
  
<code>ls /proc/device-tree/cam_i2cmux/i2c@*</code>
+
<code>ls /proc/device-tree/i2c@3180000/tca9548@70/i2c@*</code>
  
You should be able to find the camera model you used.
+
or
====Building from Source====
 
=====Build kernel=====
 
  
*patch code
+
<code>ls /proc/device-tree/i2c@3180000/tca9548@77/i2c@*</code>
  
<code>cp $RELEASE_PACK_DIR/drivers_source/cam_drv_src/* $NVIDIA_PATH/drivers/media/i2c/</code>
+
- Xavier NX and TX2 NX(p3509-0000 carrier board)
  
''- r32.2.1''
+
<code>ls /proc/device-tree/cam_i2cmux/i2c@*</code>
  
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.2.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>
+
You should be able to find the camera model you used.
 
+
====Build the drivers from source====
''- r32.3.1''
+
Please refer to: [[VEYE CS Camera source for Jetson|Nvidia Jetson platform VEYE and CS series camera driver source code compilation guide]].
 
 
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>
 
 
 
''- r32.4.2''
 
 
 
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.4.2 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>
 
 
 
''- r32.4.3''
 
 
 
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.4.3 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>
 
 
 
*build
 
 
 
<code>cd $L4T_DIR/sources/kernel/kernel-4.9/</code>
 
 
 
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_veyecam_defconfig</code>
 
 
 
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j4</code>
 
 
 
Completed Image file is $TEGRA_KERNEL_OUT/arch/arm64/boot/Image,could be used for Flashing or Upgrading.
 
 
 
Install Image for Flashing:
 
 
 
<code>sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $L4T_DIR/kernel/ -f</code>
 
 
 
*For xavier,need sign the file
 
 
 
<code>cd $L4T_DIR</code>
 
 
 
<code>./l4t_sign_image.sh --file kernel/Image --chip 0x19</code>
 
 
 
=====Build DTS=====
 
 
 
*patch code
 
 
 
''- '''Nano@Jetpack4.2.2'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/common/t210/* -r $NANO_DTS_PATH/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/CS-MIPI-IMX307/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
''- '''Nano@Jetpack4.3'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/common/t210/* -r $NANO_DTS_PATH/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/CS-MIPI-IMX307/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
''- '''Nano@Jetpack4.4'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/dts\ dtb/common/t210/* -r $NANO_DTS_PATH/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/dts\ dtb/VEYE-MIPI-327/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/dts\ dtb/CS-MIPI-IMX307/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
For CS-MIPI-SC132
 
 
 
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.4_Linux_JETSON_NANO_DEVKIT/dts\ dtb/CS-MIPI-SC132/tegra210-porg-plugin-manager.dtsi -r $NANO_DTS_PATH/porg/kernel-dts/porg-plugin-manager</code>
 
 
 
''- '''Jetson TX2@Jetpack4.2.2'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.2.2_Linux_GA_P3310/dts\ dtb/common/t18x/* -r $TX2_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.2.2_Linux_GA_P3310/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.2.2_Linux_GA_P3310/dts\ dtb/VEYE-MIPI-327/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
''-  '''TX2@Jetpack4.3'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/common/t18x/* -r $TX2_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
For CS-MIPI-SC132
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-SC132/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/VEYE-MIPI-327/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
''-  '''TX2@Jetpack4.4'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.4_Linux_JETSON_TX2/dts\ dtb/common/t18x/* -r $TX2_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.4_Linux_JETSON_TX2/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
For CS-MIPI-SC132
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.4_Linux_JETSON_TX2/dts\ dtb/CS-MIPI-SC132/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.4_Linux_JETSON_TX2/dts\ dtb/VEYE-MIPI-327/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
 
 
''- '''AGX Xavier@Jetpack4.2.2'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.2.2_Linux_GA_P2888/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.2.2_Linux_GA_P2888/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.2.2_Linux_GA_P2888/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
''- '''AGX Xavier@Jetpack4.3'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
For CS-MIPI-SC132
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-SC132/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
''- '''AGX Xavier@Jetpack4.4'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.4_Linux_JETSON_AGX_XAVIER/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.4_Linux_JETSON_AGX_XAVIER/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
For CS-MIPI-SC132
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.4_Linux_JETSON_AGX_XAVIER/dts\ dtb/CS-MIPI-SC132/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.4_Linux_JETSON_AGX_XAVIER/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
 
 
''- '''Xavier NX@Jetpack4.4'''''
 
 
 
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_Linux_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/</code>
 
 
 
For CS-MIPI-IMX307
 
 
 
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_Linux_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-IMX307/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/</code>
 
 
 
For CS-MIPI-SC132
 
 
 
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_Linux_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-SC132/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/</code>
 
 
 
For VEYE-MIPI-327
 
 
 
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_Linux_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/VEYE-MIPI-327/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/</code>
 
 
 
*build
 
 
 
<code>cd $L4T_DIR/sources/kernel/kernel-4.9/</code>
 
 
 
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs</code>
 
 
 
- ''Nano''
 
 
 
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra210-p3448-0000-p3449-0000-a02.dtb $L4T_DIR/kernel/dtb/</code>
 
 
 
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra210-p3448-0000-p3449-0000-b00.dtb $L4T_DIR/kernel/dtb/</code>
 
 
 
''- TX2''
 
 
 
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb $L4T_DIR/kernel/dtb/</code>
 
 
 
''- AGX XAVIER''
 
 
 
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb</code>
 
 
 
''- XAVIER NX''
 
 
 
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p3668-all-p3509-0000.dtb  $L4T_DIR/kernel/dtb/</code>
 
  
 
Could be used for Flashing or Upgrading.
 
Could be used for Flashing or Upgrading.
Line 540: Line 320:
 
Run the following command to confirm whether the camera is probed.
 
Run the following command to confirm whether the camera is probed.
  
*For VEYE-MIPI-327
+
*For VEYE-MIPI-327(using VEYE-MIPI-327 dtb)
  
 
<code>dmesg | grep veye327</code>  
 
<code>dmesg | grep veye327</code>  
  
The output message appears as shown below.:
+
The output message appears as shown below:
  
 
<code>Detected VEYE327 sensor</code>
 
<code>Detected VEYE327 sensor</code>
  
 
<code>subdev veye327 X-003b bound</code>
 
<code>subdev veye327 X-003b bound</code>
 +
 +
*VEYE-MIPI-X(using VEYE-MIPI-CAM2M dtb)
 +
 +
<code>dmesg | grep veye</code>  
 +
 +
The output message appears as shown below:
 +
 +
<code>camera id is veyecam</code>
 +
 +
<code>sensor is IMX327/IMX462/IMX385</code>
 +
 +
<code>subdev veyecam X-003b bound</code>
  
 
*For CS-MIPI-IMX307
 
*For CS-MIPI-IMX307
Line 558: Line 350:
 
<code>Detected CS307 sensor</code>
 
<code>Detected CS307 sensor</code>
  
<code>subdev csimx307 X-003b bound</code>
+
<code>subdev csx307 X-003b bound</code>
  
 
*For CS-MIPI-SC132
 
*For CS-MIPI-SC132
Line 585: Line 377:
  
 
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false</code>
 
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false</code>
 +
 +
* Preview FHD(using xvimagesink sink)
 +
 +
<code>export DISPLAY=:0</code>
 +
 +
<code>gst-launch-1.0 -e v4l2src io-mode=4 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! xvimagesink sync=false</code>
  
 
*Preview 720p@60 (CS-MIPI-IMX307,HW accelerated)
 
*Preview 720p@60 (CS-MIPI-IMX307,HW accelerated)
Line 607: Line 405:
  
 
<code>gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=$WIDTH sink_0::height=$HEIGHT sink_1::xpos=$WIDTH sink_1::ypos=0 sink_1::width=$WIDTH sink_1::height=$HEIGHT ! nvoverlaysink v4l2src device=/dev/video0 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp. v4l2src device=/dev/video1 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp.</code>
 
<code>gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=$WIDTH sink_0::height=$HEIGHT sink_1::xpos=$WIDTH sink_1::ypos=0 sink_1::width=$WIDTH sink_1::height=$HEIGHT ! nvoverlaysink v4l2src device=/dev/video0 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp. v4l2src device=/dev/video1 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp.</code>
 +
 +
* Gstreamer cmd line for OpenCV
 +
 +
I think maybe OpenCV do not support I420 data format input,so you should convert it to BGR format.
 +
 +
<code>gst-launch-1.0 v4l2src ! video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080 ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink</code>
  
 
*Record FHD in H.264 format to a video file(HW accelerated)
 
*Record FHD in H.264 format to a video file(HW accelerated)
Line 625: Line 429:
 
For AGX-Xavier and TX2, ADP-N1 has 6 MIPI CSI-2 interface [A-F],the corresponding i2c address is[30-35].
 
For AGX-Xavier and TX2, ADP-N1 has 6 MIPI CSI-2 interface [A-F],the corresponding i2c address is[30-35].
  
For Xavier NX, the corresponding i2c address is 9 and10.
+
For Xavier NX, TX2 NX,the corresponding i2c address is 9 and10.
  
For Nano A02, the corresponding i2c address is 6.
+
For Nano A02,Nano 2GB, the corresponding i2c address is 6.
  
For Xavier NX, the corresponding i2c address is 7 and 8.
+
For Nano B01, the corresponding i2c address is 7 and 8.
  
 
It is also the same as the X part of dmesg message:
 
It is also the same as the X part of dmesg message:
  
<code>subdev veye327 X-003b bound</code>
+
<code>subdev veyeX X-003b bound</code>
  
 
<code>subdev csimx307 X-003b bound</code>
 
<code>subdev csimx307 X-003b bound</code>

Revision as of 15:07, 26 September 2021

查看中文

How to use VEYE and CS series camera module on NVIDIA Jetson Nano,TX2,AGX Xavier and Xavier NX

1 Overview

This guide shows how to use VEYE and CS series camera modules on Jetson Nano,Jetson Nano 2GB,TX2,TX2 NX,AGX Xavier and Xavier NX. Jetson SDK Version is

  • Jetpack4.2.2,L4T r32.2.1
  • Jetpack4.3,L4T r32.3.1
  • Jetpack4.4,L4T r32.4.3
  • Jetpack4.4.1,L4T r32.4.4
  • Jetpack4.5,L4T r32.5
  • Jetpack4.5.1,L4T r32.5.1
  • Jetpack4.6,L4T r32.6.1

We provide two ways to do so: Prebuilt Binaries or Source Code. Yes, It's Open Source!

VEYE and CS series camera modules are camera module with ISP functions build in. It output UYVY data using MIPI-CSI2. We provide V4L2 interface for video streaming apps , and Video Control Toolkits (which is Shell Script) to control the camera module directly, which is called DRA(Directly Register Access).

1.1 How to check the current L4T version

On Jetson board

cat /etc/nv_tegra_release

If it shows:

# R32 (release), REVISION: 4.3......

It means L4t Verion is 32.4.3

2 Hardware Setup

We have designed a 6cam interposer board for TX2 devkit and Xavier, It support up to 6 cameras at the same time.

6cam interposer board connected with 6 cameras
6cam interposer board connected with 6 cameras


2.1 NVIDIA TX2 Developer Kit

It is connected as shown in figure:

TX2 Devkit 6 cameras connection
TX2 Devkit 6 cameras connection


Be sure to screw the ADP adapter board to the bottom board.

2.2 NVIDIA TX2 AGX Xavier


Connect VEYE cameras to AGX Xavier
Connect VEYE cameras to AGX Xavier


Be sure to screw the ADP adapter board to the bottom board.

2.3 NVIDIA Nano ,TX2 NX and Xavier NX Devkit

The Xavier NX interface is compatible with raspberry pi and Jetson Nano. The connection mode is shown in figure:

Xavier NX connection with VEYE-MIPI-327
Xavier NX connection with VEYE-MIPI-327


Xavier NX connection with CS-MIPI-IMX307
Xavier NX connection with CS-MIPI-IMX307
Jetson Nano A02 与VEYE模组连接
VEYE327 connection with Jetson Nano A02

3 Upgrade Jetson Nano, Jetson TX2, TX2 NX,AGX Xavier and Xavier NX system

3.1 Overview

This section describes how to upgrade the Jetson system to support our camera module. To support our camera module, we need to update the two parts of the L4T (Linux for Tegra) of the Jetson system, Image and DTB.

In the Image, we added the camera driver, while the DTB indicates the camera model used. In general, you only need to use the Image and DTB, that we have prebuilt, and you don't need to build from source when it is not necessary.

In particular, for Xavier NX, we provide a burning image of the TF card.

3.2 Burning the prebuilt Image to upgrade Jetson Nano and Xavier NX Devkit

This method is no longer recommended because in this mode, the DTB partition reverts to the default value in some cases. It is recommended to use pre-compiled Image and DTB for driver upgrade.

You can use the image prebuild by us to upgrade jetson Xavier NX system, which will support our camera.

Using whole prebuilt image

  • download :

baiduyun:https://pan.baidu.com/s/1sWrcfEOivjuQ7T7P5bVcng

google driver:https://drive.google.com/drive/folders/1KHSMTdyw-ZczR1yJPj-5y9eIv7izbgt3?usp=sharing

If Baidu cloud disk download is too slow, you can contact our company customer service xumm@csoneplus.com to obtain.

  • How to burn

refer to Official document

3.3 BSP package introduction

3.3.1 Path

https://github.com/veyeimaging/nvidia_jetson_veye_bsp

3.3.2 bsp package includes:
  • prebuild linux kernel:Image
  • prebuild dtb for different boards
  • driver source code
  • dts source code
  • i2c toolkits

3.4 DTB file name and Jeton Board

3.4.1 Nano A02

tegra210-p3448-0000-p3449-0000-a02.dtb

3.4.2 Nano B01

tegra210-p3448-0000-p3449-0000-b00.dtb

3.4.3 Nano 2GB

tegra210-p3448-0003-p3542-0000.dtb

3.4.4 TX2 Devkit

tegra186-quill-p3310-1000-c03-00-base.dtb

3.4.5 TX2 NX(p3509-0000 carrier board)

use the same carrier board with XAVIER NX Devkit

tegra186-p3636-0001-p3509-0000-a01.dtb

3.4.6 AGX XAVIER

tegra194-p2888-0001-p2822-0000.dtb

3.4.7 XAVIER NX Devkit

tegra194-p3668-all-p3509-0000.dtb

3.5 Upgrade Jetson Nano and Xavier NX 、AGX Xavier without HOST PC

Note: AGX Xavie Jetpack version >= 4.4 , support this upgrade mode. Earlier versions have not been verified and are not recommended.

3.5.1 Check the current L4T version

First check the current L4T version and try to replace it with the same version.

cat /etc/nv_tegra_release

If it shows:

# R32 (release), REVISION: 4.3......

It means L4t Verion is 32.4.3

3.5.2 Download the bsp package to the Jetson board

On Jetson Nano or Xavier NX:

git clone https://github.com/veyeimaging/nvidia_jetson_veye_bsp.git

3.5.3 Upgrade Image

First, under the bsp package directory, find the corresponding version of the Image package, decompress it, and execute:

sudo cp <path to your Image dir>/Image /boot/Image -f

For Xavier NX Devkit

Need to use the signed file(For example,file inside Image_l4t_r32.*.*_veyecam_signed_4_xavier),copy Image and Image.sig to /boot/ dir on the Jetson Xavier board:

sudo cp <path to your Image dir>/Image /boot/Image -f

sudo cp <path to your Image dir>/Image.sig /boot/Image -f

Effective after restart.

3.5.4 Upgrade dtb

Under the bsp package directory, find the dtb file corresponding to your camera module model and L4T version number.

sudo cp <path to your dtb dir>/<DTB file name> /boot/ -f

Then, edit the / boot/extlinux/extlinux.conf file and add the following line.

FDT /boot/<DTB file name>

Note: <DTB file name> should be replaced with the corresponding dtb name of the mainboard, ensure that the file specified in the FDT line actually exists correctly.

Effective after restart.

3.6 Upgrade Jetson Board using Host PC

3.6.1 Burn the standard Image

Note: if your Jetson board has correctly burned the standard version Image, you can skip this step.

You can burn the standard Image using SDK Manager or following the steps below.

  • Set PATH

Assume SDK install directory is <TOPDIR>.

export TOP_DIR=<absolute path to top dir accroding to your jetpack version and board name;for example /home/xumm/nvidia/nvidia_sdk/JetPack_4.5_Linux_JETSON_XAVIER_NX_DEVKIT/>

export L4T_DIR=$TOP_DIR/Linux_for_Tegra

  • Build default image, flashing to Jetson Board, prepare L4T environment

cd $L4T_DIR

sudo ./apply_binaries.sh  

- Nano

sudo ./flash.sh jetson-qspi-sd mmcblk0p1

sudo ./flash.sh jetson-nano-devkit mmcblk0p1

sudo ./flash.sh jetson-nano-2gb-devkit mmcblk0p1

- TX2

sudo ./flash.sh jetson-tx2 mmcblk0p1

- TX2 NX(p3509-0000 carrier board)

sudo ./flash.sh jetson-xavier-nx-devkit-tx2-nx mmcblk0p1

- AGX Xavier

sudo ./flash.sh jetson-xavier mmcblk0p1

- Xavier NX Devkit

sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1

3.6.2 Download our bsp package for Jetson

cd $L4T_DIR

git clone https://github.com/veyeimaging/nvidia_jetson_veye_bsp.git

export RELEASE_PACK_DIR=$L4T_DIR/nvidia_jetson_veye_bsp

3.6.3 Upgrade Image and DTB

prebuilt Image on github:https://github.com/veyeimaging/nvidia_jetson_veye_bsp/tree/master/kernel_image

  • Installing the Kernel

Whether you use a prebuild kernel or you build it yourself

- Nano and TX2

copy Image to /boot/ dir on the Jetson Nano or TX2 board:

sudo cp <path to your Image dir>/Image /boot/Image -f

- AGX Xavier and Xavier NX Devkit

Need to use the signed file(For example,file inside Image_l4t_r32.*.*_veyecam_signed_4_xavier),copy Image and Image.sig to /boot/ dir on the Jetson Xavier board:

sudo cp <path to your Image dir>/Image /boot/Image -f

sudo cp <path to your Image dir>/Image.sig /boot/Image -f

on the Host PC:

cd $L4T_DIR

sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1

- Xavier NX

on the Host PC:

cd $L4T_DIR

sudo ./flash.sh -k kernel jetson-xavier-nx-devkit mmcblk0p1

  • Flashing dtb file

Enter the recovery mode,and on the Host PC:

cp <path to your dtb dir>/dtbfilename $L4T_DIR/kernel/dtb/ -f

cd $L4T_DIR

- Nano

sudo ./flash.sh -r -k DTB jetson-nano-qspi-sd mmcblk0p1

sudo ./flash.sh -r -k DTB jetson-nano-devkit mmcblk0p1

sudo ./flash.sh -r -k DTB jetson-nano-2gb-devkit mmcblk0p1

- TX2

sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

- TX2 NX(p3509-0000 carrier board)

sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit-tx2-nx mmcblk0p1

- AGX Xavier

sudo ./flash.sh -r -k kernel-dtb jetson-xavier mmcblk0p1

- Xavier NX

sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1

Reset Jetson Board after flashing.

3.7 Are Image and DTB upgrade successful ?

3.7.1 For Image

ls /sys/bus/i2c/drivers/

There should have veye327 veyecam csx307 cssc132 directory.

3.7.2 For DTB

DTB varies from platform and from camera module.

- Nano A02/ Nano 2G

ls /proc/device-tree/host1x/i2c@546c0000/

- Nano B01

ls /proc/device-tree/cam_i2cmux/i2c@*

- TX2 Devkit

ls /proc/device-tree/i2c@3180000/tca9548@70/i2c@*

or

ls /proc/device-tree/i2c@3180000/tca9548@77/i2c@*

- AGX Xavier

ls /proc/device-tree/i2c@3180000/tca9548@70/i2c@*

or

ls /proc/device-tree/i2c@3180000/tca9548@77/i2c@*

- Xavier NX and TX2 NX(p3509-0000 carrier board)

ls /proc/device-tree/cam_i2cmux/i2c@*

You should be able to find the camera model you used.

3.8 Build the drivers from source

Please refer to: Nvidia Jetson platform VEYE and CS series camera driver source code compilation guide.

Could be used for Flashing or Upgrading.

4 Applications and Test

4.1 Check system status

Run the following command to confirm whether the camera is probed.

  • For VEYE-MIPI-327(using VEYE-MIPI-327 dtb)

dmesg | grep veye327  

The output message appears as shown below:

Detected VEYE327 sensor

subdev veye327 X-003b bound

  • VEYE-MIPI-X(using VEYE-MIPI-CAM2M dtb)

dmesg | grep veye  

The output message appears as shown below:

camera id is veyecam

sensor is IMX327/IMX462/IMX385

subdev veyecam X-003b bound

  • For CS-MIPI-IMX307

dmesg | grep csx307  

The output message appears as shown below.:

Detected CS307 sensor

subdev csx307 X-003b bound

  • For CS-MIPI-SC132

dmesg | grep cssc132  

The output message appears as shown below.:

subdev cssc132 X-003b bound

  • Run the following command to check the presence of video node.

ls /dev/video*

The output message appears as shown below.

videoX  

4.2 Video Stream Toolkits Manual

Our camera appears as /dev/videoX device node,where X is between [0-5].

in gstreamer command ,v4l2src has a param device=/dev/videoX to identify which camera to use.

4.2.1 Gstreamer Usage
  • Preview FHD(HW accelerated)

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • Preview FHD(using xvimagesink sink)

export DISPLAY=:0

gst-launch-1.0 -e v4l2src io-mode=4 device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY' ! xvimagesink sync=false

  • Preview 720p@60 (CS-MIPI-IMX307,HW accelerated)

gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)720, framerate=(fraction)60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • Preview 1280*1080@45 (CS-MIPI-SC132,HW accelerated)

gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)1080, framerate=(fraction)45/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • Preview 640*480p@130 (CS-MIPI-IMX307,HW accelerated)

gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)640, height=(int)480, framerate=(fraction)130/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • Preview 2 cameras 1080p HD(HW accelerated)

WIDTH=960

HEIGHT=540

CAPS="video/x-raw,format=(string)UYVY, width=1920, height=1080"

gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=$WIDTH sink_0::height=$HEIGHT sink_1::xpos=$WIDTH sink_1::ypos=0 sink_1::width=$WIDTH sink_1::height=$HEIGHT ! nvoverlaysink v4l2src device=/dev/video0 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp. v4l2src device=/dev/video1 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp.

  • Gstreamer cmd line for OpenCV

I think maybe OpenCV do not support I420 data format input,so you should convert it to BGR format.

gst-launch-1.0 v4l2src ! video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080 ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420 ! nvvidconv ! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink

  • Record FHD in H.264 format to a video file(HW accelerated)

gst-launch-1.0 v4l2src num-buffers=300 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! omxh264enc qp-range=20,20:20,20:-1,-1 ! matroskamux ! queue ! filesink location=videoname.mkv

  • Playback of saved video file (HW accelerated)

gst-launch-1.0 filesrc location=videoname.mkv ! matroskademux ! h264parse ! omxh264dec ! nvoverlaysink

  • Capturing FHD still image  

gst-launch-1.0 v4l2src num-buffers=1 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! jpegenc ! filesink location=jpgname.jpg

4.3 Video Control Toolkits Manual

  • i2c bus description:

For AGX-Xavier and TX2, ADP-N1 has 6 MIPI CSI-2 interface [A-F],the corresponding i2c address is[30-35].

For Xavier NX, TX2 NX,the corresponding i2c address is 9 and10.

For Nano A02,Nano 2GB, the corresponding i2c address is 6.

For Nano B01, the corresponding i2c address is 7 and 8.

It is also the same as the X part of dmesg message:

subdev veyeX X-003b bound

subdev csimx307 X-003b bound

subdev cssc132 X-003b bound

using -b option to identify which bus you want to use.

  • VEYE-MIPI-327

Video Control Toolkits Manual :VEYE-MIPI-327 I2C

  • CS-MIPI-IMX307和CS-MIPI-SC132

Video Control Toolkits Manual :CS-MIPI-X I2C

5 Realtimes RTSO-9001

5.1 Hardware Setup

CS-MIPI-IMX307 and RTSO-9001(TX2)


Matching with Realtimes RTSO-9001, you need to use RTST-RPI adapter board.

Note: the power supply capacity of the MIPI CSI-2 interface of the current version of RTSO-9001 is not enough to support the power requirements of our camera, which requires an additional 5V power supply to the camera. It is not shown in the picture above.

5.2 Software bsp

  • The corresponding directory for Realtimes RTSO-9001, is:

nvidia_jetson_veye_bsp\TX2\JetPack_4.2.2_Linux_RTSO-9001

  • Subject to the agreement with Ruitai, we do not release the source code
  • Our code have been submitted to Realtimes, and customers are advised to contact Realtimes for a complete version of the supported image.

6 References

Jetson start up: https://developer.nvidia.com/embedded/learn/getting-started-jetson

Jetson Download Center: https://developer.nvidia.com/embedded/downloads

Xavier NX: https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit

TX2 development kit: https://developer.nvidia.com/embedded/jetson-tx2-developer-kit

SDK Manager: https://docs.nvidia.com/sdk-manager/index.html

L4T Doc: https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3242/index.htm

TX2 user guide: link

Realtimes website:http://www.realtimes.cn/