IDE:jeston 36.0
JetPack6.0
core board:orin Nano4GB
board:Jetson Orin Nano Developer Kit
kernel source: Jetson Linux 36.3 NVIDIA Developer
rootfs source: Basic Flavor Root File System Root File System — NVIDIA Jetson Linux Developer Guide 1 documentation
I am a beginner and recently used an imx415 camera in a project. While searching for information, I found someone using vc-mipi-nvidia to implement the camera driver.
I according to the GitHub - VC-MIPI-modules/vc_mipi_nvidia: Vision Components MIPI CSI-2 driver for NVIDIA Jetson Nano, Xavier NX, AGX Xavier, TX2 and Orin Nano, Orin NX website guidance for migration, module migration found the following problems.:
According to the tutorial, I will copy in the device tree to/hardware/nvidia/t23x/nv - public/overlay path, but his third department all the driver file copy to * * / kernel/nvidia/drivers/media/i2c path, In my actual kernel there is no such path but: Linux_for_Tegra/source/kernel/kernel - jammy - SRC/drivers/media/i2c, I also found a path Linux_for_Tegra/source/nvidia-oot/drivers/media/i2c, which path do I need to copy the file to? Or are neither of these paths correct?
Do I need to change the Makefile and Kconfig if I copy the file to the appropriate location?
hello 56101855,
as you can see in Camera Driver Porting section, JP-6’s kernel version is k-5.15, and, it’s using loadable kernel modules now.
you may see-also Sensor Software Driver Programming for sensor driver implementation.
Hello 56101855
I have couple of questions to understand your requirements:
Did you use recently a imx477 camera in jetson Orin Nano?
Do you need vc-mipi-nvidia because you have another camera? (Checking the list of cameras supported by vc-mipi-nvidia I didn’t see imx477)
Regarding your questions:
The camera NVidia drivers are located in: Linux_for_Tegra/source/nvidia-oot/drivers/media/i2c/
Yes, If, if a new driver is added, you need to change the Makefile, please see:
Linux_for_Tegra/source/nvidia-oot/drivers/media/i2c/Makefile
Manuel Leiva
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com
Sorry for not replying to you in time. I used IMX415, which was written incorrectly. IMX415 is used in the project.
I’m sorry for not replying to you in time. I have copied the vc_mipi_modules driver file into the Linux_for_Tegra/source/nvidia-oot/drivers/media/i2c path and modified the Makefile. Can the kernel be compiled directly? Thank you for your timely help.
I found that I make -C kernel did not see the compilation of files in nvidia-oot in the log. It feels like I put the driver into nvidia-oot and it doesn’t compile.
hello 56101855,
you may refer to below steps to rebuild our OOT drivers
for instance,
sudo mkdir -p /usr/src/nvidia-jetson-1.0
cd /usr/src/nvidia-jetson-1.0
sudo tar xf /tmp/kernel_oot_modules_src.tbz2
sudo tar xf /tmp/nvidia_kernel_display_driver_source.tbz2
sudo chown -R ${USER}:${USER} /usr/src/nvidia-jetson-1.0
export KERNEL_HEADERS="/usr/src/linux-headers-5.15.122-tegra-ubuntu22.04_aarch64/3rdparty/canonical/linux-jammy/kernel-source"
make ARCH=arm64 -j8 clean
make ARCH=arm64 -j8 modules
sudo make ARCH=arm64 -j8 modules_install
thank you very much for your help。export KERNEL_HEADERS=“/usr/src/linux-headers-5.15.122-tegra-ubuntu22.04_aarch64/3rdparty/canonical/linux-jammy/kernel-source”。
This path, I check my ubuntu system, there is no file under this path, where to get the relevant files?
I use Ubuntu22.04 for my computer。
zynq@ubuntu:~/nvidia/Linux_for_Tegra/source$ export KERNEL_HADERS="~/nvidia/Linux_for_Tegra/rootfs/usr/src/linux-headers-5.15.136-tegra-ubuntu22.04_aarch64/3rdparty/canonical/linux-jammy/kernel-source"
zynq@ubuntu:~/nvidia/Linux_for_Tegra/source$ make ARCH=arm64 -j6 clean
================================================================================
================================================================================
================================================================================
make clean - hwpm ...
make clean - nvidia-display ...
make clean - nvidia-dtbs ...
================================================================================
make -j 6 ARCH=arm64 \
-C /lib/modules/6.8.0-40-generic/build \
M=/home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm \
CONFIG_TEGRA_OOT_MODULE=m \
srctree.hwpm=/home/zynq/nvidia/Linux_for_Tegra/source/hwpm \
srctree.nvconftest=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest \
clean
================================================================================
================================================================================
if [ -d /home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-linux-header ]; then \
make -j 6 ARCH=arm64 TARGET_ARCH=aarch64 -C /home/zynq/nvidia/Linux_for_Tegra/source/nvdisplay LOCALVERSION= NV_VERBOSE=0 KERNELRELEASE="" SYSSRC=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-linux-header SYSOUT=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-linux-header SYSSRCHOST1X=/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/drivers/gpu/host1x/include CC=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-gcc LD=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-ld.bfd AR=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-ar CXX=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-g++ OBJCOPY=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-objcopy clean && \
rm -fr /home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-linux-header; \
fi
rm -fr /home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/device-tree/platform/generic-dts/dtbs
make[1]: 警告: 子 make 中强制 -j6: 重置 jobserver 模式。
make[1]: 进入目录“/usr/src/linux-headers-6.8.0-40-generic”
make[1]: 离开目录“/usr/src/linux-headers-6.8.0-40-generic”
================================================================================
make clean - nvidia-oot ...
================================================================================
make -j 6 ARCH=arm64 \
-C /lib/modules/6.8.0-40-generic/build \
M=/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot \
CONFIG_TEGRA_OOT_MODULE=m \
srctree.nvidia-oot=/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot \
srctree.hwpm=/home/zynq/nvidia/Linux_for_Tegra/source/hwpm \
srctree.nvconftest=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest \
KBUILD_EXTRA_SYMBOLS=/home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm/Module.symvers \
clean
make[1]: 警告: 子 make 中强制 -j6: 重置 jobserver 模式。
make[1]: 进入目录“/usr/src/linux-headers-6.8.0-40-generic”
make[1]: 离开目录“/usr/src/linux-headers-6.8.0-40-generic”
if [ ! -d "/home/zynq/nvidia/Linux_for_Tegra/source/nvgpu" ] ; then \
echo "Directory nvgpu is not found, exiting.."; \
false; \
fi
================================================================================
make clean - nvgpu ...
================================================================================
make -j 6 ARCH=arm64 \
-C /lib/modules/6.8.0-40-generic/build \
M=/home/zynq/nvidia/Linux_for_Tegra/source/nvgpu/drivers/gpu/nvgpu \
CONFIG_TEGRA_OOT_MODULE=m \
srctree.nvidia=/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot \
srctree.nvidia-oot=/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot \
srctree.nvconftest=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest \
KBUILD_EXTRA_SYMBOLS=/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/Module.symvers \
clean
make[1]: 警告: 子 make 中强制 -j6: 重置 jobserver 模式。
make[1]: 进入目录“/usr/src/linux-headers-6.8.0-40-generic”
make[1]: 离开目录“/usr/src/linux-headers-6.8.0-40-generic”
zynq@ubuntu:~/nvidia/Linux_for_Tegra/source$ make ARCH=arm64 -j modules
================================================================================
make modules - conftest ...
================================================================================
mkdir -p /home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia;
cp -av /home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/scripts/conftest/* /home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia/;
'/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/scripts/conftest/Makefile' -> '/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia/Makefile'
'/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/scripts/conftest/conftest.h' -> '/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia/conftest.h'
'/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/scripts/conftest/conftest.sh' -> '/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia/conftest.sh'
make -j 6 ARCH=arm64 \
src=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia obj=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia \
CC=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-gcc LD=/home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-ld \
NV_KERNEL_SOURCES=/lib/modules/6.8.0-40-generic/build \
NV_KERNEL_OUTPUT=/lib/modules/6.8.0-40-generic/build \
-f /home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest/nvidia/Makefile
make[1]: 进入目录“/home/zynq/nvidia/Linux_for_Tegra/source”
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/include/asm-arm64/mach-default'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/arch/arm64/include/asm/mach-default'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/include'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/include/uapi'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/include/xen'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/include/generated/uapi'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/arch/arm64/include'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/arch/arm64/include/uapi'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/arch/arm64/include/generated'
aarch64-buildroot-linux-gnu-gcc: WARNING: unsafe header/library path used in cross-compilation: '-I/lib/modules/6.8.0-40-generic/build/arch/arm64/include/generated/uapi'
Warning: Compiler version check failed:
The major and minor number of the compiler used to
compile the kernel:
x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38
does not match the compiler used here:
aarch64-buildroot-linux-gnu-gcc.br_real (Buildroot 2022.08) 11.3.0
Copyright © 2021 Free Software Foundation, Inc.
本程序是自由软件;请参看源代码的版权声明。本软件没有任何担保;
包括没有适销性和某一专用目的下的适用性担保。
It is recommended to set the CC environment variable
to the compiler that was used to compile the kernel.
To skip the test and silence this warning message, set
the IGNORE_CC_MISMATCH environment variable to "1".
However, mixing compiler versions between the kernel
and kernel modules can result in subtle bugs that are
difficult to diagnose.
*** Failed CC version check. ***
make[1]: 离开目录“/home/zynq/nvidia/Linux_for_Tegra/source”
================================================================================
make modules - hwpm ...
================================================================================
make -j 6 ARCH=arm64 \
-C /lib/modules/6.8.0-40-generic/build \
M=/home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm \
CONFIG_TEGRA_OOT_MODULE=m \
srctree.hwpm=/home/zynq/nvidia/Linux_for_Tegra/source/hwpm \
srctree.nvconftest=/home/zynq/nvidia/Linux_for_Tegra/source/out/nvidia-conftest \
modules
make[1]: 进入目录“/usr/src/linux-headers-6.8.0-40-generic”
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
You are using:
CC [M] /home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm/common/allowlist.o
/bin/sh: 1: /home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-gcc-12: not found
make[3]: *** [scripts/Makefile.build:243:/home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm/common/allowlist.o] 错误 127
make[3]: *** 正在等待未完成的任务....
CC [M] /home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm/common/aperture.o
/bin/sh: 1: /home/zynq/nvidia/gcc/bin/aarch64-buildroot-linux-gnu-gcc-12: not found
make[3]: *** [scripts/Makefile.build:243:/home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm/common/aperture.o] 错误 127
make[2]: *** [/usr/src/linux-headers-6.8.0-40-generic/Makefile:1926:/home/zynq/nvidia/Linux_for_Tegra/source/hwpm/drivers/tegra/hwpm] 错误 2
make[1]: *** [Makefile:240:__sub-make] 错误 2
make[1]: 离开目录“/usr/src/linux-headers-6.8.0-40-generic”
make: *** [Makefile:59:hwpm] 错误 2
zynq@ubuntu:~/nvidia/Linux_for_Tegra/source$
it looks compiler version mismatch, please check jetson-linux-r363 to confirm you’re downloading the recommended toolchain.
Thanks for helping!The drivers in nvidia-oot can now be compiled。But there are new problems.
The following attachment shows the printed questions when compiling the module:
log.txt (15.7 KB)
At first I thought my version of jetson-linux-r36.3 was too high. Later I used jetson-linux-r36.2 and had the same problem compiling modules.
Hi @56101855
Checking the log, I think API is be different:
/home/zynq/nvidia/Linux_for_Tegra/source/nvidia-oot/drivers/media/i2c/vc_mipi_camera.c:779:29: 错误: initialization of ‘int (*)(struct tegracam_device *, bool)’ {或称 ‘int (*)(struct tegracam_device *, _Bool)’} from incompatible pointer type ‘int (*)(struct tegracam_device *, __s64)’ {或称 ‘int (*)(struct tegracam_device *, long long int)’} [-Werror=incompatible-pointer-types]
779 | .set_trigger_mode = vc_set_trigger_mode,
I am not sure if the driver version that you are porting is compatible with L4T36.3, checking the information of GitHub - VC-MIPI-modules/vc_mipi_nvidia: Vision Components MIPI CSI-2 driver for NVIDIA Jetson Nano, Xavier NX, AGX Xavier, TX2 and Orin Nano, Orin NX it says the most recent version supported is 35.4.1. Probably you will need to change the driver code to solve the problem.
Manuel Leiva
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com
system
Closed
October 9, 2024, 3:08am
18
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.