Jetson Xavier NX MIPI CSI-2 without I2C from FPGA

Hi Team,

I am trying to capture the preconfigured 8bit grayscale CSI data from an FPGA without I2C communication on Xavier NX board with L4T 32.5.

I have followed some similar implementations(Jetson Nano MIPI CSI-2 without I2C from FPGA) (Tx1 CSI without I2c - #33 by hburaksaruhan) and did the following changes.

  1. Added 8bit grayscale support using the following changes.
drivers/media/platform/tegra/camera/camera_common.c
static const struct camera_common_colorfmt camera_common_color_fmts[] = {
+       {
+               MEDIA_BUS_FMT_Y8_1X8, //GRAYSCALE 8 BITS
+               V4L2_COLORSPACE_RAW, //RAW
+               V4L2_PIX_FMT_GREY,
+       },
drivers/media/platform/tegra/camera/sensor_common.c
        else if (strncmp(pixel_t, "yuv_vyuy16", size) == 0)
                *format = V4L2_PIX_FMT_VYUY;
+       else if (strncmp(pixel_t, "gray", size) == 0)
+               *format = V4L2_PIX_FMT_GREY;
drivers/media/platform/tegra/camera/vi/vi5_formats.h
static const struct tegra_video_format vi5_video_formats[] = {
+       TEGRA_VIDEO_FORMAT(RAW8, 8, Y8_1X8, 1, 1, T_R8, RAW8, GREY, "GRAY8"),
  1. Modified the ov5693 dtsi file to support FPGA csi configurations, single lane, csi port A, 1920x1080 @ 30fps and other configurations,
/ {
        host1x {
                status="okay";
                vi@15c10000  {
                        status="okay";
                        num-channels = <1>;
                        ports {
                                status="okay";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                vi_port0: port@0 {
                                        status="okay";
                                        reg = <0>;
                                        rbpcv2_ov5693_vi_in0: endpoint {
                                                status="okay";
                                                port-index = <0>;
                                                bus-width = <1>;
                                                remote-endpoint = <&rbpcv2_ov5693_csi_out0>;
                                        };
                                };
                        };
                };

                nvcsi@15a00000 {
                        status="okay";
                        num-channels = <1>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        csi_chan0: channel@0 {
                                status="okay";
                                reg = <0>;
                                ports {
                                        status="okay";
                                        #address-cells = <1>;
                                        #size-cells = <0>;
                                        csi_chan0_port0: port@0 {
                                                status="okay";
                                                reg = <0>;
                                                rbpcv2_ov5693_csi_in0: endpoint@0 {
                                                        status="okay";
                                                        port-index = <0>;
                                                        bus-width = <1>;
                                                        remote-endpoint = <&rbpcv2_ov5693_out0>;
                                                };
                                        };
                                        csi_chan0_port1: port@1 {
                                                status="okay";
                                                reg = <1>;
                                                rbpcv2_ov5693_csi_out0: endpoint@1 {
                                                        status="okay";
                                                        remote-endpoint = <&rbpcv2_ov5693_vi_in0>;
                                                };
                                        };
                                };
                        };
                };
        };
       i2c@3180000 {
                rbpcv2_ov5693_a@36 {
                        compatible = "nvidia,ov5693";
                        reg = <0x36>;
                        devnode = "video0";
                        physical_w = "3.680";
                        physical_h = "2.760";
                        clocks = <&bpmp_clks TEGRA194_CLK_EXTPERIPH1>,
                                 <&bpmp_clks TEGRA194_CLK_PLLP_OUT0>;
                        clock-names = "extperiph1", "pllp_grtba";
                        mclk = "extperiph1";
                        clock-frequency = <24000000>;
                        status = "okay";

                        mode0 {
                                mclk_khz = "24000";
                                num_lanes = "1";
                                tegra_sinterface = "serial_a";
                                phy_mode = "DPHY";
                                discontinuous_clk = "yes";
                                dpcm_enable = "false";
                                cil_settletime = "0";

                                active_w = "1920";
                                active_h = "1080";
                                pixel_t="gray";
                                pixel_phase="y";
                                dynamic_pixel_bit_depth = "8";
                                csi_pixel_bit_depth = "8";
                                readout_orientation = "0";
                                line_length = "2200";
                                inherent_gain = "1";
                                mclk_multiplier = "9.33";
                                pix_clk_hz = "42000000";

                                gain_factor = "10";
                                min_gain_val = "10"; /* 1.00x */
                                max_gain_val = "160"; /* 10.66x */
                                step_gain_val = "1";
                                default_gain = "10"; /* 1.00x */
                                min_hdr_ratio = "1";
                                max_hdr_ratio = "1";
                                framerate_factor = "1000000";
                                min_framerate = "1000000"; /* 2.0 fps */
                                max_framerate = "30000000"; /* 30.0 fps */
                                step_framerate = "1";
                                default_framerate = "30000000"; /* 30.0 fps */
                                exposure_factor = "1000000";
                                min_exp_time = "34"; /* us */
                                max_exp_time = "550385"; /* us */
                                step_exp_time = "1";
                                default_exp_time = "33334"; /* us */
                                embedded_metadata_height = "0";
                        };

                        ports {
                                status="okay";
                                #address-cells = <1>;
                                #size-cells = <0>;
                                port@0 {
                                        status="okay";
                                        reg = <0>;
                                        rbpcv2_ov5693_out0: endpoint {
                                                status="okay";
                                                port-index = <0>;
                                                bus-width = <1>;
                                                remote-endpoint = <&rbpcv2_ov5693_csi_in0>;
                                        };
                                };
                        };
                };
        };
};
/ {
        tcp: tegra-camera-platform {
                compatible = "nvidia, tegra-camera-platform";
                num_csi_lanes = <1>;
                max_lane_speed = <336000>;
                min_bits_per_pixel = <8>;
                vi_peak_byte_per_pixel = <2>;
                vi_bw_margin_pct = <25>;
                max_pixel_rate = <240000>;
                isp_peak_byte_per_pixel = <5>;
                isp_bw_margin_pct = <25>;
                status="okay";

                modules {
                        status="okay";
                        cam_module0: module0 {
                                status="okay";
                                badge = "jakku_front_RBP194";
                                position = "front";
                                orientation = "1";
                                cam_module0_drivernode0: drivernode0 {
                                        status="okay";
                                        pcl_id = "v4l2_sensor";
                                        devname = "ov5693 2-0036";
                                        proc-device-tree = "/proc/device-tree/i2c@3180000/rbpcv2_ov5693_a@36";
                                };
                        };
                };
        };
};
  1. Disabled the camera plugins and added status=“okay”; in camera nodes.
  2. Modified the driver files ov5693.c and ov5693_mode_tbls.h to ignore the I2C and reset/pwdn gpio part.
    ov5693_mode_tbls.h (1.3 KB)
    ov5693.c (14.4 KB)
  3. Compiled the kernel, Flashed the board, and tested the data capture.

The CSI video node registration is happening and I got the /dev/video0 node,

$ ls /dev/video0 
/dev/video0
$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
	Index       : 0
	Type        : Video Capture
	Pixel Format: 'GREY'
	Name        : 8-bit Greyscale
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=GREY --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100 --stream-to=test.raw

I got the following error

[  +2.568005] tegra194-vi5 15c10000.vi: no reply from camera processor
[  +0.000167] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[  +0.000177] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[  +0.002355] tegra194-vi5 15c10000.vi: err_rec: successfully reset the capture channel
[  +2.557313] tegra194-vi5 15c10000.vi: no reply from camera processor
[  +0.000222] tegra194-vi5 15c10000.vi: uncorr_err: request timed out after 2500 ms
[  +0.000178] tegra194-vi5 15c10000.vi: err_rec: attempting to reset the capture channel
[  +0.000190] tegra194-vi5 15c10000.vi: unexpected response from camera processor
[  +0.000136] video4linux video0: vi capture release failed
[  +0.000102] tegra194-vi5 15c10000.vi: fatal: error recovery failed

Could you provide some inputs to debug further on this issue ?

Thanks,
Ajith.

Hello ajith.kumaresh,

It seems the driver configuration is ok by doing a quick look at the dtsi and knowing you got the video0 node,

As a quick thought are you sure there is data coming from that lane? Is the FPGA streaming? Just to discard that is the issue

Best regards,
Roberto Gutierrez,
Embedded Software Engineer

Also check the trace log to get more information.

Hi @robertogs2

I have probed the FPGA CSI lines, The data is transferring from the FPGA board. But I couldn’t capture the data.

Thanks,
Ajith.

Hi @ShaneCCC

I have enabled the trace and captured the trace logs,

# cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
460800000
# cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate
576000000
# cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
314000000
# cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 117/117   #P:6
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
        v4l2-ctl-8393  [004] ....  1201.860065: tegra_channel_open: vi-output, ov5693 2-0036
        v4l2-ctl-8393  [000] ....  1201.862723: tegra_channel_set_power: ov5693 2-0036 : 0x1
        v4l2-ctl-8393  [000] ....  1201.862738: camera_common_s_power: status : 0x1
        v4l2-ctl-8393  [000] ....  1201.862775: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
        v4l2-ctl-8393  [000] ....  1201.862778: csi_s_power: enable : 0x1
        v4l2-ctl-8393  [001] ....  1201.865706: tegra_channel_close: vi-output, ov5693 2-0036
        v4l2-ctl-8393  [001] ....  1201.865714: tegra_channel_set_power: ov5693 2-0036 : 0x0
        v4l2-ctl-8393  [001] ....  1201.865746: camera_common_s_power: status : 0x0
        v4l2-ctl-8393  [001] ....  1201.865790: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
        v4l2-ctl-8393  [001] ....  1201.865792: csi_s_power: enable : 0x0
 gst-plugin-scan-8429  [004] ....  1266.784417: tegra_channel_open: vi-output, ov5693 2-0036
 gst-plugin-scan-8429  [000] ....  1266.786071: tegra_channel_set_power: ov5693 2-0036 : 0x1
 gst-plugin-scan-8429  [000] ....  1266.786085: camera_common_s_power: status : 0x1
 gst-plugin-scan-8429  [000] ....  1266.786132: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
 gst-plugin-scan-8429  [000] ....  1266.786135: csi_s_power: enable : 0x1
 gst-plugin-scan-8429  [000] ....  1266.788782: tegra_channel_close: vi-output, ov5693 2-0036
 gst-plugin-scan-8429  [000] ....  1266.788787: tegra_channel_set_power: ov5693 2-0036 : 0x0
 gst-plugin-scan-8429  [000] ....  1266.788792: camera_common_s_power: status : 0x0
 gst-plugin-scan-8429  [000] ....  1266.788823: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
 gst-plugin-scan-8429  [000] ....  1266.788824: csi_s_power: enable : 0x0
  gst-launch-1.0-8428  [002] ....  1267.022811: tegra_channel_open: vi-output, ov5693 2-0036
  gst-launch-1.0-8428  [002] ....  1267.022825: tegra_channel_set_power: ov5693 2-0036 : 0x1
  gst-launch-1.0-8428  [002] ....  1267.022832: camera_common_s_power: status : 0x1
  gst-launch-1.0-8428  [002] ....  1267.022887: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
  gst-launch-1.0-8428  [002] ....  1267.022889: csi_s_power: enable : 0x1
  gst-launch-1.0-8428  [002] ....  1267.022915: tegra_channel_close: vi-output, ov5693 2-0036
  gst-launch-1.0-8428  [002] ....  1267.022918: tegra_channel_set_power: ov5693 2-0036 : 0x0
  gst-launch-1.0-8428  [002] ....  1267.022922: camera_common_s_power: status : 0x0
  gst-launch-1.0-8428  [002] ....  1267.022963: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
  gst-launch-1.0-8428  [002] ....  1267.022965: csi_s_power: enable : 0x0
  gst-launch-1.0-8434  [003] ....  1279.281952: tegra_channel_open: vi-output, ov5693 2-0036
  gst-launch-1.0-8434  [000] ....  1279.283897: tegra_channel_set_power: ov5693 2-0036 : 0x1
  gst-launch-1.0-8434  [000] ....  1279.283910: camera_common_s_power: status : 0x1
  gst-launch-1.0-8434  [000] ....  1279.283947: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
  gst-launch-1.0-8434  [000] ....  1279.283949: csi_s_power: enable : 0x1
  gst-launch-1.0-8434  [000] ....  1279.285601: tegra_channel_close: vi-output, ov5693 2-0036
  gst-launch-1.0-8434  [000] ....  1279.285607: tegra_channel_set_power: ov5693 2-0036 : 0x0
  gst-launch-1.0-8434  [000] ....  1279.285612: camera_common_s_power: status : 0x0
  gst-launch-1.0-8434  [000] ....  1279.285650: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
  gst-launch-1.0-8434  [000] ....  1279.285652: csi_s_power: enable : 0x0
  gst-launch-1.0-8448  [005] ....  1321.469779: tegra_channel_open: vi-output, ov5693 2-0036
  gst-launch-1.0-8448  [000] ....  1321.471741: tegra_channel_set_power: ov5693 2-0036 : 0x1
  gst-launch-1.0-8448  [000] ....  1321.471754: camera_common_s_power: status : 0x1
  gst-launch-1.0-8448  [000] ....  1321.471792: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
  gst-launch-1.0-8448  [000] ....  1321.471827: csi_s_power: enable : 0x1
  gst-launch-1.0-8448  [000] ....  1321.473691: tegra_channel_close: vi-output, ov5693 2-0036
  gst-launch-1.0-8448  [000] ....  1321.473698: tegra_channel_set_power: ov5693 2-0036 : 0x0
  gst-launch-1.0-8448  [000] ....  1321.473702: camera_common_s_power: status : 0x0
  gst-launch-1.0-8448  [000] ....  1321.473736: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
  gst-launch-1.0-8448  [000] ....  1321.473738: csi_s_power: enable : 0x0
  gst-launch-1.0-8453  [005] ....  1331.082902: tegra_channel_open: vi-output, ov5693 2-0036
  gst-launch-1.0-8453  [000] ....  1331.084367: tegra_channel_set_power: ov5693 2-0036 : 0x1
  gst-launch-1.0-8453  [000] ....  1331.084380: camera_common_s_power: status : 0x1
  gst-launch-1.0-8453  [000] ....  1331.084443: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
  gst-launch-1.0-8453  [000] ....  1331.084446: csi_s_power: enable : 0x1
  gst-launch-1.0-8453  [000] ....  1331.085923: tegra_channel_close: vi-output, ov5693 2-0036
  gst-launch-1.0-8453  [000] ....  1331.085929: tegra_channel_set_power: ov5693 2-0036 : 0x0
  gst-launch-1.0-8453  [000] ....  1331.085933: camera_common_s_power: status : 0x0
  gst-launch-1.0-8453  [000] ....  1331.085968: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x0
  gst-launch-1.0-8453  [000] ....  1331.085969: csi_s_power: enable : 0x0
  gst-launch-1.0-8453  [000] ....  1331.093178: tegra_channel_open: vi-output, ov5693 2-0036
  gst-launch-1.0-8453  [000] ....  1331.093192: tegra_channel_set_power: ov5693 2-0036 : 0x1
  gst-launch-1.0-8453  [000] ....  1331.093200: camera_common_s_power: status : 0x1
  gst-launch-1.0-8453  [000] ....  1331.093271: tegra_channel_set_power: 15a00000.nvcsi--1 : 0x1
  gst-launch-1.0-8453  [000] ....  1331.093274: csi_s_power: enable : 0x1
    v4l2src0:src-8454  [004] ....  1331.098606: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 5
    v4l2src0:src-8454  [001] ....  1331.102554: tegra_channel_set_stream: enable : 0x1
    v4l2src0:src-8454  [001] ....  1331.103884: tegra_channel_set_stream: 15a00000.nvcsi--1 : 0x1
    v4l2src0:src-8454  [001] ....  1331.104009: csi_s_stream: enable : 0x1
    v4l2src0:src-8454  [001] ....  1331.104196: tegra_channel_set_stream: ov5693 2-0036 : 0x1
     kworker/0:2-8183  [000] ....  1331.153519: rtos_queue_peek_from_isr_failed: tstamp:42137380694 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1331.153526: rtcpu_start: tstamp:42137382636
     kworker/0:2-8183  [000] ....  1331.153528: rtos_queue_send_from_isr_failed: tstamp:42137394905 queue:0x0bcb41f8
     kworker/0:2-8183  [000] ....  1331.153530: rtos_queue_send_from_isr_failed: tstamp:42137395058 queue:0x0bcb8a60
     kworker/0:2-8183  [000] ....  1331.153531: rtos_queue_send_from_isr_failed: tstamp:42137395209 queue:0x0bcba5e0
     kworker/0:2-8183  [000] ....  1331.153532: rtos_queue_send_from_isr_failed: tstamp:42137395356 queue:0x0bcbb3a0
     kworker/0:2-8183  [000] ....  1331.153533: rtos_queue_send_from_isr_failed: tstamp:42137395504 queue:0x0bcbc160
     kworker/0:2-8183  [000] ....  1331.153535: rtcpu_string: tstamp:42137395940 id:0x04010000 str:"Configuring VI GoS.
"
     kworker/0:2-8183  [000] ....  1331.153578: rtcpu_string: tstamp:42137396116 id:0x04010000 str:"VM GOS[#0] addr=0xc2100000
"
     kworker/0:2-8183  [000] ....  1331.153603: rtcpu_string: tstamp:42137396373 id:0x04010000 str:"VM GOS[#1] addr=0xc2101000
"
     kworker/0:2-8183  [000] ....  1331.153616: rtcpu_string: tstamp:42137396644 id:0x04010000 str:"VM GOS[#2] addr=0xc2102000
"
     kworker/0:2-8183  [000] ....  1331.153628: rtcpu_string: tstamp:42137396876 id:0x04010000 str:"VM GOS[#3] addr=0xc2103000
"
     kworker/0:2-8183  [000] ....  1331.153639: rtcpu_string: tstamp:42137397108 id:0x04010000 str:"VM GOS[#4] addr=0xc2104000
"
     kworker/0:2-8183  [000] ....  1331.153650: rtcpu_string: tstamp:42137397340 id:0x04010000 str:"VM GOS[#5] addr=0xc2105000
"
     kworker/0:2-8183  [000] ....  1331.153661: rtcpu_string: tstamp:42137406120 id:0x04010000 str:"vi5_hwinit: firmware CL2018101701 protocol versi"
     kworker/0:2-8183  [000] ....  1331.153663: rtcpu_string: tstamp:42137406254 id:0x04010000 str:"on 2.2
"
     kworker/0:2-8183  [000] ....  1331.153675: rtos_queue_send_from_isr_failed: tstamp:42137420547 queue:0x0bcb41f8
     kworker/0:2-8183  [000] ....  1331.153676: rtos_queue_send_from_isr_failed: tstamp:42137420716 queue:0x0bcb8a60
     kworker/0:2-8183  [000] ....  1331.153678: rtos_queue_send_from_isr_failed: tstamp:42137420871 queue:0x0bcba5e0
     kworker/0:2-8183  [000] ....  1331.153679: rtos_queue_send_from_isr_failed: tstamp:42137421019 queue:0x0bcbb3a0
     kworker/0:2-8183  [000] ....  1331.153680: rtos_queue_send_from_isr_failed: tstamp:42137421164 queue:0x0bcbc160
     kworker/0:2-8183  [000] ....  1331.153681: rtcpu_string: tstamp:42137422028 id:0x04010000 str:"VI GOS[#0] set to VM GOS[4] base 0xc2104000
"
     kworker/0:2-8183  [000] ....  1331.153725: rtos_queue_send_from_isr_failed: tstamp:42137472283 queue:0x0bcb41f8
     kworker/0:2-8183  [000] ....  1331.153727: rtos_queue_send_from_isr_failed: tstamp:42137472432 queue:0x0bcb8a60
     kworker/0:2-8183  [000] ....  1331.153728: rtos_queue_send_from_isr_failed: tstamp:42137472585 queue:0x0bcba5e0
     kworker/0:2-8183  [000] ....  1331.153729: rtos_queue_send_from_isr_failed: tstamp:42137472733 queue:0x0bcbb3a0
     kworker/0:2-8183  [000] ....  1331.153730: rtos_queue_send_from_isr_failed: tstamp:42137472878 queue:0x0bcbc160
     kworker/0:2-8183  [000] ....  1331.153733: rtcpu_vinotify_event: tstamp:42137745203 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:42727485792 data:0x10000000
     kworker/0:2-8183  [000] ....  1331.153734: rtcpu_vinotify_event: tstamp:42137745367 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:42727494144 data:0x31000001
     kworker/0:2-8183  [000] ....  1331.153735: rtcpu_vinotify_event: tstamp:42137745529 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:42727496288 data:0x07020001
     kworker/0:2-8183  [000] ....  1331.153736: rtcpu_vinotify_event: tstamp:42137745670 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:42727530144 data:0x10000000
     kworker/0:2-8183  [000] ....  1331.153737: rtcpu_vinotify_event: tstamp:42137745828 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:42727538560 data:0x31000002
     kworker/0:2-8183  [000] ....  1331.265480: rtos_queue_peek_from_isr_failed: tstamp:42142381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1331.433463: rtos_queue_peek_from_isr_failed: tstamp:42147381072 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1331.601466: rtos_queue_peek_from_isr_failed: tstamp:42152381072 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1331.769466: rtos_queue_peek_from_isr_failed: tstamp:42157381067 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1331.937553: rtos_queue_peek_from_isr_failed: tstamp:42162381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1332.105462: rtos_queue_peek_from_isr_failed: tstamp:42167381070 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1332.273477: rtos_queue_peek_from_isr_failed: tstamp:42172381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1332.385507: rtos_queue_peek_from_isr_failed: tstamp:42177381070 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1332.553463: rtos_queue_peek_from_isr_failed: tstamp:42182381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1332.721471: rtos_queue_peek_from_isr_failed: tstamp:42187381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1332.889476: rtos_queue_peek_from_isr_failed: tstamp:42192381070 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1333.057471: rtos_queue_peek_from_isr_failed: tstamp:42197381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1333.225462: rtos_queue_peek_from_isr_failed: tstamp:42202381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1333.393482: rtos_queue_peek_from_isr_failed: tstamp:42207381068 queue:0x0bcbcf78
     kworker/0:2-8183  [000] ....  1333.505462: rtos_queue_peek_from_isr_failed: tstamp:42212381067 queue:0x0bcbcf78
root:~#

Thanks,
Ajith.

The trace log tell NVCSI/VI didn’t receive any validate package from MIPI bus.
You may need to probe the signal to confirm the output signal from FPGA.

Hi @ShaneCCC

I already probed the FPGA CSI lines, I got the preconfigured CSI data on the FPGA side,
Do I need to do any other software configurations from my side?

Regards,
Ajith.

You need make sure the output signal match MIPI spec.

Hi @ShaneCCC

I have resolved the issues, Now I am able to issue the capture commands without crash but all the frames are discarded from the Jetson side. I am getting the following error, The captured file is empty,
Could you provide some information to debug this issue.

[ +44.804716] This is from ov5693_power_on 270
[ +0.000133] ov5693 9-0003: ov5693_power_on: power on
[ +0.014745] This is from ov5693_set_mode 375
[ +0.000152] This is from ov5693_write_table 114
[ +0.003665] This is from ov5693_start_streaming 384
[ +0.002966] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 6, err_data 512
[ +0.014168] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.011430] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[ +0.005223] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.002474] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512
[ +0.002833] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512
[ +0.008431] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.011814] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.005835] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512
[ +0.008276] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512
[ +0.008094] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.008600] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512
[ +0.008519] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.008647] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 512
[ +0.008517] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.008872] tegra194-vi5 15c10000.vi: corr_err: discarding frame 0, flags: 96, err_data 8388704
[ +0.008760] This is from ov5693_stop_streaming 395
[ +0.062839] This is from ov5693_power_off 291
[ +0.000114] ov5693 9-0003: ov5693_power_off: power off

Regards,
Ajith.

Please get the trace log to check if can get more information.

https://elinux.org/Jetson/l4t/Camera_BringUp

Hi @ShaneCCC

I have enabled the trace and captured the trace logs,
I am using the following command to capture the data,

$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-count=1 --stream-mmap --stream-to=csi.raw --verbose
trace_logs.txt (159.4 KB)

Thanks,
Ajith.

Check the wiki for the chansel_fault.
Looks like the embedded_metadata_height in device tree incorrect.

Hi @ShaneCCC

I have tested with different embedded_metadata_height values But I still get the frame drop error.
trace_logs.txt (46.2 KB)
logs.txt (2.7 KB)

Thanks,
Ajith.

Below message tell the short frame means the output lines less than expect. You can reduce the height(active_h) in dts to try.

tag:CHANSEL_SHORT_FRAME channel:0x01 frame:1 vi_tstamp:3602805871 data:0x01000000

Hi
I found that the following function calculates wrong frame_length value.
*static int ov5693_set_frame_rate(struct tegracam_device tc_dev, s64 val)
So I have hard-coded the correct value in this function.
But It gets 1 FPS as an argument (s64 val), I couldn’t change the frame_rate value.

Could you provide some ideas to debug this issue.

Thanks,
Ajith.

If your sensor isn’t Bayer sensor this function shouldn’t impact the real frame rate.

okay, I understood,

Is there a way to check what CSI configurations the driver expects from the FPGA?

You may need to modify the configure from vi5_fops.c and csi5_fops.c for checking.

I got the output. The issue was with the FPGA CSI configurations.

I use NX to follow your changes above. In the kernel, you can see that the driver has been loaded, but there is no video0 device under /dev. I guess it may be that I did not Disabled the camera plugins and added status=“okay” ”; in camera nodes.” But Xavier NX doesn’t seem to have camera plugins manage.

[ 2.109096] ov5693 2-0036: probing v4l2 sensor no i2c.
[ 2.109232] ov5693 2-0036: tegracam sensor driver:ov5693_v2.0.6
[ 2.109285] ov5693 2-0036: Detected OV5693 sensor