How to upgrade the Jetson system to support VEYE cameras
1 Overview
This section describes how to upgrade the Jetson system to support our camera module.
1.1 Camera Module List
Series | Model | Status |
---|---|---|
VEYE series | VEYE-MIPI-IMX327S | Done |
VEYE series | VEYE-MIPI-IMX385 | Done |
VEYE series | VEYE-MIPI-IMX462 | Done |
VEYE series | VEYE-MIPI-IMX335 | Done |
CS series | CS-MIPI-IMX307 | Done |
CS series | CS-MIPI-SC132 | Done |
TX2-XAVIER-nCAM Series | CS-TX2-XAVIER-nCAM | Done |
MV series | MV-MIPI-IMX178M | Done |
MV series | MV-MIPI-SC130M | Done |
MV series | MV-MIPI-IMX296M | Done |
MV series | MV-MIPI-IMX287M | Done |
MV series | MV-MIPI-IMX265M | Done |
MV series | MV-MIPI-IMX264M | Done |
RAW series | RAW-MIPI-SC132M | Done |
RAW series | RAW-MIPI-IMX462M | Done |
RAW series | RAW-MIPI-AR0234M | Done |
RAW series | RAW-MIPI-SC535M | Done |
In addition, the driver for the Fpdlink and V-by-One HS connection mode has been finished.
1.2 Jetson Board List
Jetson Board | Status |
---|---|
Nano A02 | Done |
Nano B01 | Done |
Nano 2GB | Done |
TX2 NX | Done |
XAVIER NX | Done |
TX2 Devkit | Done |
AGX Xavier | Done |
AGX Orin | Done |
Orin NX | Done |
Orin Nano | Done |
1.3 Supported L4T versions
- Jetpack4.6.1,L4T r32.7.1
- Jetpack4.6.3,L4T r32.7.3
- Jetpack4.6.4,L4T r32.7.4
- Jetpack4.6.5,L4T r32.7.5
- Jetpack5.0.2,L4T r35.1
- Jetpack5.1,L4T r35.2.1
- Jetpack5.1.1,L4T r35.3.1
- Jetpack5.1.2,L4T r35.4.1
- Jetpack5.1.3,L4T r35.5
- Jetpack6.0,L4T r36.3
1.4 How to check the current L4T version
On Jetson board
cat /etc/nv_tegra_release
If it shows:
# R32 (release), REVISION: 7.1......
It means L4t Version is 32.7.1, and the Jetpack version is 4.6.1.
2 Jetpack version differences
- Jetpack4.x versions
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.
- Jetpack5.x versions
The driver is no longer compiled into the Image, but loaded into the system as a separate module. The dtb file is still compiled together as a whole to facilitate replacement.
The dtb can also be loaded dynamically as an overlay. Refer to the official nVidia Developer's Guide for NVIDIA® Jetson™ Linux for details.
- Jetpack6.x versions
The drivers are no longer compiled into the Image but are loaded into the system as independent modules.
The dtb is also no longer compiled together as a whole but is dynamically loaded using the OVERLAYS mechanism. The advantage of this approach is that it better accommodates third-party boards.
- For MV series camera
For the MV series modules, to support extended data types and external trigger modes, it is necessary to add relevant features to the existing system in addition to adding the camera driver.
For Jetpack 4.x and Jetpack 5.x, we have added the relevant features to the Image, so updating the Image is required.
For Jetpack 6.x, the new features are presented as independent drivers, so updating the driver files is necessary.
3 BSP package introduction
3.1 Path
https://github.com/veyeimaging/nvidia_jetson_veye_bsp
3.2 bsp package includes:
- prebuilt dtb for different boards
- driver source code
- dts source code
- i2c toolkits
In release packages
- prebuilt linux kernel:Image
- prebuilt camera drivers
4 DTB file corresponds to Jetson boards
4.1 Nano A02
tegra210-p3448-0000-p3449-0000-a02.dtb
4.2 Nano B01 Devkit
tegra210-p3448-0000-p3449-0000-b00.dtb
4.3 Nano B01 4G emmc
tegra210-p3448-0002-p3449-0000-b00.dtb
4.4 Nano 2GB
tegra210-p3448-0003-p3542-0000.dtb
4.5 TX2 Devkit
tegra186-quill-p3310-1000-c03-00-base.dtb
4.6 TX2 NX(p3509-0000 carrier board)
use the same carrier board with XAVIER NX Devkit
tegra186-p3636-0001-p3509-0000-a01.dtb
4.7 AGX XAVIER
tegra194-p2888-0001-p2822-0000.dtb
4.8 XAVIER NX Devkit
tegra194-p3668-all-p3509-0000.dtb
Specially, For Jetpack5.x, must use this dtb:
- Jetson Xavier NX (P3668-0000) For developer kit only:
tegra194-p3668-0000-p3509-0000.dtb
- Jetson Xavier NX (P3668-0001) Commercial module:
tegra194-p3668-0001-p3509-0000.dtb
4.9 AGX Orin
tegra234-p3701-0000-p3737-0000.dtb
4.10 Orin NX
- Jetson Orin NX 16G(P3767-0000):
tegra234-p3767-0000-p3768-0000-a0.dtb
- Jetson Orin NX 8G (P3767-0001):
tegra234-p3767-0001-p3768-0000-a0.dtb
4.11 Orin Nano
- Jetson Orin Nano 8G(P3767-0003) and Jetson Orin Nano Devkit(P3767-0005):
tegra234-p3767-0003-p3768-0000-a0.dtb
- Jetson Orin Nano 4G (P3767-0004):
tegra234-p3767-0004-p3768-0000-a0.dtb
5 DTB file name and camera module correspondence
Under the dtb directory of each motherboard, the directory corresponding to the camera model is stored, and you can usually know the corresponding camera model directly by the directory name.
Specially:
1, VEYE-MIPI-CAM2M is the new version of VEYE series dtb, which supports all VEYE 2M series products, including VEYE-MIPI-327E, VEYE-MIPI-IMX327S, VEYE-MIPI-IMX462, VEYE-MIPI-IMX385.
2, The ones with fpdlink as suffix correspond to fpdlink coaxial model module.
3,MV-MIPI-MVCAM is the common dtb for all MV series and RAW series cameras, excluding RAW-MIPI-AR0234M and RAW-MIPI-IMX462M..
6 Upgrade directly on the jetson board
Applicable models: Jetson Nano, Xavier and Orin.
Note: AGX Xavie Jetpack version >= 4.4 , support this upgrade mode. Earlier versions have not been verified and are not recommended.
6.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
6.2 Note about L4T 32.7. 2
The Image and dts of L4T 32.7.2 are identical to those of L4T 32.7.1, so you can directly use the contents of the L4T 32.7.1 related directory.
In addition, the upgrade requires updating cboot, please refer to the FAQ section.
6.3 Download the bsp package to the Jetson board
On Jetson Board:
wget https://github.com/veyeimaging/nvidia_jetson_veye_bsp/releases/latest/download/nvidia_jetson_veye_bsp.tar.gz
Or type in the address bar of your browser:https://github.com/veyeimaging/nvidia_jetson_veye_bsp/releases/latest/download/nvidia_jetson_veye_bsp.tar.gz
tar -xzvf nvidia_jetson_veye_bsp.tar.gz
6.4 Upgrading drives
6.4.1 For Jetpack4.x
Just upgrade the Image, no need to install separate modules.
Backup old version Image
cp /boot/Image /boot/Image.backup
cp /boot/Image.sig /boot/Image.sig.backup
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
Effective after restart.
6.5 For Jetpack5.x
Users of MV or RAW series cameras should first upgrade the Image to the Jetpack 4.x version, as detailed in the previous section. Then, follow the steps below to install the modules.
Check linux version:
uname -r
Find the corresponding directory in nvidia_jetson_veye_bsp/ko
:
sudo cp nvidia_jetson_veye_bsp/ko/$(uname -r)/* /lib/modules/$(uname -r)/kernel/drivers/media/i2c/ -f
- Specially,for Jetpack5.1 version:
sudo cp nvidia_jetson_veye_bsp/ko/5.10.104-tegra-l4t35.2.1/* /lib/modules/$(uname -r)/kernel/drivers/media/i2c/ -f
- Specially,for Jetpack5.1.1 version:
sudo cp nvidia_jetson_veye_bsp/ko/5.10.104-tegra-l4t35.3.1/* /lib/modules/$(uname -r)/kernel/drivers/media/i2c/ -f
Upon completion of the copy operation, invoke the following command to register the modules into the system:
sudo depmod
6.6 For Jetpack6.x
Check linux version:
uname -r
Find the corresponding directory in nvidia_jetson_veye_bsp/ko
:
sudo cp nvidia_jetson_veye_bsp/ko/$(uname -r)/downstream/i2c/* /lib/modules/$(uname -r)/updates/drivers/media/i2c/ -f
For MV or RAW series cameras, the following additional drivers are required:sudo cp nvidia_jetson_veye_bsp/ko/$(uname -r)/downstream/terga-camera/tegra-camera.ko /lib/modules/$(uname -r)/updates/drivers/media/platform/tegra/camera -f
sudo cp nvidia_jetson_veye_bsp/ko/$(uname -r)/upstream/*.ko /lib/modules/$(uname -r)/kernel/drivers/media/v4l2-core/ -f
Upon completion of the copy operation, invoke the following command to register the modules into the system:
sudo depmod
6.7 Specialized handling of FPDlink interface cameras(JP5.x and JP6.x)
If using a camera module with fpdlink interface. You must manually control the loading order to ensure that ds90ub954.ko is loaded before the camera driver is loaded.
After the system boots, manually insert the drivers in order, e.g.
sudo insmod ds90ub954.ko
sudo insmod cs_imx307.ko
The command to load the driver can be added to the startup script.
6.8 Upgrade dtb
6.8.1 For Jetpack4.x and Jetpack5.x
Under the bsp package directory, find the dtb file corresponding to your camera module model and L4T version number.
sudo mkdir /boot/veyecam/
sudo cp <path to your dtb dir>/<DTB file name> /boot/veyecam/ -f
Backup extlinux.conf file first
cp /boot/extlinux/extlinux.conf / boot/extlinux/extlinux.conf.back
Then, edit the /boot/extlinux/extlinux.conf file and add the following line.
FDT /boot/veyecam/<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.
6.8.2 For Jetpack6.x
In Jetpack 6.x system, support for preserving the existing device tree blob (dtb) and adding our camera's dtbo as an overlay will greatly facilitate adaptation to third-party versions of the mainboard.
First, identify the currently valid dtb files:
ls /boot/dtb
Edit the `/boot/extlinux/extlinux.conf` file, adding two lines at the bottom to specify the main dtb and the overlay we want to add.
For instance, for the Orin NX Devkit using the VEYE-MIPI-IMX462:
FDT /boot/dtb/kernel_tegra234-p3768-0000+p3767-0001-nv.dtb
OVERLAYS /boot/veyecam/tegra234-p3767-camera-p3768-veyeimx335-dual.dtbo
for the Orin NX Devkit using the RAW-MIPI-AR0234:
FDT /boot/dtb/kernel_tegra234-p3768-0000+p3767-0001-nv.dtb
OVERLAYS /boot/veyecam/tegra234-p3737-camera-raw_ar0234m-overlay.dtbo
for the Orin Nano Devkit using the MV series cameras:
FDT /boot/dtb/kernel_tegra234-p3768-0000+p3767-0005-nv.dtb
OVERLAYS /boot/veyecam/tegra234-p3767-camera-p3768-veye_mvcam-dual.dtbo
7 Upgrade Jetson Board using Host PC
This section provides the second method of upgrading the system.
This method has the same goal as the method in the previous section, and one of the two can be chosen.
This method is complicated and not recommended for Nano, Xavier, Orin.
Specifically, for TX2 systems, only the methods in this section can be taken to upgrade.
7.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-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
7.2 Download our bsp package for Jetson
cd $L4T_DIR
wget https://github.com/veyeimaging/nvidia_jetson_veye_bsp/releases/latest/download/nvidia_jetson_veye_bsp.tar.gz
tar -xzvf nvidia_jetson_veye_bsp.tar.gz
export RELEASE_PACK_DIR=$L4T_DIR/nvidia_jetson_veye_bsp
7.3 Upgrade Image and DTB
Extract the downloaded `nvidia_jetson_veye_bsp.tar.gz`, and locate the Image corresponding to the specific version.
- 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.
8 Are Image and DTB upgrade successful ?
8.1 For DTB
DTB varies from platform and from camera module.
8.1.1 Jetpack4.x and Jetpack5.x
- 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/AGX Orin
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.
8.1.2 Jetpack6.x
- Orin NX and Orin Nano
ls /sys/firmware/devicetree/base/bus@0/cam_i2cmux/i2c@0/
- AGX Xavier and AGX Orin
ls /sys/firmware/devicetree/base/bus@0/i2c@3180000/tca9548@70/i2c@*
You should be able to find the camera model you used.
8.2 For Image
ls /sys/bus/i2c/drivers/
When installing the camera correctly, the relevant directory for the camera should exist, such as veyecam csx307 cssc132 mvcam, etc.
9 Protection against being overwritten by upgrades
After making sure Image and dtb are successfully updated, please execute the following command to prevent kernel and dtb from being overwritten by update.
sudo apt-mark hold nvidia-l4t-kernel nvidia-l4t-kernel-dtbs
10 FAQ and bug list
10.1 Problem of system update not taking effect on a system with an SSD hard drive
If an SSD hard drive is installed in a system and mounted on the / directory, it may cause regular system update operations (Image, ko, dtb) to be completely ineffective.
The reason for this is that the board comes with an eMMC storage device, and the Image, ko, and dtb that take effect during the boot stage are stored in the eMMC.
After the boot is completed, if the SSD hard drive is mounted on the / directory, it may cause the files stored on the eMMC to be inaccessible.
The solution in this case is to manually mount the mmcblk0p1 partition of the eMMC to a specific directory, and perform all system update operations based on this directory.
10.2 VEYE cameras on Jetpack5.x
Jetpack5.x has more stringent requirements for mipi signals in xavier and orin platforms. VEYE-MIPI-xxx series cameras need firmware hdver>=7 to be perfectly supported.
10.3 CS-MIPI-IMX307 combined with Orin nano and Orin NX Green Screen
When CS-MIPI-IMX307 is powered by the 3.3V mode of the FFC cable, the MIPI receiver state machine of Orin nano and Orin NX (Jetpack5.1.1) will enter an incorrect state.
It is recommended to refer to this article and modify the power supply mode of CS-MIPI-IMX307 to use the 5V power supply mode.
10.4 Jetpack5.0.1 DP
This version has many bugs, such as not supporting nvv4l2camerasrc, not recommended to use.
10.5 cboot of L4T32.7.2 on Xavier
For the Xavier series, there is a bug in the cboot of L4T32.7.2 that must be fixed before the upgrade can be done.
[Cboot] Cboot in 32.7.2 fails to read extlinux.conf
We compiled the correct version of cboot and put it here.
After downloading, put it in Linux_for_Tegra/bootloader directory and execute the following command on PC to burn cboot.
- AGX Xavier
sudo ./flash.sh -r -k cpu-bootloader jetson-xavier mmcblk0p1
- Xavier NX
sudo ./flash.sh -r -k cpu-bootloader jetson-xavier-nx-devkit mmcblk0p1
11 Build the drivers from source
Please refer to: Nvidia Jetson platform VEYE camera driver source code compilation guide.
Could be used for Flashing or Upgrading.