XAVIER NX VI Debug Codes

Continuing discussion from Camera Mipi CSI-2 Data with repetition of one correct frame and 3 empty frames since it is now tested on XAVIER NX.
Let’s start with some background. We are using FPGA from Lattice to bridge a sensor from SLVS to MIPI-CSI. The FPGA is cutting away the first line, so that is why we have the weird resolution of 539 height.
We managed to control the FPGA ip core, so that we now have good correct images, except for the 3 empty ones in between. Those seem to not happen with GStreamer since GStreamer display is correct, but using fpssink displays the correct amount of frames (so they dont seem to be just removed).

Now I wanted to try out on XAVIER NX instead of NANO and we get a different result. V4L2-ctl and GStreamer do not get any frames. On dmesg I get the following output:

[  +0.017136] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2, flags: 6, err_data 256
[  +0.008259] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 256
[  +0.008196] tegra194-vi5 15c10000.vi: corr_err: discarding frame 2, flags: 0, err_data 256
[  +0.008196] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 256

Activating more debug and reading the trace gives me these results:

     kworker/0:0-8071  [000] ....  1549.953865: rtcpu_nvcsi_intr: tstamp:48813517562 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000089
     kworker/0:0-8071  [000] ....  1549.953866: rtcpu_nvcsi_intr: tstamp:48813517562 class:GLOBAL type:PHY_INTR0 phy:0 cil:1 st:0 vc:0 status:0x00000088
     kworker/0:0-8071  [000] ....  1549.953869: rtcpu_vinotify_event: tstamp:48813935881 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50201286944 data:0x10000000
     kworker/0:0-8071  [000] ....  1549.953870: rtcpu_vinotify_event: tstamp:48813936023 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50201295168 data:0x31000001
     kworker/0:0-8071  [000] ....  1549.953871: rtcpu_vinotify_event: tstamp:48813936185 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:50201297280 data:0x07020001
     kworker/0:0-8071  [000] ....  1549.953872: rtcpu_vinotify_event: tstamp:48813936320 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50201330976 data:0x10000000
     kworker/0:0-8071  [000] ....  1549.953873: rtcpu_vinotify_event: tstamp:48813936477 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50201339264 data:0x31000002
     kworker/0:0-8071  [000] ....  1550.009740: rtcpu_vinotify_event: tstamp:48815523552 tag:FS channel:0x00 frame:1 vi_tstamp:48815390852 data:0x00000010
     kworker/0:0-8071  [000] ....  1550.009746: rtcpu_vinotify_event: tstamp:48815523716 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:48815390855 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.009747: rtcpu_vinotify_event: tstamp:48815523856 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:48815391333 data:0x00000001
     kworker/0:0-8071  [000] ....  1550.009748: rtcpu_vinotify_event: tstamp:48815524017 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:50264038720 data:0x08020001
     kworker/0:0-8071  [000] ....  1550.009749: rtcpu_vinotify_event: tstamp:48815524152 tag:CHANSEL_FAULT channel:0x23 frame:1 vi_tstamp:48815391415 data:0x00000100
     kworker/0:0-8071  [000] ....  1550.009750: rtcpu_vinotify_event: tstamp:48815524309 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:50264065088 data:0x01020001
     kworker/0:0-8071  [000] ....  1550.009751: rtcpu_vinotify_event: tstamp:48815524444 tag:CHANSEL_FAULT channel:0x23 frame:1 vi_tstamp:48815520298 data:0x021a0182
     kworker/0:0-8071  [000] ....  1550.009752: rtcpu_vinotify_event: tstamp:48815524599 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:50268169344 data:0x01020001
     kworker/0:0-8071  [000] ....  1550.009753: rtcpu_vinotify_event: tstamp:48815524734 tag:ATOMP_FRAME_DONE channel:0x23 frame:1 vi_tstamp:48815520324 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.009754: rtcpu_vinotify_event: tstamp:48815524891 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:50268174176 data:0x02020001
     kworker/0:0-8071  [000] ....  1550.009755: rtcpu_vinotify_event: tstamp:48815525031 tag:FE channel:0x00 frame:1 vi_tstamp:48815520449 data:0x00000020
     kworker/0:0-8071  [000] ....  1550.009757: rtcpu_vinotify_event: tstamp:48815779895 tag:ATOMP_FE channel:0x00 frame:1 vi_tstamp:48815520451 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.009758: rtcpu_vinotify_event: tstamp:48815780035 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:50268196640 data:0x07020002
     kworker/0:0-8071  [000] ....  1550.009759: rtcpu_vinotify_event: tstamp:48815780195 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50268311648 data:0x10000000
     kworker/0:0-8071  [000] ....  1550.009760: rtcpu_vinotify_event: tstamp:48815780329 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50268340768 data:0x31000003
     kworker/0:0-8071  [000] ....  1550.009761: rtcpu_vinotify_event: tstamp:48815780486 tag:FS channel:0x00 frame:2 vi_tstamp:48815647191 data:0x00000010
     kworker/0:0-8071  [000] ....  1550.009762: rtcpu_vinotify_event: tstamp:48815780625 tag:ATOMP_FS channel:0x00 frame:2 vi_tstamp:48815647193 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.009763: rtcpu_vinotify_event: tstamp:48815780781 tag:CHANSEL_PXL_SOF channel:0x23 frame:2 vi_tstamp:48815647672 data:0x00000001
     kworker/0:0-8071  [000] ....  1550.009765: rtcpu_vinotify_event: tstamp:48815780916 tag:RESERVED_19 channel:0x23 frame:2 vi_tstamp:50272241600 data:0x08020002
     kworker/0:0-8071  [000] ....  1550.009766: rtcpu_vinotify_event: tstamp:48815781072 tag:CHANSEL_FAULT channel:0x23 frame:2 vi_tstamp:48815647754 data:0x00000100
     kworker/0:0-8071  [000] ....  1550.009767: rtcpu_vinotify_event: tstamp:48815781207 tag:RESERVED_19 channel:0x23 frame:2 vi_tstamp:50272267936 data:0x01020002
     kworker/0:0-8071  [000] ....  1550.009768: rtcpu_vinotify_event: tstamp:48815781364 tag:CHANSEL_FAULT channel:0x23 frame:2 vi_tstamp:48815776637 data:0x021a0182
     kworker/0:0-8071  [000] ....  1550.009769: rtcpu_vinotify_event: tstamp:48815781499 tag:RESERVED_19 channel:0x23 frame:2 vi_tstamp:50276372224 data:0x01020002
     kworker/0:0-8071  [000] ....  1550.009770: rtcpu_vinotify_event: tstamp:48815781653 tag:ATOMP_FRAME_DONE channel:0x23 frame:2 vi_tstamp:48815776663 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.009771: rtcpu_vinotify_event: tstamp:48815781788 tag:RESERVED_19 channel:0x23 frame:2 vi_tstamp:50276377056 data:0x02020002
     kworker/0:0-8071  [000] ....  1550.009772: rtcpu_vinotify_event: tstamp:48815781945 tag:FE channel:0x00 frame:2 vi_tstamp:48815776787 data:0x00000020
     kworker/0:0-8071  [000] ....  1550.009773: rtcpu_vinotify_event: tstamp:48815782081 tag:ATOMP_FE channel:0x00 frame:2 vi_tstamp:48815776790 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.065718: rtcpu_vinotify_event: tstamp:48816036289 tag:RESERVED_19 channel:0x23 frame:0 vi_tstamp:50276399520 data:0x07020003
     kworker/0:0-8071  [000] ....  1550.065744: rtcpu_vinotify_event: tstamp:48816036428 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50276509504 data:0x10000000
     kworker/0:0-8071  [000] ....  1550.065745: rtcpu_vinotify_event: tstamp:48816036587 tag:RESERVED_18 channel:0x23 frame:0 vi_tstamp:50276538624 data:0x31000004
     kworker/0:0-8071  [000] ....  1550.065746: rtcpu_vinotify_event: tstamp:48816036725 tag:FS channel:0x00 frame:1 vi_tstamp:48815903530 data:0x00000010
     kworker/0:0-8071  [000] ....  1550.065746: rtcpu_vinotify_event: tstamp:48816036884 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:48815903534 data:0x00000000
     kworker/0:0-8071  [000] ....  1550.065747: rtcpu_vinotify_event: tstamp:48816037020 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:48815904011 data:0x00000001
     kworker/0:0-8071  [000] ....  1550.065748: rtcpu_vinotify_event: tstamp:48816037177 tag:RESERVED_19 channel:0x23 frame:1 vi_tstamp:50280444384 data:0x08020003
     kworker/0:0-8071  [000] ....  1550.065749: rtcpu_vinotify_event: tstamp:48816037312 tag:CHANSEL_FAULT channel:0x23 frame:1 vi_tstamp:48815904094 data:0x00000100

Can you see any hints on this what could be the problem?
Do you think the 539 pixel height is a big problem? So I could try to improve sensor output by 1.

Do you have any more ideas on why is it kinda working on NANO but not NX. And why is it working on GStreamer but not V4L2?

Any suggestions would help!
Best regards,

hello busch.johannes,

the PHY interrupt shows LP sequence error has detected on data lane and also clock lane.
by checking the later frame signals, it looks like CHANSEL_PXL_EOF is missing.

it might be. VI engine did not support image resolution with odd numbers. please have a try to revise the output height as even numbers.

Nano and Xavier NX were using different code flow, and Xavier series are more critical to the signal settings.
please review sensor device tree, you may check Sensor Pixel Clock section and examine your sensor pixel clock property settings.

I can not do that, because FPGA takes away one line from sensor. But the sensor can only output resolutions multiples of 8.
With other sensors I was using odd resolutions and it was totally fine, so I do not think this should be the problem.

Can you give me some background information or some hint on where to look LP sequence error and CHANSEL_PXL_EOF information up? It seems pretty low level to me, but maybe we need to get into that.

Sensor Pixel Clock looks correct to me, I will try to increase it anyway, and see if it makes a difference.

hello busch.johannes,

you may dig into TRM for some description for the LP sequence.
normally, it should follow by LP11->LP01->LP00->LP11 sequence before going to high-speed for sending frames.
there’s device tree property settings, cil_settletime, it’s by default setting as zero for auto-calibrate, you may try configure THS settle time of the MIPI lane for testing.

Thanks for the tip! I will give it a try!

Thank you for your support! I was able to solve my problem. In the end, the FPGA was adding 16 columns I did not expect so I set the resolution in the device tree and driver were wrong. After correcting it, the Xavier NX was able to stream without errors and with correct frames. The same goes for the Nano.

2 things are important to mention:

  • NANO was streaming without errors, even when the frames were corrupted ( Camera Mipi CSI-2 Data with repetition of one correct frame and 3 empty frames ) while XAVIER NX was not streaming because of errors.
  • On all systems jetson was receiving frames in the resolution I was giving him on the driver and device tree, not the solution the sensor was sending
  • Wrong resolution in the driver seems to produce such errors we have been seeing.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.