We have an on going issue with our TX2s using the Waveshare IMX219 CSI camera though our custom carrier board.
60% of the time this camera works fine.
When we hard cut power to the TX2 about 40% of the time when repowering the TX2 the camera is not detected.
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:521 No cameras available
When the issue occurs “Imx219_board_setup: error during i2c read probe (-121)” error is thrown on boot.
This is whats detected when it did work, I can see the driver is loaded and the i2C adress is expected:
studio@tegra-ubuntu:/sys/devices/3180000.i2c$ sudo i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using receive byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
This is whats detected on the I2c bus when it didnt work, the i2c address has shifted !?
studio@tegra-ubuntu:~$ sudo i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using receive byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- 0d -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I also noticed that the i2c address can sometimes be correct, but the driver doesnt get bound to it on boot (I suspect the i2c address is wrong when the driver attempts to bind to it on boot)?
studio@tegra-ubuntu:~$ sudo i2cdetect -r 2
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-2 using receive byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
When it is in this state I have tried to unload the IMX219 module and reload it with modprobe, however the imx219 is a built in module, therefore i cannot remove it.
studio@tegra-ubuntu:/lib/modules/4.9.140+/kernel/drivers$ sudo modprobe -r imx219
modprobe: FATAL: Module imx219 is builtin.
dhstudio@tegra-ubuntu:/lib/modules/4.9.140+/kernel/drivers$ sudo modprobe -f imx219
I’ve also tried to disable this by adding imx219 to /etc/modprobe.d/blacklist.conf
But the module still loads on boot.
It might need to be configured in the device tree.
I tried ‘re-binding’ the i2c address to the imx219 driver:
root@tegra-ubuntu:/sys/bus/i2c/drivers/imx219# echo 2-0010 > bind
bash: echo: write error: No such device
root@tegra-ubuntu:/sys/bus/i2c/drivers/imx219# echo 2-0010 > unbind
root@tegra-ubuntu:/sys/devices/3180000.i2c/i2c-2# echo imx219 0x01 > /sys/class/i2c-adapter/i2c-2/new_device
bash: echo: write error: Invalid argument
Toggling the power enable pin of the CSI camera through the GPIO doesnt appear to make the camera respond to this in any way, either when in a working or in non-working state.
The dtb configrations is as follows:
imx219_f@10 {
#address-cells = <0x1>;
#size-cells = <0x0>;
status = "okay";
devnode = "video0";
compatible = "nvidia,imx219";
reg = <0x10>;
clocks = <0x10 0x59>;
clock-names = "extperiph1";
mclk = "extperiph1";
physical_w = "5.095";
physical_h = "4.930";
sensor_model = "imx219";
pwdn-gpios = <0x1b 0x88 0x0>;
reset-gpios = <0x1b 0x8d 0x0>;
linux,phandle = <0x11a>;
phandle = <0x11a>;
I’m sharing these findings as I’m struggling to get to the bottom of this issue.
My question is:
Can I re-initialise the built-in module “imx219” in order to re bind the drivers to the CSI camera, and then restart nvargus-daemon to get my camera back?
I must also add that this issue has happened on multiple of our Tx2’s and imx219 modules, bulk…
Ive seen a lot of forum posts with “Imx219_board_setup: error during i2c read probe (-121)” but maybe this is because its a built in module and will throw an error if there is no CSI camera attached?