Jetpack-5.1.2 - Disable CRC check

Dear Experts,

I am bringing up an FPGA bridge as described in the following link : CSI-2 Image Simulator Lattice CrosslinkFPGA to Jetson Nano - Hackster.io and facing the issue of CRC check failure :

# tracer: nop
#
# entries-in-buffer/entries-written: 870640/2183374   #P:4
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
        v4l2-ctl-2488    [001] ....   176.092825: tegra_channel_open: vi-output, imx219 1-0010
        v4l2-ctl-2488    [001] ....   176.114428: tegra_channel_set_power: imx219 1-0010 : 0x1
        v4l2-ctl-2488    [001] ....   176.114443: camera_common_s_power: status : 0x1
        v4l2-ctl-2488    [001] ....   176.124995: tegra_channel_set_power: 13e10000.host1x:nvcsi@15a00000- : 0x1
        v4l2-ctl-2488    [001] ....   176.124999: csi_s_power: enable : 0x1
        v4l2-ctl-2488    [001] ....   176.125964: tegra_channel_capture_setup: vnc_id 0 W 3280 H 2464 fmt c4
##### CPU 2 buffer started ####
     kworker/2:3-107     [002] ....   195.012162: rtcpu_nvcsi_intr: tstamp:6916634602 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012163: rtcpu_nvcsi_intr: tstamp:6916634602 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012163: rtcpu_nvcsi_intr: tstamp:6916635207 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012163: rtcpu_nvcsi_intr: tstamp:6916635207 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012164: rtcpu_nvcsi_intr: tstamp:6916635815 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012164: rtcpu_nvcsi_intr: tstamp:6916635815 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012164: rtcpu_nvcsi_intr: tstamp:6916636422 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012165: rtcpu_nvcsi_intr: tstamp:6916636422 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012165: rtcpu_nvcsi_intr: tstamp:6916637026 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012165: rtcpu_nvcsi_intr: tstamp:6916637026 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012166: rtcpu_nvcsi_intr: tstamp:6916637633 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012166: rtcpu_nvcsi_intr: tstamp:6916637633 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012166: rtcpu_nvcsi_intr: tstamp:6916638237 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012167: rtcpu_nvcsi_intr: tstamp:6916638237 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012167: rtcpu_nvcsi_intr: tstamp:6916639109 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012167: rtcpu_nvcsi_intr: tstamp:6916639109 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012168: rtcpu_nvcsi_intr: tstamp:6916639699 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012168: rtcpu_nvcsi_intr: tstamp:6916640079 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012168: rtcpu_nvcsi_intr: tstamp:6916640079 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012169: rtcpu_nvcsi_intr: tstamp:6916640662 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012169: rtcpu_nvcsi_intr: tstamp:6916640662 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012169: rtcpu_nvcsi_intr: tstamp:6916641269 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012170: rtcpu_nvcsi_intr: tstamp:6916641269 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/2:3-107     [002] ....   195.012170: rtcpu_nvcsi_intr: tstamp:6916641862 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004

There have already been the instructions to disable the CRC check for TX2/TX2NX and even for Xavier NX.

I would like to have something similar to the later, but for newer Jetpack-5.1.2 especially for the RTC firmware that is proprietary.

Could you help to provide the RTCPU firmware and the instruction/patch for disabling the CRC check in Jetpack-5.1.2, please ?

Thanks in advance and best regards,
Khang

hello khang.l4es,

could you please try this attach rce-fw (it’s for r35.4.1 release verison) which has configure CRC check as disabled.
for instance, Topic295079_Jun04.zip (255.0 KB)

Hi @JerryChang,

Thanks for your support. By the way, does it mean that I need to move to the Jetpack-5.1.3? And how about the patch for the csi5_fops.c within that Jetpack, please ?

Best Regards,
Khang

hello khang.l4es,

there’s a typo. that previous attached rce-fw is actually build from r35.4.1 release version. I’ll also update my comment to avoid confusion.
you may also try to include that CSI5 patches, but… may I know what’s your test pipeline?
for instance, are you running with v4l2src or nvarguscamerasrc plugin?

Hi @JerryChang,

I would like to use gstreamer with nvarguscamerasrc plugin to visualize the test pattern. However, in case of debugging, I would use v4l2 for measuring the framerate.

Best Regards.
Khang

Hi @JerryChang,

Do you have any advice on the patch of csi5_fops.c for Jetpack-5.1.2, please ?

Best Regards,
Khang

hello khang.l4es,

you may try adding the patch to JP-5.1.2 kernel sources.
please follow the patch to setup error config mask, and adding it to set NVCSI stream config.
note, it’s not well-tested since it’s not an official patch to disable CRC check.

Hi @JerryChang,

I modified the patch I found in another discussion :

diff --git a/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c b/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
index b104ab3eb..dbcded818 100644
--- a/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
+++ b/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c
@@ -219,8 +219,10 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        struct CAPTURE_CONTROL_MSG msg;
        struct nvcsi_brick_config brick_config;
        struct nvcsi_cil_config cil_config;
+       struct nvcsi_error_config error_config;
        u32 phy_mode = read_phy_mode_from_dt(chan);
        bool is_cphy = (phy_mode == CSI_PHY_MODE_CPHY);
+
        dev_dbg(csi->dev, "%s: stream_id=%u, csi_port=%u\n",
                __func__, stream_id, csi_port);
 
@@ -290,6 +292,11 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        else
                cil_config.mipi_clock_rate = csi->clk_freq / 1000;
 
+       /* Error config */
+       memset(&error_config, 0, sizeof(error_config));
+       error_config.stream_intr_mask = 0x3;
+       error_config.status2vi_notify_mask = 0xFFFF;
+
        /* Set NVCSI stream config */
        memset(&msg, 0, sizeof(msg));
        msg.header.msg_id = CAPTURE_CSI_STREAM_SET_CONFIG_REQ;
@@ -298,6 +305,8 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        msg.csi_stream_set_config_req.csi_port = csi_port;
        msg.csi_stream_set_config_req.brick_config = brick_config;
        msg.csi_stream_set_config_req.cil_config = cil_config;
+       msg.csi_stream_set_config_req.error_config = error_config;
+       msg.csi_stream_set_config_req.config_flags = NVCSI_CONFIG_FLAG_BRICK | NVCSI_CONFIG_FLAG_CIL | NVCSI_CONFIG_FLAG_ERROR;
 
        if (tegra_chan->valid_ports > 1)
                vi_port = (stream_id > 0) ? 1 : 0;
(END)
+
        dev_dbg(csi->dev, "%s: stream_id=%u, csi_port=%u\n",
                __func__, stream_id, csi_port);
 
@@ -290,6 +292,11 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        else
                cil_config.mipi_clock_rate = csi->clk_freq / 1000;
 
+       /* Error config */
+       memset(&error_config, 0, sizeof(error_config));
+       error_config.stream_intr_mask = 0x3;
+       error_config.status2vi_notify_mask = 0xFFFF;
+
        /* Set NVCSI stream config */
        memset(&msg, 0, sizeof(msg));
        msg.header.msg_id = CAPTURE_CSI_STREAM_SET_CONFIG_REQ;
@@ -298,6 +305,8 @@ static int csi5_stream_set_config(struct tegra_csi_channel *chan, u32 stream_id,
        msg.csi_stream_set_config_req.csi_port = csi_port;
        msg.csi_stream_set_config_req.brick_config = brick_config;
        msg.csi_stream_set_config_req.cil_config = cil_config;
+       msg.csi_stream_set_config_req.error_config = error_config;
+       msg.csi_stream_set_config_req.config_flags = NVCSI_CONFIG_FLAG_BRICK | NVCSI_CONFIG_FLAG_CIL | NVCSI_CONFIG_FLAG_ERROR;
 
        if (tegra_chan->valid_ports > 1)
                vi_port = (stream_id > 0) ? 1 : 0;

However, there’s still a small incompatibility with Jetpack-5.1.2, it introduced following compilation error :

/devel/RTR/SW/nvidia-jetson-orin-based-camera-driver-v2-next-test/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c: In function 'csi5_stream_set_config':
/devel/RTR/SW/nvidia-jetson-orin-based-camera-driver-v2-next-test/kernel/nvidia/drivers/media/platform/tegra/camera/nvcsi/csi5_fops.c:297:15: error: 'struct nvcsi_error_config' has no member named 'stream_intr_mask'; did you mean 'stream_intr_mask_lic'?
  297 |  error_config.stream_intr_mask = 0x3;
      |               ^~~~~~~~~~~~~~~~
      |               stream_intr_mask_lic
make[7]: *** [drivers/media/platform/tegra/camera/nvcsi/csi5_fops.o] Error 1
make[6]: *** [drivers/media/platform/tegra/camera/nvcsi] Error 2
make[5]: *** [drivers/media/platform/tegra/camera] Error 2
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [drivers/media/platform/tegra] Error 2
make[3]: *** [drivers/media/platform] Error 2
make[2]: *** [drivers/media] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [drivers] Error 2
make: *** [__sub-make] Error 2

Can you help to unblock (i.e. to select btw stream_intr_mask_lic or stream_intr_mask_hsm instead of stream_intr_mask), please ?

Best Regards,
Khang

hello khang.l4es,

it’s _lic for runtime local error report, and _hsm for external (to VI and HSM) error reports.
you may try disable both of them for testing.