I have a Jetson TX2 developer kit with the CSI MIPI Camera.
I would like to know how I can send I2C commands to the camera.
Currently as I run the i2cdetect command I am unable to find/locate the camera.
Some forum entries suggested that the camera is using the CAM_I2C device, however, I am not able to find this in the /dev folder nor is it being detected by i2cdetect.
I would like to write to and query the camera registers using the I2C protocol.
That is write and read the camera registers as an I2C device.
How can I do this?
If NVidia doesn’t support this, then how can I write to the different camera register?
There are several aspect to check when working with cameras/drivers, but as a direct answer to your question, you can use i2cget and i2cset to communicate with i2c devices.
If the camera does not appears at i2cdetect it may be related with a reset condition at the camera, clock not being provided or similar, usually you use i2cdetect to identify and check communication with the i2c camera at i2c bus.
About the information that you found at the forum, if you are using OV5693 or similar it is true, those cameras are controlled via i2c.
If you are using the Devkit with OV5693 camera and flashing default firmware with JetPack everything should be set and ready to detect and perform video capture.
To answer your question, reset signal, clock and interface configuration are performed by the firmware, basically the kernel ov5693 driver and devicetree. No jumper modifications are required.
As I try to run i2cget -y 2 0x36 0x06 → I get a “device busy message”.
If I add in a -f: i2cget -y -f 2 0x36 0x06 → I get a zero.
I get a zero for any register address.
I also tried this when the camera was running and when the camera was not running.
It seems that the driver has some lock on the I2C bus where it will not allow a user to directly access it as suggested by the “device busy message”.
Is there a way to communicate with the camera without getting the “device busy message” or a zero (if -f is used) ?
In this case the OV5693 has 16bit address registers, for example if you want to read OV5693 device id you need to set i2c address first and then read the registers.