Custom camera on ConnectTech Photon Xavier NX

I am working on compiling a kernel patch for an IMX252 camera into a ConnectTech photon carrier board. I have successfully been able to compile the patch and read from the camera on a Xavier NX devkit, Hwoever, I am unable to get the camera to negotiate properly on a ConnectTech photon carrier board.

The error I am seeing in dmesg is here:

nvidia@xavier:~$ dmesg | grep imx
[    1.823880] imx252 9-001a: imx252_probe(): Probing v4l2 sensor at addr 0x1a - Feb  4 2021/03:50:33
[    1.824087] imx252 9-001a: imx252_probe(): of_match_device() OK
[    1.824219] imx252 9-001a: imx252_probe(): devm_kzalloc() OK
[    1.824286] imx252 9-001a: imx252_parse_dt(): ...
[    1.824365] imx252 9-001a: imx252_parse_dt(): mclk name not present, assume sensor driven externally
[    1.824542] imx252 9-001a: imx252_parse_dt(): avdd, iovdd and/or dvdd reglrs. not present, assume sensor powered independently
[    1.824759] imx252 9-001a: imx252_parse_dt(): external-trigger-mode not present in DT, def=-1
[    1.824926] imx252 9-001a: imx252_parse_dt(): flash-output=1
[    1.825041] imx252 9-001a: imx252_parse_dt(): fpga_addr not present in DT, def=16
[    1.825188] imx252 9-001a: imx252_parse_dt(): OK
[    1.825501] imx252 9-001a: tegracam sensor driver:imx252_v2.0.6
[    1.825507] imx252 9-001a: imx252_probe(): tegracam_device_register() OK
[    1.825515] imx252 9-001a: imx252_board_setup: mclk_freq=24000 pixel_clock=1100000000 cil_settletime=0 discontinuous_clk=0
[    1.825745] imx252 9-001a: imx252_board_setup: width,height,line_length=2048,1536,2304 pix_fmt=0x42474752 'RGGB' embedded_metadata_height=0
[    1.828602] imx252 9-001a: imx252_board_setup: VC Sensor device-tree has configured 2 data-lanes: sensor_mode=1
[    1.829269] imx252 9-001a: imx252_board_setup(): Error !!! VC FPGA not found !!!, fpga_addr=0x10
[    1.837475] imx252 9-001a: imx252_probe: imx252_board_setup() error=-5
[    1.844044] imx252: probe of 9-001a failed with error -5
[    1.844098] imx252 10-001a: imx252_probe(): Probing v4l2 sensor at addr 0x1a - Feb  4 2021/03:50:33
[    1.852775] imx252 10-001a: imx252_probe(): of_match_device() OK
[    1.858978] imx252 10-001a: imx252_probe(): devm_kzalloc() OK
[    1.859048] imx252 10-001a: imx252_parse_dt(): ...
[    1.859082] imx252 10-001a: imx252_parse_dt(): mclk name not present, assume sensor driven externally
[    1.868357] imx252 10-001a: imx252_parse_dt(): avdd, iovdd and/or dvdd reglrs. not present, assume sensor powered independently
[    1.879487] imx252 10-001a: imx252_parse_dt(): external-trigger-mode not present in DT, def=-1
[    1.888386] imx252 10-001a: imx252_parse_dt(): flash-output=1
[    1.893888] imx252 10-001a: imx252_parse_dt(): fpga_addr not present in DT, def=16
[    1.901412] imx252 10-001a: imx252_parse_dt(): OK
[    1.906480] imx252 10-001a: tegracam sensor driver:imx252_v2.0.6
[    1.906487] imx252 10-001a: imx252_probe(): tegracam_device_register() OK
[    1.906495] imx252 10-001a: imx252_board_setup: mclk_freq=24000 pixel_clock=1100000000 cil_settletime=0 discontinuous_clk=0
[    1.917602] imx252 10-001a: imx252_board_setup: width,height,line_length=2048,1536,2304 pix_fmt=0x42474752 'RGGB' embedded_metadata_height=0
[    1.932435] imx252 10-001a: imx252_board_setup: VC Sensor device-tree has configured 2 data-lanes: sensor_mode=1
[    1.940638] imx252 10-001a: imx252_board_setup(): Error !!! VC FPGA not found !!!, fpga_addr=0x10
[    1.949504] imx252 10-001a: imx252_probe: imx252_board_setup() error=-5
[    1.956024] imx252: probe of 10-001a failed with error -5

Anyone have suggestions for where I should be looking to get this resolved?

I’ve flashed the photon carrier with my own dtb file that I built with the patch provided by the camera manufacturer (DTB_FILE=tegra194-p3668-all-p3509-0000.dtb).

You can check the imx252.c for below error to find the root cause.

Below is the sensor programing guide may help to understand the sensor driver.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.html#wwpID0E0LF0HA

The driver vaguely suggests that probing the device over I2C is failing. What is the proper way to enable dev_dbg messages so I can see them in the dmesg output to get more debug information?

You should be able see the i2c error by default kernel if sensor driver access i2c bus and failed.

I can see dev_err messages, but I specifically want to see dev_dbg messages.

Enable by below command.

sudo su
echo file imx252.c +p > /sys/kernel/debug/dynamic_debug/control