How to get camera driver module

Hello!
I want to get a loadable kernel module(LKM) to accerate debug process.According to the document( L4T Development Guide ),I set the CONFIG_VIDEO_=m,and I will find the .ko in /nvidia/kernel/drivers/media/i2c/.ko.
But I can’t find .ko in the dir .So I don’t know how to get it.My jetson module is xavier-nx.

hello sqalex,

had you rebuild the kernel and the sensor driver after setting in the kernel configuration file?

Hi Jerry,
I had disclean and rebuild all the kernel.
I can express more details such as , if I set the CONFIG_VIDEO_camera=y,and this camera driver can exec the camera_probe func that means this camera driver can be compiled correct. But if CONFIG_VIDEO_camera=m ,I can’t find any camera.ko in my computer.

hello sqalex,

let me check this locally, may I know which l4t release package you’re using?

Not an answer to your specific cases, but some kernel build information might be useful…

Normally one would start by configuring the kernel to the default config (“tegra_defconfig”) or to match the running kernel (via “/proc/config.gz”), plus matching the “CONFIG_LOCALVERSION” to “-tegra”. After that one can configure changes, e.g., add a camera driver as a module.

If you directly edit the “.config” for the camera module, then there is a strong chance it won’t work correctly. There might be dependencies which are missed. For that reason such edits are normally make with either the “menuconfig” or other editor (I like “nconfig” for the symbol search function). If you go to one of the config editors, and the symbol can only be set to yes or no (“y” or “n”), then it cannot be a module. If it can be set to module (“m”), then it can be a module.

At some point after you’ve build modules, then you can tell it to install to some temporary empty directory, and this makes it much easier to find your module (none of the intermediate build targets are in the way). An example (if you’ve set up the environment variables):

make -j 6 O=$TEGRA_KERNEL_OUT INSTALL_MOD_PATH=$TEGRA_MODULES_OUT modules_install

(“TEGRA_MODULES_OUT” could be some empty directory you just created)

Then:

cd $TEGRA_MODULES_OUT
# This would be the 
cd lib/modules/$(uname -r)/kernel
1 Like

Thank u and I will try!

I use release 4.6.1 version

When you run the command “uname -r”, does it say “4.6.1-tegra” (it should)?

run the command “uame -r” , it say “4.9.253-tegra”. I have got the camera.ko right now use some ways that u mention before.Thank u!

The installed kernel then will search for modules at (my 4.6.1-tegra is probably a bad assumption and was somewhat arbitrary):
/lib/modules/4.9.253-tegra/kernel

Does this directory exist? Are there any other subdirectories within:
/lib/modules
(other than 4.9.253-tegra?)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.