Difference between revisions of "VEYE MIPI 290/327 for Jetson Nano"

From wiki_veye
Jump to navigation Jump to search
(27 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[VEYE MIPI 290/327 for Jetson Nano/zh|查看中文]]
 
[[VEYE MIPI 290/327 for Jetson Nano/zh|查看中文]]
===概述===
+
 
===硬件准备及安装===
+
[[VEYE MIPI 290/327 for Jetson Nano|<big><big><big><big>How to use VEYE-MIPI-290/327 camera module on NVIDIA Jetson Nano</big></big></big></big>]]
===软件系统安装及准备===
+
 
===系统更新===
+
===Overview===
====使用编译好的程序====
+
This guide shows how to use VEYE-MIPI-290/327 onJetson Nano. Jetson Nano SDK Version is (Jetpack4.2.2,L4T r32.2.1)and (Jetpack4.3,L4T r32.3.1). We provide two ways to do so: '''Prebuilt Binaries''' or '''Source Code. Yes, It's Open Source!'''
====整体烧写====
+
 
====使用源码进行编译====
+
VEYE-MIPI-290/327 is STARVIS 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.
====动态升级====
+
 
===应用和测试===
+
The new version of Jetson Nano (B01) is supported.
====视频流软件包和测试====
+
 
====视频控制软件包的使用====
+
===Hardware Setup===
 +
Jetson Nano's CSI2 interface is compatible with Raspberry Pi,so both [[Mini Adapter Board]] and [[Adapter Board for Raspberry Pi|Adapter Board]] is supported. In addition,It need a 5V power.
 +
[[File:Jetson nano to Veye327.jpg|center|thumb|600x600px|Connect VEYE to Jetson Nano(A02)]]
 +
[[File:Jetson nano pwr connect.jpg|center|thumb|600x600px|Jetson Nano power wire|alt=]]
 +
[[File:VEYE327 pwr.jpg|center|thumb|600x600px|VEYE-MIPI-290/327 wire|alt=]]<br />
 +
 
 +
===Using prebuilt Image to upgrade Jetson nano system===
 +
You can use the image prebuild by us to upgrade jetson nano system, which will support our camera.
 +
 
 +
Using whole prebuilt image
 +
 
 +
*download :
 +
 
 +
link:https://pan.baidu.com/s/1sWrcfEOivjuQ7T7P5bVcng
 +
 
 +
If Baidu cloud disk download is too slow, you can contact our company customer service ''xumm@csoneplus.com'' to obtain.
 +
 
 +
*How to flashing jetson nano
 +
 
 +
[https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit Official document]
 +
 
 +
===Using source code to upgrade Jetson nano system===
 +
 
 +
====Reference documents====
 +
Jetson Nano system setup, please refer to official document:[https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit get-started-jetson-nano-devkit]. 
 +
 
 +
Development Docs:https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-321/index.html
 +
 
 +
====Setting Up the Environment====
 +
 
 +
*Host PC which runs Ubuntu 18.04/16.04(64-bit).  
 +
 
 +
*NVIDIA® provided L4T release and corresponding sample rootfs for Jetson Nano™ development kit.  
 +
 
 +
*A kernel image , device tree blob (DTB) file and module drivers for the VEYE-MIPI-290/327 camera. The release package contains a kernel binary (Image),DTB files and module drivers, which you can download and rebuild from source.
 +
 
 +
*A jumper pin connected across J48 button header to enable DC power.
 +
*A USB cable (micro USB port) to plug into the recovery port of the Jetson Nano™
 +
*development kit.
 +
*Power cable (5V-4A) to power the Jetson Nano™ board.
 +
*Micro SD card must be connected to the J501 slot.
 +
 
 +
====Host PC environment prepare====
 +
 
 +
*Cross-compiling Toolchain
 +
 
 +
Please refer to [https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fxavier_toolchain.html%23wwpID0ESHA this 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.
 +
 
 +
*Setting Up the Environment
 +
 
 +
Assume SDK install directory is <TOPDIR>,source code is in $L4T_DIR/sources directory.
 +
 
 +
''-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>
 +
 
 +
''-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>
 +
 
 +
''- Common Part''
 +
 
 +
<code>export L4T_DIR=$TOP_DIR/Linux_for_Tegra</code>
 +
 
 +
<code>export LOCALVERSION=-tegra</code>
 +
 
 +
<code>export LDK_ROOTFS_DIR=$TOP_DIR/Linux_for_Tegra/rootfs</code>
 +
 
 +
<code>export ARCH=arm64</code>
 +
 
 +
<code>export CROSS_COMPILE=aarch64-linux-gnu-</code>
 +
 
 +
<code>export CROSS32CC=arm-linux-gnueabihf-gcc</code>
 +
 
 +
<code>mkdir -p $L4T_DIR/sources/kernel/out_kernel</code>
 +
 
 +
<code>export TEGRA_KERNEL_OUT=$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>
 +
 
 +
*Build default image, prepare L4T environment
 +
 
 +
<code>cd $L4T_DIR</code>
 +
 
 +
<code>sudo ./apply_binaries.sh</code>  
 +
 
 +
*Download VEYE code for Jetson Nano<code><nowiki/></code><code>cd $L4T_DIR</code>
 +
 
 +
<code>git clone <nowiki>https://github.com/veyeimaging/nvidia_jetson_veye_bsp.git</nowiki></code>
 +
 
 +
<code>export RELEASE_PACK_DIR=$L4T_DIR/nvidia_jetson_veye_bsp</code>
 +
 
 +
====Using prebuild Image and DTB====
 +
 
 +
=====Installing the Kernel and DTS=====
 +
<code>cd $RELEASE_PACK_DIR/kernel_image</code>
 +
 
 +
- ''Jetpack4.2.2''
 +
 
 +
<code>tar -xzvf Image_l4t_r32.2.1_veyecam.tar.gz</code>
 +
 
 +
<code>sudo cp Image $L4T_DIR/kernel/ -f</code>
 +
 
 +
<code>sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-a02.dtb $L4T_DIR/kernel/dtb/ -f</code>
 +
 
 +
<code>sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-b00.dtb $L4T_DIR/kernel/dtb/ -f</code>
 +
 
 +
- ''Jetpack4.3''
 +
 
 +
<code>tar -xzvf Image_l4t_r32.3.1_veyecam.tar.gz</code>
 +
 
 +
<code>sudo cp Image $L4T_DIR/kernel/ -f</code>
 +
 
 +
<code>sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-a02.dtb $L4T_DIR/kernel/dtb/ -f</code>
 +
 
 +
<code>sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-b00.dtb $L4T_DIR/kernel/dtb/ -f</code>
 +
 
 +
<code>cd $L4T_DIR</code>
 +
 
 +
====Flashing the Jetson Nano Development Kit====
 +
The steps to flash the Jetson Nano™ development kit are as follows:
 +
 
 +
#Ensure a jumper is connected across J48 button header to enable DC power.
 +
#Connect the micro USB cable to the Jetson Nano™ and host PC.
 +
#Set the board to recovery mode, as mentioned in below steps:
 +
 
 +
           a. Power OFF the board.
 +
 
 +
         b. For Jetson Nano A02: Connect the jumper pin to the pin 3 and pin 4 of the J40 button header. For Jetson Nano B01: Connect the jumper pin to the pin 9 and pin 10 of the J50 button header.
 +
 
 +
           c. Power ON the Jetson Nano™ development kit.
 +
 
 +
If the board is successfully changed to recovery mode, the Jetson Nano™development kit will be enumerated as an USB device to the host PC.
 +
 
 +
Run the following command to verify whether the board is in recovery mode.
 +
 
 +
<code>lsusb</code>
 +
 
 +
The output message appears as shown below.
 +
 
 +
<code>Bus 001 Device 102: ID 0955:7f21 NVidia Corp.</code>
 +
 
 +
4. Run the following commands to flash the Jetson Nano™ development kit from
 +
 
 +
your host PC.
 +
 
 +
<code>cd $L4T_DIR</code>
 +
 
 +
<code>sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1</code>
 +
 
 +
Note: Now, the entire micro SD on the Jetson Nano™ development kit will be erased. It will take about 10-30 minutes to complete depending on the host PC configuration.
 +
 
 +
5. Reboot and connect the Jetson Nano™ board to a monitor and keyboard to complete the OS configuration, once flashing is completed.
 +
====Building from Source====
 +
=====Build kernel=====
 +
 
 +
*patch code
 +
 
 +
<code>cp $RELEASE_PACK_DIR/drivers_source/cs_imx307\ veye327/* $NVIDIA_PATH/drivers/media/i2c/</code>
 +
 
 +
''- r32.2.1''
 +
 
 +
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.2.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig</code>
 +
 
 +
''- r32.3.1''
 +
 
 +
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig</code>
 +
 
 +
*build
 +
 
 +
<code>cd $L4T_DIR/sources/kernel/kernel-4.9/</code>
 +
 
 +
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_csimx307veye327_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>
 +
=====Build DTS=====
 +
 
 +
*patch code
 +
 
 +
''- 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>
 +
 
 +
<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>
 +
 
 +
''- Jetpack4.3''
 +
 
 +
<code>cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/common/t210/* -r $NANO_DTS_PATH/</code>
 +
 
 +
<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>
 +
 
 +
*build
 +
 
 +
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs</code>
 +
 
 +
<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>
 +
 
 +
Could be used for Flashing or Upgrading.
 +
====Upgrading Kernel Image and Supplements====
 +
First,you should copy '''Image''' file to Jetson nano somehow. Use a U disk for example.
 +
 
 +
<code>sudo cp <path to your Image dir>/Image  /boot/Image -f</code>
 +
====Upgrading DTB File by Flashing from Host PC====
 +
Burning process reference 4.3, burning commands is as below:
 +
 
 +
<code>cd $L4T_DIR</code>
 +
 
 +
<code>sudo ./flash.sh -r -k DTB jetson-nano-qspi-sd mmcblk0p1</code>
 +
 
 +
Power off after flashing finished.
 +
===Applications and Test===
 +
 
 +
====Check system status====
 +
The steps to verify the setup before testing Gstreamer pipelines are as follows:
 +
 
 +
1. Run the following commands to check the Gstreamer-1.0 version.
 +
 
 +
<code>$ gst-inspect-1.0 --version</code>
 +
 
 +
<code>gst-inspect-1.0 version 1.14.4</code>
 +
 
 +
<code>GStreamer 1.14.4</code>
 +
 
 +
Note: Make sure that VEYE-MIPI-290/327 is connected and the required driversare loaded.
 +
 
 +
During booting, the module drivers for VEYE-MIPI-290/327 will be loaded automatically in the Jetson Nano™ development kit.
 +
 
 +
2. Run the following command to confirm whether the camera is initialized.
 +
 
 +
<code>dmesg | grep “veye327”</code>
 +
 
 +
The output message appears as shown below.
 +
 
 +
<code>subdev veye327 6/7/8-003b bound</code>
 +
 
 +
The output message indicates that the camera is initialized properly.
 +
 
 +
3. Run the following command to check the presence of video node.
 +
 
 +
<u><code>ls /dev/video*</code></u>
 +
 
 +
The output message appears as shown below.
 +
 
 +
<code>video0(1)</code>  
 +
 
 +
====Video Stream Toolkits Manual====
 +
=====Gstreamer Usage=====
 +
 
 +
*Preview FHD(HW accelerated)
 +
 
 +
<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" ! nvoverlaysink sync=false</code>
 +
 
 +
*Record FHD in H.264 format to a video file(HW accelerated)
 +
 
 +
<code>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</code>
 +
 
 +
*Playback of saved video file (HW accelerated)
 +
 
 +
<code>gst-launch-1.0 filesrc location=videoname.mkv ! matroskademux ! h264parse ! omxh264dec ! nvoverlaysink</code>
 +
 
 +
*Capturing FHD still image  
 +
 
 +
<code>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</code>
 +
====Video Control Toolkits Manual====
 +
Jetson Nano A02 use i2c-6 as camera control bus,Jetson Nano B01 use i2c-7 and i2c-8 as camera control bus.
 +
 
 +
Using -b option to identify which bus to use.
 +
 
 +
<code>cd $RELEASE_PACK_DIR/i2c_cmd/bin</code>
 +
 
 +
Video Control Toolkits Manual : [[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-290/327 i2c]]
 +
===Others===
 +
This article and the source code are still in the process of improving. If you have any suggestions for improvement, you are welcome to email xumm#csoneplus.com.

Revision as of 09:18, 12 June 2020

查看中文

How to use VEYE-MIPI-290/327 camera module on NVIDIA Jetson Nano

1 Overview

This guide shows how to use VEYE-MIPI-290/327 onJetson Nano. Jetson Nano SDK Version is (Jetpack4.2.2,L4T r32.2.1)and (Jetpack4.3,L4T r32.3.1). We provide two ways to do so: Prebuilt Binaries or Source Code. Yes, It's Open Source!

VEYE-MIPI-290/327 is STARVIS 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.

The new version of Jetson Nano (B01) is supported.

2 Hardware Setup

Jetson Nano's CSI2 interface is compatible with Raspberry Pi,so both Mini Adapter Board and Adapter Board is supported. In addition,It need a 5V power.

Connect VEYE to Jetson Nano(A02)
Jetson Nano power wire
VEYE-MIPI-290/327 wire


3 Using prebuilt Image to upgrade Jetson nano system

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

Using whole prebuilt image

  • download :

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

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

  • How to flashing jetson nano

Official document

4 Using source code to upgrade Jetson nano system

4.1 Reference documents

Jetson Nano system setup, please refer to official document:get-started-jetson-nano-devkit.

Development Docs:https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-321/index.html

4.2 Setting Up the Environment

  • Host PC which runs Ubuntu 18.04/16.04(64-bit).  
  • NVIDIA® provided L4T release and corresponding sample rootfs for Jetson Nano™ development kit.  
  • A kernel image , device tree blob (DTB) file and module drivers for the VEYE-MIPI-290/327 camera. The release package contains a kernel binary (Image),DTB files and module drivers, which you can download and rebuild from source.
  • A jumper pin connected across J48 button header to enable DC power.
  • A USB cable (micro USB port) to plug into the recovery port of the Jetson Nano™
  • development kit.
  • Power cable (5V-4A) to power the Jetson Nano™ board.
  • Micro SD card must be connected to the J501 slot.

4.3 Host PC environment prepare

  • Cross-compiling Toolchain

Please refer to this link to install toolchain on your Host PC.

  • L4T source code and Rootfs

You could use SDK Manager or directly download to get source code.

  • Setting Up the Environment

Assume SDK install directory is <TOPDIR>,source code is in $L4T_DIR/sources directory.

-Jetpack4.2.2

export TOP_DIR=<absolute path to top dir;in my case is /home/xumm/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3448/>

-Jetpack4.3

export TOP_DIR=<absolute path to top dir;in my case is /home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_JETSON_NANO_DEVKIT/>

- Common Part

export L4T_DIR=$TOP_DIR/Linux_for_Tegra

export LOCALVERSION=-tegra

export LDK_ROOTFS_DIR=$TOP_DIR/Linux_for_Tegra/rootfs

export ARCH=arm64

export CROSS_COMPILE=aarch64-linux-gnu-

export CROSS32CC=arm-linux-gnueabihf-gcc

mkdir -p $L4T_DIR/sources/kernel/out_kernel

export TEGRA_KERNEL_OUT=$L4T_DIR/sources/kernel/out_kernel

export NVIDIA_PATH=$L4T_DIR/sources/kernel/nvidia

export NANO_DTS_PATH=$L4T_DIR/sources/hardware/nvidia/platform/t210/

  • Build default image, prepare L4T environment

cd $L4T_DIR

sudo ./apply_binaries.sh  

  • Download VEYE code for Jetson Nanocd $L4T_DIR

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

export RELEASE_PACK_DIR=$L4T_DIR/nvidia_jetson_veye_bsp

4.4 Using prebuild Image and DTB

4.4.1 Installing the Kernel and DTS

cd $RELEASE_PACK_DIR/kernel_image

- Jetpack4.2.2

tar -xzvf Image_l4t_r32.2.1_veyecam.tar.gz

sudo cp Image $L4T_DIR/kernel/ -f

sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-a02.dtb $L4T_DIR/kernel/dtb/ -f

sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-b00.dtb $L4T_DIR/kernel/dtb/ -f

- Jetpack4.3

tar -xzvf Image_l4t_r32.3.1_veyecam.tar.gz

sudo cp Image $L4T_DIR/kernel/ -f

sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-a02.dtb $L4T_DIR/kernel/dtb/ -f

sudo cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/VEYE-MIPI-327/tegra210-p3448-0000-p3449-0000-b00.dtb $L4T_DIR/kernel/dtb/ -f

cd $L4T_DIR

4.5 Flashing the Jetson Nano Development Kit

The steps to flash the Jetson Nano™ development kit are as follows:

  1. Ensure a jumper is connected across J48 button header to enable DC power.
  2. Connect the micro USB cable to the Jetson Nano™ and host PC.
  3. Set the board to recovery mode, as mentioned in below steps:

    a. Power OFF the board.

    b. For Jetson Nano A02: Connect the jumper pin to the pin 3 and pin 4 of the J40 button header. For Jetson Nano B01: Connect the jumper pin to the pin 9 and pin 10 of the J50 button header.

    c. Power ON the Jetson Nano™ development kit.

If the board is successfully changed to recovery mode, the Jetson Nano™development kit will be enumerated as an USB device to the host PC.

Run the following command to verify whether the board is in recovery mode.

lsusb

The output message appears as shown below.

Bus 001 Device 102: ID 0955:7f21 NVidia Corp.

4. Run the following commands to flash the Jetson Nano™ development kit from

your host PC.

cd $L4T_DIR

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

Note: Now, the entire micro SD on the Jetson Nano™ development kit will be erased. It will take about 10-30 minutes to complete depending on the host PC configuration.

5. Reboot and connect the Jetson Nano™ board to a monitor and keyboard to complete the OS configuration, once flashing is completed.

4.6 Building from Source

4.6.1 Build kernel
  • patch code

cp $RELEASE_PACK_DIR/drivers_source/cs_imx307\ veye327/* $NVIDIA_PATH/drivers/media/i2c/

- r32.2.1

cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.2.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig

- r32.3.1

cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig

  • build

cd $L4T_DIR/sources/kernel/kernel-4.9/

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_csimx307veye327_defconfig

make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j4

Completed Image file is $TEGRA_KERNEL_OUT/arch/arm64/boot/Image,could be used for Flashing or Upgrading.

Install Image for Flashing:

sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $L4T_DIR/kernel/ -f

4.6.2 Build DTS
  • patch code

- Jetpack4.2.2

cp $RELEASE_PACK_DIR/Nano/JetPack_4.2.2_Linux_GA_P3448/dts\ dtb/common/t210/* -r $NANO_DTS_PATH/

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

- Jetpack4.3

cp $RELEASE_PACK_DIR/Nano/JetPack_4.3_Linux_P3448/dts\ dtb/common/t210/* -r $NANO_DTS_PATH/

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

  • build

make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs

cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra210-p3448-0000-p3449-0000-a02.dtb $L4T_DIR/kernel/dtb/

cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra210-p3448-0000-p3449-0000-b00.dtb $L4T_DIR/kernel/dtb/

Could be used for Flashing or Upgrading.

4.7 Upgrading Kernel Image and Supplements

First,you should copy Image file to Jetson nano somehow. Use a U disk for example.

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

4.8 Upgrading DTB File by Flashing from Host PC

Burning process reference 4.3, burning commands is as below:

cd $L4T_DIR

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

Power off after flashing finished.

5 Applications and Test

5.1 Check system status

The steps to verify the setup before testing Gstreamer pipelines are as follows:

1. Run the following commands to check the Gstreamer-1.0 version.

$ gst-inspect-1.0 --version

gst-inspect-1.0 version 1.14.4

GStreamer 1.14.4

Note: Make sure that VEYE-MIPI-290/327 is connected and the required driversare loaded.

During booting, the module drivers for VEYE-MIPI-290/327 will be loaded automatically in the Jetson Nano™ development kit.

2. Run the following command to confirm whether the camera is initialized.

dmesg | grep “veye327”

The output message appears as shown below.

subdev veye327 6/7/8-003b bound

The output message indicates that the camera is initialized properly.

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

ls /dev/video*

The output message appears as shown below.

video0(1)  

5.2 Video Stream Toolkits Manual

5.2.1 Gstreamer Usage
  • Preview FHD(HW accelerated)

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" ! nvoverlaysink sync=false

  • 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

5.3 Video Control Toolkits Manual

Jetson Nano A02 use i2c-6 as camera control bus,Jetson Nano B01 use i2c-7 and i2c-8 as camera control bus.

Using -b option to identify which bus to use.

cd $RELEASE_PACK_DIR/i2c_cmd/bin

Video Control Toolkits Manual : VEYE-MIPI-290/327 i2c

6 Others

This article and the source code are still in the process of improving. If you have any suggestions for improvement, you are welcome to email xumm#csoneplus.com.