GMSL serializer/deserializer Linux driver: Difference between revisions

From RidgeRun Developer Wiki
mNo edit summary
No edit summary
 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Description =  
<seo title=" MAX96709 MAX96706 GMSL Serializer Deserializer | Jetson TX1 TX2 Linux Driver" titlemode="replace" metakeywords=" GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, Jetson, TX1, TX2, Jetson TX1, Jetson TX2, Xavier, Jetson Xavier, NVIDIA Jetson Xavier, GMSL, GMSL serializer, GMSL deserializer, MAX96709, MAX96706" metadescription="This wiki page provides information regarding the GMSL serializer & deserializer Linux driver for Jetson TX1 TX2."></seo>
 
{{Mpo-shoppingcart & NVIDIA logo & RR Contact}}
<br>
<td>
{{GStreamer debug}}
</td>
 
{{message|title=Driver List Information|Refer to the [[RidgeRun_Linux_Camera_Drivers/Available_Camera_Drivers/List_of_Tested_Camera_Sensors|RidgeRun Linux Camera Drivers]] to meet all the list of Drivers available}}
 
== GMSL Description ==  


Gigabit Multimedia Serial Link (GMSL) are line drivers and receivers designed for video applications.
Gigabit Multimedia Serial Link (GMSL) are line drivers and receivers designed for video applications.


The MAX96706 is a compact deserializer especially suited for automotive camera applications.
The MAX96706 is a compact deserializer especially suited for automotive camera applications.
The MAX96709 is a compact serializer especially suited for automotive camera applications. The embedded control channel operates at 9.6kbps to 1Mbps in I2C mode, allowing programming of serializer, deserializer, and camera registers independent of video timing.
The MAX96709 is a compact serializer especially suited for automotive camera applications. The embedded control channel operates at 9.6kbps to 1Mbps in I2C mode, allowing the programming of serializer, deserializer, and camera registers independent of video timing.
 
<br> [[Image:GMSL-diagram.png|thumb|center|679px|GMSL-diagram.png]]


= Contact =
<br> [[Image:GMSL-diagram2.png|thumb|center|679px|GMSL-diagram.png]]
To contact RidgeRun's maintainers team please send an email to [mailto:support@ridgerun.com support@ridgerun.com]. <br>
For purchase related query please email to '''inquiries@ridgerun.com''' or You can submit your Inquiry at our  [http://www.ridgerun.com/contact Contact Us Page]


=Build Driver=
==Build GMSL serializer/deserializer driver==
 
==Build kernel using Jetpack 2.3.1==


===Build kernel using Jetpack 2.3.1===


Let's call $DEVDIR the path where you are going to build the kernel.
Let's call $DEVDIR the path where you are going to build the kernel.


'''1.''' In a browser, navigate to: https://developer.nvidia.com/embedded/downloads, Locate and download the L4T Sources (L4T Sources 24.2.1 2016/11/21). Also, you can use wget command:
'''1.''' In a browser, navigate to https://developer.nvidia.com/embedded/downloads, Locate and download the L4T Sources (L4T Sources 24.2.1 2016/11/21). Also, you can use wget command:


  wget http://developer2.download.nvidia.com/embedded/L4T/r24_Release_v2.1/BSP/sources_r24.2.1.tbz2
  wget http://developer2.download.nvidia.com/embedded/L4T/r24_Release_v2.1/BSP/sources_r24.2.1.tbz2
Line 43: Line 48:
</pre>
</pre>


'''5.''' Compile the kernel. Specify the path to the toolchain and architecture: (see http://developer.ridgerun.com/wiki/index.php?title=Compiling_Tegra_X1_source_code#Toolchain)
'''5.''' Compile the kernel. Specify the path to the toolchain and architecture: (see [[Compiling_Jetson_TX1/TX2_source_code#Toolchain | Toolchain]])
<pre>
<pre>
export CROSS_COMPILE=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export CROSS_COMPILE=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
Line 52: Line 57:
'''6.''' Define and create destination directories.
'''6.''' Define and create destination directories.
<pre>
<pre>
export TEGRA_KERNEL_OUT=/home/$USER/ar0144_kernel/images
export TEGRA_KERNEL_OUT=/home/$USER/gmsl_kernel/images
export TEGRA_MODULES_OUT=/home/$USER/ar0144_kernel/modules
export TEGRA_MODULES_OUT=/home/$USER/gmsl_kernel/modules
mkdir -p $TEGRA_KERNEL_OUT
mkdir -p $TEGRA_KERNEL_OUT
mkdir -p $TEGRA_MODULES_OUT
mkdir -p $TEGRA_MODULES_OUT
Line 88: Line 93:
</pre>
</pre>


== Test your Kernel image using Jetpack 2.3.1 root file system==
=== Test your Kernel image using Jetpack 2.3.1 root file system===


'''1.''' Go to Linux_for_Tegra_64_tx1 directory. Let's call $JETPACKDIR the path where you installed your development directory or Jetpack.
'''1.''' Go to Linux_for_Tegra_64_tx1 directory. Let's call $JETPACKDIR the path where you installed your development directory or Jetpack.
Line 141: Line 146:
</pre>
</pre>


'''8.''' Check kernel version. At this moment you can test the image created in order to see the new kernel is working correctly. You have to see a new kernel version:
'''8.''' Check the kernel version. At this moment you can test the image created in order to see the new kernel is working correctly. You have to see a new kernel version:


<pre>
<pre>
Line 148: Line 153:
</pre>
</pre>


==Check Driver==
===Check Driver===


These commands are not mandatory, but you can confirm if the drivers have been loaded during the boot process.
These commands are not mandatory, but you can confirm if the drivers have been loaded during the boot process.
Line 154: Line 159:
'''1.'''Check I2C bus detection
'''1.'''Check I2C bus detection


Serializer, deserializer and FPGA i2c addresses can be detected on i2cbus 6
Serializer, deserializer i2c addresses can be detected on i2cbus 6


<pre>
<pre>
Line 160: Line 165:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --  
00:          -- -- -- -- -- -- -- -- -- -- -- -- --  
10: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  
Line 169: Line 174:
</pre>
</pre>


'''2.''' Check if serializer, deserializer, FPGA and ar0144 driver are loaded successfully. You can run use dmesg command to see the drivers were registered
'''2.''' Check if the serializer, deserializer drivers are loaded successfully. You can run use dmesg command to see the drivers were registered


<pre>
<pre>
ubuntu@tegra-ubuntu:~$ dmesg | grep "GMSL"
ubuntu@tegra-ubuntu:~$ dmesg | grep "GMSL"
[    4.403599] inscopix_sd 6-0058: GMSL deserializer registered.
[    4.403599] deserializer 6-0058: GMSL deserializer registered.
[    4.566541] inscopix_sd 6-0040: GMSL serializer registered.
[    4.566541] serializer 6-0040: GMSL serializer registered.
</pre>
</pre>


Line 184: Line 189:
</pre>
</pre>


[[Category:TegraX1]][[Category:BoardDocumentation]]
===GStreamer pipelines===
 
These pipelines are used to test the serializer and deserializer driver
 
'''xvimagesink'''
 
<pre>
DISPLAY=:0 gst-launch-1.0 nvcamerasrc num-buffers=2200 queue-size=10 sensor-id=0 wbmode=off auto-exposure=off wbManualMode=off flash=off  color-effect=off scene-mode=0 fpsRange='60 60' ! \
'video/x-raw(memory:NVMM), width=1280, height=800,format=I420,framerate=60/1' ! \
nvvidconv ! \
xvimagesink &
</pre>
 
'''NVsink'''
 
<pre>
DISPLAY=:0 gst-launch-1.0 nvcamerasrc num-buffers=2200 queue-size=10 sensor-id=0 wbmode=off auto-exposure=off wbManualMode=off flash=off  color-effect=off scene-mode=0 fpsRange='60 60' ! \
'video/x-raw(memory:NVMM), width=1280, height=800,format=I420,framerate=60/1' ! \
nvoverlaysink
</pre>
 
'''EGL window'''
 
<pre>
DISPLAY=:0 gst-launch-1.0 nvcamerasrc num-buffers=108000 queue-size=10 sensor-id=0 wbmode=off auto-exposure=off wbManualMode=off flash=off  color-effect=off scene-mode=0 fpsRange='60 60' ! \
'video/x-raw(memory:NVMM), width=1280, height=800,format=I420,framerate=60/1' ! \
nvegltransform ! nveglglessink
</pre>
 
== See also ==
[[MAX96705 MAX9286 GMSL SERDES Linux Drivers]]
 
{{ContactUs}}
 
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:Maxim]]

Latest revision as of 21:08, 18 September 2024



Problems running the pipelines shown on this page? Please see our GStreamer Debugging guide for help.

Driver List Information
Refer to the RidgeRun Linux Camera Drivers to meet all the list of Drivers available


GMSL Description

Gigabit Multimedia Serial Link (GMSL) are line drivers and receivers designed for video applications.

The MAX96706 is a compact deserializer especially suited for automotive camera applications. The MAX96709 is a compact serializer especially suited for automotive camera applications. The embedded control channel operates at 9.6kbps to 1Mbps in I2C mode, allowing the programming of serializer, deserializer, and camera registers independent of video timing.


GMSL-diagram.png

Build GMSL serializer/deserializer driver

Build kernel using Jetpack 2.3.1

Let's call $DEVDIR the path where you are going to build the kernel.

1. In a browser, navigate to https://developer.nvidia.com/embedded/downloads, Locate and download the L4T Sources (L4T Sources 24.2.1 2016/11/21). Also, you can use wget command:

wget http://developer2.download.nvidia.com/embedded/L4T/r24_Release_v2.1/BSP/sources_r24.2.1.tbz2

2. Copy L4T kernel sources into DEVDIR.

cp sources_r24.2.1.tbz2 $DEVDIR

3. Expand tarball file.

tar -vxjf sources_r24.2.1.tbz2
# Decompress kernel
cd sources/
tar -xjf kernel_src.tbz2

4. Download GMSL serializer/deserializer driver patches and apply the patches.

cd $DEVDIR
tar -xzvf gmsl-r24.2.1-tx1.tar.gz
quilt push -a

5. Compile the kernel. Specify the path to the toolchain and architecture: (see Toolchain)

export CROSS_COMPILE=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export CROSS32CC=/opt/linaro/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
export ARCH=arm64

6. Define and create destination directories.

export TEGRA_KERNEL_OUT=/home/$USER/gmsl_kernel/images
export TEGRA_MODULES_OUT=/home/$USER/gmsl_kernel/modules
mkdir -p $TEGRA_KERNEL_OUT
mkdir -p $TEGRA_MODULES_OUT

7. Configure your kernel

make -C sources/kernel/ O=$TEGRA_KERNEL_OUT tegra21_defconfig

8. Enable driver

make -C sources/kernel/ O=$TEGRA_KERNEL_OUT menuconfig

Select the driver. The menu option is located:

-> Device Drivers
  -> Multimedia support (MEDIA_SUPPORT [=y])
    -> Encoders, decoders, sensors and other helper chips
       <*> GMSL Serializer Deserializer driver

Save your new configuration.

9. Compile kernel, device tree and modules. To speed up compilation on multiprocessor systems, use -j n, this option tells make to execute many recipes simultaneously.

make -C sources/kernel/ O=$TEGRA_KERNEL_OUT zImage
make -C sources/kernel/ O=$TEGRA_KERNEL_OUT dtbs
make -C sources/kernel/ O=$TEGRA_KERNEL_OUT modules
make -C sources/kernel/ O=$TEGRA_KERNEL_OUT modules_install INSTALL_MOD_PATH=$TEGRA_MODULES_OUT

Test your Kernel image using Jetpack 2.3.1 root file system

1. Go to Linux_for_Tegra_64_tx1 directory. Let's call $JETPACKDIR the path where you installed your development directory or Jetpack.

cd $JETPACKDIR/64_TX1/Linux_for_Tegra_64_tx1/

2. Put the board into force USB Recovery Mode:

1. Power down the device. If connected, remove the AC adapter from the device. The device must be
powered OFF, and not in a suspend or sleep state.
2. Connect the Micro-B plug on the USB cable to the Recovery (USB Micro-B) Port on the device and
the other end to an available USB port on the host PC.
3. Connect the power adapter to the device.
4. Press POWER button
5. Press and hold the RECOVERY FORCE (REC) button.
6. While pressing the RECOVERY FORCE button, press and release the RESET button.
7. Wait 2 seconds and release the RECOVERY FORCE button

3. Use ./flash.sh in order to configure TX1 board, Also this script configures jetpack rootfs to be used as SD filesystem. Execute the script as follows:

sudo ./flash.sh jetson-tx1 mmcblk1p1

4. Create ext4 partition called "rootfs".

 sudo mkfs.ext4 /dev/mmcblk0p1 -L "rootfs"

5. Copy rootfs from jetpack 2.3.1

sudo cp -a $JETPACKDIR/64_TX1/Linux_for_Tegra_tx1/rootfs/* /media/$USER/rootfs/

6. Copy kernel image, device tree, and modules.

cd $TEGRA_KERNEL_OUT
cp -a arch/arm64/boot/Image /media/$USER/rootfs/boot/Image 
cp -a arch/arm64/boot/dts/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb /media/$USER/rootfs/boot/tegra210-jetson-tx1-p2597-2180-a01-devkit.dtb
cd $TEGRA_MODULES_OUT
sudo cp -a lib/* /media/$USER/rootfs/lib/

7. Unmount the device and Put the SD into the TX1 board, and boot the board.

umount /media/$USER/rootfs 

8. Check the kernel version. At this moment you can test the image created in order to see the new kernel is working correctly. You have to see a new kernel version:

uname -a
Linux tegra-ubuntu 3.10.96+ #1 SMP PREEMPT Tue May 2 14:08:05 CST 2017 aarch64 aarch64 aarch64 GNU/Linux

Check Driver

These commands are not mandatory, but you can confirm if the drivers have been loaded during the boot process.

1.Check I2C bus detection

Serializer, deserializer i2c addresses can be detected on i2cbus 6

ubuntu@tegra-ubuntu:~$ sudo i2cdetect -r -y 6
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                               

2. Check if the serializer, deserializer drivers are loaded successfully. You can run use dmesg command to see the drivers were registered

ubuntu@tegra-ubuntu:~$ dmesg | grep "GMSL"
[    4.403599] deserializer 6-0058: GMSL deserializer registered.
[    4.566541] serializer 6-0040: GMSL serializer registered.

3. Check new video devices files:

ubuntu@tegra-ubuntu:~$ ls /dev/video0 
/dev/video0

GStreamer pipelines

These pipelines are used to test the serializer and deserializer driver

xvimagesink

DISPLAY=:0 gst-launch-1.0 nvcamerasrc num-buffers=2200 queue-size=10 sensor-id=0 wbmode=off auto-exposure=off wbManualMode=off flash=off  color-effect=off scene-mode=0 fpsRange='60 60' ! \
'video/x-raw(memory:NVMM), width=1280, height=800,format=I420,framerate=60/1' ! \
nvvidconv ! \
xvimagesink &

NVsink

DISPLAY=:0 gst-launch-1.0 nvcamerasrc num-buffers=2200 queue-size=10 sensor-id=0 wbmode=off auto-exposure=off wbManualMode=off flash=off  color-effect=off scene-mode=0 fpsRange='60 60' ! \
'video/x-raw(memory:NVMM), width=1280, height=800,format=I420,framerate=60/1' ! \
nvoverlaysink

EGL window

DISPLAY=:0 gst-launch-1.0 nvcamerasrc num-buffers=108000 queue-size=10 sensor-id=0 wbmode=off auto-exposure=off wbManualMode=off flash=off  color-effect=off scene-mode=0 fpsRange='60 60' ! \
'video/x-raw(memory:NVMM), width=1280, height=800,format=I420,framerate=60/1' ! \
nvegltransform ! nveglglessink 

See also

MAX96705 MAX9286 GMSL SERDES Linux Drivers


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us
RidgeRun.ai: Artificial Intelligence | Generative AI | Machine Learning

Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering information is available at RidgeRun Engineering Services, RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page.