Jetpack 5.1: jc42 kernel module

Hi,
I’m running JetPack 5.1 on an ORIN AGX developer kit. To the I2C bus on the GPIO header I have connected a temperature sensor which I would like to use with lm-sensors. The temperature sensor is supported by the jc42 kernel module. The kernel module itself however seems missing:

$ sudo modprobe jc42
modprobe: FATAL: Module jc42 not found in directory /lib/modules/5.10.104-tegra

Is there an easy way to compile this module and possibly step-by-step instructions?

Thank you!

FYI, this file is a compressed list of the current kernel’s build configuration:
/proc/config.gz

The particular feature which enables that module is “CONFIG_SENSORS_JC42”. To see if yours is enabled:
cat /proc/config.gz | grep 'JC42'

By default this is not set. You have two options:

  • Build as a module and copy the module to the right location.
  • Build integrated directly into the kernel (which also requires rebuilding modules most of the time).

Not all features can be modules, but I think that one can. Before you start, write down the output from “uname -r”. Note that Jetsons default in a suffix of “-tegra”, and that this is the kernel itself providing that information. This suffix is set in the "CONFIG_LOCALVERSION" feature. Modules are searched for at: /lib/modules/$(uname -r)/kernel`

This means that if you build only a module, and you build it from a matching set of kernel features, plus having CONFIG_LOCALVERSION set to “-tegra”, that it is a simple install of copying that module as a file. Changing integrated features or removing features or altering CONFIG_LOCALVERSION will probably mean having to build and install the entire kernel and all modules.

The JetPack/SDKM software is a GUI frontend to what actually gets flashed to a Jetson, and L4T is what gets flashed (it is Ubuntu plus NVIDIA drivers). Both have versions tied to each other. You can find the exact L4T release you have via “head -n 1 /etc/nv_tegra_release”. Find your release, and if you go to the URL for that release, it will also have kernel source available and documentation on building kernels. See:

Keep in mind when reading those docs that often they use flash to install software. In your case you likely don’t need to flash. Once you get past the build you can always ask about install. Flash will work, but a file copy is much simpler.

If the docs (which use cross compile from the host PC) are not sufficient, then you can look at these (which tend to be about native compile instead of cross compile, but much is the same):

Dear linuxdev,

thank you! This worked nicely!

Best regards

1 Like

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