Jump to content

OmniVision Monochrome OV24A1B Linux driver for Jetson: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 80: Line 80:


'''4.''' Create a folder named ''sources/'' in the ''Linux_for_Tegra/'' directory.
'''4.''' Create a folder named ''sources/'' in the ''Linux_for_Tegra/'' directory.
<syntaxhighlight>
<syntaxhighlight lang="bash">
mkdir -p JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
mkdir -p JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
</syntaxhighlight><br>
</syntaxhighlight><br>


'''5.''' Uncompress the ''public_sources.tbz2'' tarball.
'''5.''' Uncompress the ''public_sources.tbz2'' tarball.
<syntaxhighlight>
<syntaxhighlight lang="bash">
tar -xvf public_sources.tbz2
tar -xvf public_sources.tbz2
</syntaxhighlight><br>
</syntaxhighlight><br>


'''6.''' Uncompress the ''public_sources.tbz2/Linux_for_Tegra/source/public/kernel_src.tbz2'' content (kernel and hardware folders) in the ''JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/'' directory.<br>
'''6.''' Uncompress the ''public_sources.tbz2/Linux_for_Tegra/source/public/kernel_src.tbz2'' content (kernel and hardware folders) in the ''JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/'' directory.<br>
<syntaxhighlight>
<syntaxhighlight lang="bash">
cd Linux_for_Tegra/source/public/
cd Linux_for_Tegra/source/public/
tar -xvf kernel_src.tbz2
tar -xvf kernel_src.tbz2
Line 99: Line 99:


First untar the provided tarball:
First untar the provided tarball:
<syntaxhighlight>
<syntaxhighlight lang="bash">
tar -xvf ov24a1b_driver.tar
tar -xvf ov24a1b_driver.tar
</syntaxhighlight>
</syntaxhighlight>


Move the uncompressed ''patches/'' folder into your ''JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/'' directory.
Move the uncompressed ''patches/'' folder into your ''JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/'' directory.
<syntaxhighlight>
<syntaxhighlight lang="bash">
mv patches/ JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
mv patches/ JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
</syntaxhighlight>
</syntaxhighlight>


Apply the patch as follows:
Apply the patch as follows:
<syntaxhighlight>
<syntaxhighlight lang="bash">
cd JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
cd JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
quilt push
quilt push
Line 117: Line 117:


Create the main directories:
Create the main directories:
<syntaxhighlight>
<syntaxhighlight lang="bash">
JETSON_KERNEL_SOURCE=JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
JETSON_KERNEL_SOURCE=JetPack_4.4_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/source/
cd $JETSON_KERNEL_SOURCE/../
cd $JETSON_KERNEL_SOURCE/../
Line 126: Line 126:


Set up some variables:
Set up some variables:
<syntaxhighlight>
<syntaxhighlight lang="bash">
CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
KERNEL_OUT=$JETSON_KERNEL_SOURCE/../build
KERNEL_OUT=$JETSON_KERNEL_SOURCE/../build
Line 133: Line 133:


Configure and build the kernel:
Configure and build the kernel:
<syntaxhighlight>
<syntaxhighlight lang="bash">
cd $JETSON_KERNEL_SOURCE
cd $JETSON_KERNEL_SOURCE
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT tegra_defconfig
Line 142: Line 142:


'''1.''' Select in the menu (if not selected yet):
'''1.''' Select in the menu (if not selected yet):
<syntaxhighlight>
<syntaxhighlight lang="bash">
Device Drivers  --->
Device Drivers  --->
     <*> Multimedia support  --->
     <*> Multimedia support  --->
Line 152: Line 152:


'''2.'''Compile kernel, device tree and modules:
'''2.'''Compile kernel, device tree and modules:
<syntaxhighlight>
<syntaxhighlight lang="bash">
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 Image
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 Image
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 dtbs
make -C kernel/kernel-4.9/ ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 dtbs
Line 160: Line 160:


'''3.''' Copy the generated kernel and dtb:
'''3.''' Copy the generated kernel and dtb:
<syntaxhighlight>
<syntaxhighlight lang="bash">
cd $JETSON_KERNEL_SOURCE/../
cd $JETSON_KERNEL_SOURCE/../
cp build/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb ./kernel/dtb
cp build/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb ./kernel/dtb
Line 176: Line 176:
        
        
You can confirm that your developer kit is in Force Recovery mode you can use lsusb and get the following line as part of the output:
You can confirm that your developer kit is in Force Recovery mode you can use lsusb and get the following line as part of the output:
<syntaxhighlight>
<syntaxhighlight lang="bash">
Bus 001 Device 015: ID 0955:7020 NVidia Corp.
Bus 001 Device 015: ID 0955:7020 NVidia Corp.
</syntaxhighlight>
</syntaxhighlight>


'''2.''' Flash the board with the following command:
'''2.''' Flash the board with the following command:
<syntaxhighlight>
<syntaxhighlight lang="bash">
sudo ./flash.sh -r -k kernel-dtb -d kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb jetson-xavier mmcblk0p1
sudo ./flash.sh -r -k kernel-dtb -d kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb jetson-xavier mmcblk0p1
</syntaxhighlight>
</syntaxhighlight>
Line 188: Line 188:


Kernel:
Kernel:
<syntaxhighlight>
<syntaxhighlight lang="bash">
scp ./kernel/Image nvidia@<xavier-ip>:/tmp/
scp ./kernel/Image nvidia@<xavier-ip>:/tmp/
</syntaxhighlight>
</syntaxhighlight>


Modules:
Modules:
<syntaxhighlight>
<syntaxhighlight lang="bash">
scp -r ./modules/lib/modules/4.9.140/kernel/ nvidia@<xavier-ip>:/tmp/
scp -r ./modules/lib/modules/4.9.140/kernel/ nvidia@<xavier-ip>:/tmp/
scp ./modules/lib/modules/4.9.140/modules.* nvidia@<xavier-ip>:/tmp/
scp ./modules/lib/modules/4.9.140/modules.* nvidia@<xavier-ip>:/tmp/
Line 199: Line 199:


'''4.''' Update kernel image and modules inside the board and reboot from CLI:
'''4.''' Update kernel image and modules inside the board and reboot from CLI:
<syntaxhighlight>
<syntaxhighlight lang="bash">
cd /tmp/
cd /tmp/
sudo rm -rf /lib/modules/4.9.140/kernel/*
sudo rm -rf /lib/modules/4.9.140/kernel/*
Cookies help us deliver our services. By using our services, you agree to our use of cookies.