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.
- 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.
2 BSP package introduction
2.1 Path
https://github.com/veyeimaging/nvidia_jetson_veye_bsp
2.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
3 DTB file corresponds to Jetson boards
3.1 Nano A02
tegra210-p3448-0000-p3449-0000-a02.dtb
3.2 Nano B01 Devkit
tegra210-p3448-0000-p3449-0000-b00.dtb
3.3 Nano B01 4G emmc
tegra210-p3448-0002-p3449-0000-b00.dtb
3.4 Nano 2GB
tegra210-p3448-0003-p3542-0000.dtb
3.5 TX2 Devkit
tegra186-quill-p3310-1000-c03-00-base.dtb
3.6 TX2 NX(p3509-0000 carrier board)
use the same carrier board with XAVIER NX Devkit
tegra186-p3636-0001-p3509-0000-a01.dtb
3.7 AGX XAVIER
tegra194-p2888-0001-p2822-0000.dtb
3.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
3.9 AGX Orin
tegra234-p3701-0000-p3737-0000.dtb
3.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
3.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
4 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..
5 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.
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
5.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.
5.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
5.4 Upgrade Image(For Jetpack4.x or MV series cameras)
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.
5.5 install camera modules(For Jetpack5.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)/* /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
5.5.1 General
Register the modules to the system by executing the following command.
sudo depmod
5.5.2 Special
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.
5.6 Upgrade dtb
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 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.
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-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
6.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
6.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.
7 Are Image and DTB upgrade successful ?
7.1 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/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.
7.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.
8 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
9 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.