Printing CSI and VI error status registers

We are trying to creating a camera driver for the IMX172 image sensor. We are able to get the camera running at a slow framerate, but whenever we try to increase the framerate we get a green or black screen when starting the video. When we check the camera board, pixels are flowing over the MIPI interface, but they aren’t syncing to frames on the TX1.

I would like to be able to inspect the CSI and VI error registers (VI_CSI_0_ERROR_STATUS, etc), but they aren’t printing out to kern.log. Is there a debugging flag I need to enable for these to be printed, or do I need to add some printk statements to the driver to list their values?

Thanks.

Do you use gstreamer or argus app?
When the timeout happened you should be able to see the syncpt timeout and kernel print out error status.
For you case I believe it’s sensor MIPI timing issue. Please make sure the MIPI timing is MIPI compliance.

Do you use argus or gstreamer APP? You should able to see the syncpt timing out and some error status kernel print by dmesg or UART console.
For you case I believe you need to make sure the sensor output is MIPI compliance first. Most of this kind of problem is caused by sensor timing. After that you can find tune the cil_settletime by modify device tree, the range is from 0x1 - 0xF

mode0 { // OV5693_MODE_2592X1944
							mclk_khz = "24000";
							num_lanes = "2";
							tegra_sinterface = "serial_a";
							discontinuous_clk = "no";
							dpcm_enable = "false";
							cil_settletime = "0";
							active_w = "2592";
							active_h = "1944";
							pixel_t = "bayer_bggr";
							readout_orientation = "90";
							line_length = "2688";
							inherent_gain = "1";
							mclk_multiplier = "17.0";
							pix_clk_hz = "160000000";
							min_gain_val = "1.0";
							max_gain_val = "16";
							min_hdr_ratio = "1";
							max_hdr_ratio = "64";
							min_framerate = "1.816577";
							max_framerate = "30";
							min_exp_time = "34";
							max_exp_time = "550385";
						};

I’m using gstreamer to get the video feed right now. We were seeing the syncpt dumps, but didn’t see the CSI and VI error register values there.

After double-checking our clock settings, we are now able to get the sensor running at a higher frame rate. Unfortunately at the higher frame rate we are now getting images/video with a magenta tint. I suspect it has something to do with the debayering. The sensor outputs in GBRG format, and I have that set in the device tree. However, in the driver when calling to camera_common it looks like only RGGB is available. Is there another way to configure the debayering? I tried a couple of different values for the cil_settletime (0, 4, and 8), all with the same results.

  1. Did you set the pixel_t = “bayer_gbrg” in device tree?
  2. Check raw data from v4l2-ctl that without ISP demosaic.

@ShaneCCC Thanks, the device tree hint lead us to solve our problem. The MIPI bridge chip we were using on the camera board was unexpectedly dropping the first line of the image, so that was causing the GBRG Bayer pattern to no longer work. We changed the device tree to use bayer_rggb instead to accommodate for the dropped line and that fixed our issue.