Difference between revisions of "OmniVision OV5647 Linux driver for Jetson Nano"
(→5. Apply driver patches) |
m |
||
(17 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | =OV5647 | + | <seo title="Omnivision Linux Drivers | OmniVision OV5647 Linux Driver for Jetson Nano | RidgeRun" 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, OV5647 Jetson Nano, NVIDIA, V4L2 Driver, OmniVision OV5647, OV5647, TX1, TX2, Jetson TX1, Jetson TX2, OmniVision OV5647 image sensor, OV5647 Linux driver" metadescription="RidgeRun's comprehensive overview and features of the Omnivision OV5647 Linux driver for Jetson Nano.!"></seo> |
+ | |||
+ | <table> | ||
+ | <tr> | ||
+ | <td><div class="clear; float:right">__TOC__</div></td> | ||
+ | <td> | ||
+ | {{Shopping cart mpo for V4L2 camera drivers}} | ||
+ | <td> | ||
+ | {{NVIDIA Preferred Partner logo}} | ||
+ | <td> | ||
+ | <td> | ||
+ | {{GStreamer debug}} | ||
+ | <td> | ||
+ | <center> | ||
+ | {{ContactUs Button}} | ||
+ | </center> | ||
+ | </tr> | ||
+ | </table> | ||
+ | <br> | ||
+ | |||
+ | ==Omnivision OV5647 image sensor== | ||
The Omnivision OV5647 is a CMOS image sensor with the following features: | The Omnivision OV5647 is a CMOS image sensor with the following features: | ||
Line 20: | Line 40: | ||
** QVGA (320 x 240): 120 fps | ** QVGA (320 x 240): 120 fps | ||
− | =Enabling the driver= | + | ==Enabling the Omnivision OV5647 Linux driver== |
Follow these instructions to build and install the kernel Image and device tree. | Follow these instructions to build and install the kernel Image and device tree. | ||
− | ====1. Install | + | ==== 1. [[NVIDIA_Jetson_Nano_-_Building_the_Kernel_from_Source#Dependencies Install | dependencies]]==== |
− | + | ==== 2. [[NVIDIA_Jetson_Nano_-_Building_the_Kernel_from_Source#Environment_variables | Set the environment variables for the sources L4T 31-1-0]]==== | |
− | + | ==== 3. [[NVIDIA_Jetson_Nano_-_Building_the_Kernel_from_Source#Toolchain | Install the toolchain]]==== | |
− | ====2. Set the environment variables for the sources L4T 31-1-0==== | ||
− | |||
− | |||
− | ====3. Install the toolchain==== | ||
− | |||
====4. Download the kernel sources==== | ====4. Download the kernel sources==== | ||
Line 37: | Line 52: | ||
<source lang="bash"> | <source lang="bash"> | ||
JETSON_NANO_SOURCES=$(pwd) | JETSON_NANO_SOURCES=$(pwd) | ||
− | wget https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/jetson-nano/BSP/Jetson-Nano-public_sources.tbz2 | + | wget https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/jetson-nano/BSP/Jetson-Nano-public_sources.tbz2 --no-check-certificate |
tar -xvf Jetson-Nano-public_sources.tbz2 | tar -xvf Jetson-Nano-public_sources.tbz2 | ||
cd public_sources/ | cd public_sources/ | ||
Line 47: | Line 62: | ||
Before start building the kernel and dtb sources, apply the patch with OV5647 camera sources: | Before start building the kernel and dtb sources, apply the patch with OV5647 camera sources: | ||
− | Copy the patches tarball into sources directory, decompress the tarball and apply the patch with the commands: | + | Copy the patches tarball into the sources directory, decompress the tarball and apply the patch with the commands: |
<source lang="bash"> | <source lang="bash"> | ||
− | mv 4.2_nano_ov5647.tar $JETSON_NANO_SOURCES/public_sources | + | mv 4.2_nano_ov5647.tar.gz $JETSON_NANO_SOURCES/public_sources |
cd $JETSON_NANO_SOURCES/public_sources | cd $JETSON_NANO_SOURCES/public_sources | ||
tar -xvf 4.2_nano_ov5647.tar.gz | tar -xvf 4.2_nano_ov5647.tar.gz | ||
Line 73: | Line 88: | ||
====7. Flash Jetson Nano memory==== | ====7. Flash Jetson Nano memory==== | ||
+ | |||
+ | This guide assumes that the user already have JetPack 4.2 installed. This link contains details about how to install JetPack 4.2: https://docs.nvidia.com/sdk-manager/download-run-sdkm/index.html | ||
+ | |||
+ | JETPACK_4_2 contains the directory where JetPack 4.2 was installed. Usually in. | ||
+ | <source lang="bash"> | ||
+ | ~/nvidia/nvidia_sdk | ||
+ | </source> | ||
+ | |||
+ | So please do: | ||
+ | |||
+ | <source lang="bash"> | ||
+ | export JETPACK_4_2=$HOME/nvidia/nvidia_sdk/ | ||
+ | </source> | ||
+ | |||
Make sure the Jetson Nano is in recovery mode | Make sure the Jetson Nano is in recovery mode | ||
<source lang="bash"> | <source lang="bash"> | ||
− | cd ${ | + | cd ${JETPACK_4_2}/JetPack_4.2_Linux_P3448/Linux_for_Tegra |
# Copy kernel generated | # Copy kernel generated | ||
cp $JETSON_NANO_SOURCES/public_sources/build/arch/arm64/boot/Image kernel/ | cp $JETSON_NANO_SOURCES/public_sources/build/arch/arm64/boot/Image kernel/ | ||
Line 86: | Line 115: | ||
</source> | </source> | ||
− | =Using the driver= | + | ==Using the OmniVision OV5647 Linux driver== |
Capture at 1080p@30fps | Capture at 1080p@30fps | ||
Line 95: | Line 124: | ||
nvvidconv ! queue ! ximagesink | nvvidconv ! queue ! ximagesink | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | [[Category:Jetson]][[Category:Jetson V4L2 Drivers]] | + | {{ContactUs}} |
+ | |||
+ | [[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:OmniVision]] |
Latest revision as of 14:19, 17 March 2023
|
|
|
|
Omnivision OV5647 image sensor
The Omnivision OV5647 is a CMOS image sensor with the following features:
- Automatic image control functions:
- Automatic exposure control (AEC)
- Automatic white balance (AWB)
- Automatic band filter (ABF)
- Automatic 50/60 Hz luminance detection
- Automatic black level calibration (ABLC)
- Image quality controls: lens correction, defective pixel canceling
- CSI2 serial data output (MIPI interface 2 lanes)
- Support for output formats: 8-/10-bit raw RGB data
- Maximum image transfer rate:
- QSXGA "Mpixel" (2592 x 1944): 15 fps
- 1080p: 30 fps
- 960p: 45 fps
- 720p: 60 fps
- VGA (640 x 480): 90 fps
- QVGA (320 x 240): 120 fps
Enabling the Omnivision OV5647 Linux driver
Follow these instructions to build and install the kernel Image and device tree.
1. dependencies
2. Set the environment variables for the sources L4T 31-1-0
3. Install the toolchain
4. Download the kernel sources
JETSON_NANO_SOURCES=$(pwd)
wget https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/jetson-nano/BSP/Jetson-Nano-public_sources.tbz2 --no-check-certificate
tar -xvf Jetson-Nano-public_sources.tbz2
cd public_sources/
tar -xvf kernel_src.tbz2
5. Apply driver patches
Before start building the kernel and dtb sources, apply the patch with OV5647 camera sources:
Copy the patches tarball into the sources directory, decompress the tarball and apply the patch with the commands:
mv 4.2_nano_ov5647.tar.gz $JETSON_NANO_SOURCES/public_sources
cd $JETSON_NANO_SOURCES/public_sources
tar -xvf 4.2_nano_ov5647.tar.gz
quilt push
6. Compile kernel and dtb
Follow the steps:
cd $JETSON_NANO_SOURCES/public_sources
CROSS_COMPILE=${HOME}/toolchain_bin_${VERSION}/${TOOLCHAIN_DIR}/bin/$CC_PREFIX
KERNEL_OUT=$JETSON_NANO_SOURCES/public_sources/build
KERNEL_MODULES_OUT=$JETSON_NANO_SOURCES/public_sources/modules
cd $JETSON_NANO_SOURCES/public_sources
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT menuconfig
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j6 Image
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j6 dtbs
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j6 modules
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT modules_install INSTALL_MOD_PATH=$KERNEL_MODULES_OUT
7. Flash Jetson Nano memory
This guide assumes that the user already have JetPack 4.2 installed. This link contains details about how to install JetPack 4.2: https://docs.nvidia.com/sdk-manager/download-run-sdkm/index.html
JETPACK_4_2 contains the directory where JetPack 4.2 was installed. Usually in.
~/nvidia/nvidia_sdk
So please do:
export JETPACK_4_2=$HOME/nvidia/nvidia_sdk/
Make sure the Jetson Nano is in recovery mode
cd ${JETPACK_4_2}/JetPack_4.2_Linux_P3448/Linux_for_Tegra
# Copy kernel generated
cp $JETSON_NANO_SOURCES/public_sources/build/arch/arm64/boot/Image kernel/
# Copy device tree generated
cp $JETSON_NANO_SOURCES/public_sources/build/arch/arm64/boot/dts/tegra210-p3448-0000-p3449-0000-a02.dtb kernel/dtb/
# Copy new modules
sudo cp -a $JETSON_NANO_SOURCES/public_sources/modules/lib rootfs/
# Flash memory
sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1
Using the OmniVision OV5647 Linux driver
Capture at 1080p@30fps
DISPLAY=:0 gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=10000 ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)21/1' ! \
nvvidconv ! queue ! ximagesink
RidgeRun Resources | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contact Us
|