My problem is that none of the debug outputs seems to work for me:
What am I trying to do:
Writing a driver to listen in on an existing CSI2 data stream.
What I can do:
the code compiles, links and creates a ko-file. I’ve modified the device tree, so that I can load it.
sudo insmod is working
sudo probemod is working
sudo lsmod is showing the module loaded
sudo rmmod is unloading it.
if I delete the module insmod is complaining, that the file is not found.
However it seems that all writing to the kernel log is not working / disabled.
Is there a central switch in the build scripts to enable/disable it?
I’m following NVIDIA Jetson Orin - Compiling Code (ridgerun.com)
to build the module.
Does it need a specific entry function?
nv_ovx1f.c (23.9 KB)
Try add pr_info() in probe() function to check if the driver was been loaded and register to system.
It is not printing anything in the kernel log.
However lsmod is displaying it. I also added a probe_new function, but it didn’t change a thing.
Here’s nv_imx219.c probe message.
nvidia@tegra-ubuntu:~$ sudo modprobe nv_imx219
nvidia@tegra-ubuntu:~$ sudo dmesg
[609234.733367] imx219 9-0010: tegracam sensor driver:imx219_v2.0.6
[609234.749749] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx219 9-0010 bound
[609234.755942] imx219 10-0010: tegracam sensor driver:imx219_v2.0.6
[609234.766706] imx219 10-0010: imx219_board_setup: error during i2c read probe (-121)
[609234.772191] imx219 10-0010: board setup failed
[609234.772419] imx219: probe of 10-0010 failed with error -121
not getting those either.
When I plug a USB drive, I get tons of messages. But for imx219 or my driver I get nothing.
Occasionally there is some entry:
“[timestamp] start_addr=(0x20000), end_address=(0x40000), buffer_size=(0x20000),smp_number_max=(16384)”
That seems to be related to the driver, but it is not always there.
Have you verify imx219 by enable it by device tree?
You mean in the tegra_defconfig? Checking…
It is set to “m”
Wouldn’t I need some dtsi include files for the imx219? Can’t find them in the Orin package.
In the tegra194 folders there are some imx219 files, but I’m not sure if I can use those for tegra234.
Orin can’t connect imx219, I post IMX219 to tell r35.1 on XNX without problem to print the message. You can use IMX219 as template to modify your driver.
But I don’t get any messages there either.
OK, you can reference to IMX274 on Orin.
You can modify the device tree to force loaded IMX274 for testing.
nvidia@tegra-ubuntu:~$ sudo dmesg | grep -i imx
[sudo] password for nvidia:
[ 13.994205] imx274 30-001a: probing v4l2 sensor.
[ 13.994992] imx274 30-001a: tegracam sensor driver:imx274_v2.0.6
[ 14.015013] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx274 30-001a bound
[ 14.016606] imx274 30-001a: Detected IMX274 sensor
[ 14.016774] imx274 31-001a: probing v4l2 sensor.
[ 14.017210] imx274 31-001a: tegracam sensor driver:imx274_v2.0.6
[ 14.034895] tegra-camrtc-capture-vi tegra-capture-vi: subdev imx274 31-001a bound
[ 14.035356] imx274 31-001a: Detected IMX274 sensor
Here is what I get:
…@tegra-ubuntu:/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/i2c$ sudo dmesg -C
…@tegra-ubuntu:/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/i2c$ sudo insmod nv_imx274.ko
…@tegra-ubuntu:/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/i2c$ sudo dmesg | grep -i imx
…@tegra-ubuntu:/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/i2c$ sudo dmesg
[103430.807562] start_addr=(0x20000), end_addr=(0x40000), buffer_size=(0x20000), smp_number_max=(16384)
…@tegra-ubuntu:/usr/lib/modules/5.10.104-tegra/kernel/drivers/media/i2c$ sudo rmmod nv_imx274
What might be relevant is that after a reboot, when I load my module for the first time, I get a message that the kernel is polluted or tainted. At first I thought I fixed this with “sudo depmod -a” because it didn’t show up again. But it seems to appear only once per reboot. I’ve found some articles that this can influence printk. I’m not yet sure how to fix it though.
Edit: the depmod -a is required for modprobe to find the module.
We tried again this time with the original image from the NVIDIA SDK without modifications (new download).
- the keyboard setup now supported regional keyboard layouts (didn’t work earlier)
- still no output in the kernel log when I load nv_imx274 or nv_imx219.
as you can see, there’s
dev_dbg() in nv_imx274.c.
however, dynamic debug flag is configured as disabled by default.
you’ll need to re-built the kernel by adding
CONFIG_DYNAMIC_DEBUG=y to dynamically enable/disable kernel code to obtain additional kernel information.
the alternative way is updating the kernel by using
pr_err() to force output messages to highest level.
for quick testing, you may try to replace this kernel module, i.e. Topic239759_Feb08.7z (191 Bytes)
note, it’s built from Jetpack-5.1/ l4t-r35.2.1, I’ve change some of debug prints as error log level for you testing.
FYI, the above is not a bug, and not necessarily a problem. It means that a driver was loaded in the kernel which is not open source licensed, and the official support from kernel.org won’t deal with it. Sometimes the source is needed to debug since one kernel space driver can interfere with others, and the actual cause of a bug might be misleading since the bug is just a report and not a source. Unless that module has an actual bug being tainted is 100% irrelevant to function.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.