Why does the error occur only on J1 camera port?

Hello,

I writing camera driver for Orin NX with Xavier NX Devkit.
It works fine with J9(i2c@1), but I got no image when connected to J1(i2c@0).
I have two questions.

  • The IMX219 and IMX477 used for reference have the property lane_polarity="6" only J1. Why?
  • How can I get a image from J1?

Details:

  1. Using Orin NX 16GB, Xavier NX Devkit, L4T 35.2.1, flush p3509-a02+p3767-0000
  2. I was able to get images with both J1 and J9 using the “Raspberry Pi Camera Module 2”.
  3. The new device was able to capture images when connected to the J9.
  4. I made a device tree for J1 by copying from J9 other than tegra_sinterface=“serial_a” and lane_polarity. but not worked.

trace log when lane_polarity="0"

# tracer: nop
#
# entries-in-buffer/entries-written: 23565/23565   #P:4
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     kworker/2:9-168     [002] ....    60.622487: rtcpu_vinotify_event: tstamp:2616133464 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:83700146304 data:0x399d580010000000
     kworker/2:9-168     [002] ....    60.622491: rtcpu_vinotify_event: tstamp:2616133606 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:83700152768 data:0x0000000031000001
     kworker/2:9-168     [002] ....    60.622491: rtcpu_vinotify_event: tstamp:2616133765 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:83700203776 data:0x399d550010000000
     kworker/2:9-168     [002] ....    60.622491: rtcpu_vinotify_event: tstamp:2616133897 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:83700210368 data:0x0000000031000002
     kworker/2:9-168     [002] ....    60.678492: rtcpu_nvcsi_intr: tstamp:2619031934 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678493: rtcpu_nvcsi_intr: tstamp:2619032503 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678494: rtcpu_nvcsi_intr: tstamp:2619039320 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678495: rtcpu_nvcsi_intr: tstamp:2619046706 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678496: rtcpu_nvcsi_intr: tstamp:2619050115 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678496: rtcpu_nvcsi_intr: tstamp:2619052388 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678497: rtcpu_nvcsi_intr: tstamp:2619059775 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678498: rtcpu_nvcsi_intr: tstamp:2619060343 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080
     kworker/2:9-168     [002] ....    60.678498: rtcpu_nvcsi_intr: tstamp:2619060911 class:GLOBAL type:PHY_INTR0 phy:0 cil:0 st:0 vc:0 status:0x00000080

...

trace log when lane_polarity="6"

 tracer: nop
#
# entries-in-buffer/entries-written: 45661/45661   #P:4
#
#                                _-----=> irqs-off
#                               / _----=> need-resched
#                              | / _---=> hardirq/softirq
#                              || / _--=> preempt-depth
#                              ||| /     delay
#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
#              | |         |   ||||      |         |
     kworker/0:4-387     [000] ....   306.171057: rtcpu_string: tstamp:10289722812 id:0x04010000 str:"VM0 activating."
     kworker/0:4-387     [000] ....   306.171062: rtcpu_vinotify_event: tstamp:10290389504 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:329275297152 data:0x399d580010000000
     kworker/0:4-387     [000] ....   306.171062: rtcpu_vinotify_event: tstamp:10290389665 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:329275303616 data:0x0000000031000001
     kworker/0:4-387     [000] ....   306.171063: rtcpu_vinotify_event: tstamp:10290389822 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:329275349696 data:0x399d550010000000
     kworker/0:4-387     [000] ....   306.171063: rtcpu_vinotify_event: tstamp:10290389954 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:329275356288 data:0x0000000031000002
     kworker/0:4-387     [000] ....   306.287849: rtcpu_nvcsi_intr: tstamp:10293258568 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287851: rtcpu_nvcsi_intr: tstamp:10293258568 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287851: rtcpu_nvcsi_intr: tstamp:10293259163 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287851: rtcpu_nvcsi_intr: tstamp:10293259163 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287851: rtcpu_nvcsi_intr: tstamp:10293259748 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287852: rtcpu_nvcsi_intr: tstamp:10293259748 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287852: rtcpu_nvcsi_intr: tstamp:10293260325 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287852: rtcpu_nvcsi_intr: tstamp:10293260325 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287852: rtcpu_nvcsi_intr: tstamp:10293260905 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287852: rtcpu_nvcsi_intr: tstamp:10293260905 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.287852: rtcpu_nvcsi_intr: tstamp:10293261483 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004

...

     kworker/0:4-387     [000] ....   306.288086: rtcpu_nvcsi_intr: tstamp:10293649519 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288086: rtcpu_nvcsi_intr: tstamp:10293649519 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288086: rtcpu_nvcsi_intr: tstamp:10293650093 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288086: rtcpu_nvcsi_intr: tstamp:10293650093 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293650666 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293650666 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293651239 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293651239 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288089: rtcpu_vinotify_event: tstamp:10293651846 cch:0 vi:0 tag:FS channel:0x00 frame:1 vi_tstamp:329383875584 data:0x0000000100000010
     kworker/0:4-387     [000] ....   306.288089: rtcpu_vinotify_event: tstamp:10293651984 cch:0 vi:0 tag:ATOMP_FS channel:0x00 frame:1 vi_tstamp:329383875712 data:0x0000000800000000
     kworker/0:4-387     [000] ....   306.288089: rtcpu_vinotify_event: tstamp:10293652138 cch:0 vi:0 tag:CHANSEL_EMBED_SOF channel:0x23 frame:1 vi_tstamp:329383877568 data:0x0000000000000004
     kworker/0:4-387     [000] ....   306.288090: rtcpu_vinotify_event: tstamp:10293652819 cch:0 vi:0 tag:CHANSEL_EMBED_EOF channel:0x23 frame:1 vi_tstamp:329383890688 data:0x0000000000000008
     kworker/0:4-387     [000] ....   306.288090: rtcpu_nvcsi_intr: tstamp:10293652305 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288090: rtcpu_nvcsi_intr: tstamp:10293652305 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288090: rtcpu_vinotify_event: tstamp:10293652976 cch:0 vi:0 tag:ATOMP_EMB_DATA_DONE channel:0x23 frame:1 vi_tstamp:329383891648 data:0x0000000000000000
     kworker/0:4-387     [000] ....   306.288090: rtcpu_vinotify_event: tstamp:10293653110 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:1 vi_tstamp:329383939072 data:0x0000000003020001
     kworker/0:4-387     [000] ....   306.288090: rtcpu_vinotify_event: tstamp:10293653265 cch:0 vi:0 tag:CHANSEL_NOMATCH channel:0x01 frame:1 vi_tstamp:329383895808 data:0x00000000000006e9
     kworker/0:4-387     [000] ....   306.288091: rtcpu_vinotify_event: tstamp:10293653398 cch:0 vi:0 tag:CHANSEL_PXL_SOF channel:0x23 frame:1 vi_tstamp:329384259424 data:0x0000000000000001
     kworker/0:4-387     [000] ....   306.288091: rtcpu_nvcsi_intr: tstamp:10293653447 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288091: rtcpu_nvcsi_intr: tstamp:10293653447 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288091: rtcpu_vinotify_event: tstamp:10293654100 cch:0 vi:0 tag:VIFALC_ACTIONLST channel:0x23 frame:1 vi_tstamp:329384270304 data:0x0000000008020001
     kworker/0:4-387     [000] ....   306.288091: rtcpu_nvcsi_intr: tstamp:10293654582 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288092: rtcpu_nvcsi_intr: tstamp:10293654582 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288092: rtcpu_nvcsi_intr: tstamp:10293656287 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288092: rtcpu_nvcsi_intr: tstamp:10293656287 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288092: rtcpu_nvcsi_intr: tstamp:10293657423 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288092: rtcpu_nvcsi_intr: tstamp:10293657423 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288092: rtcpu_nvcsi_intr: tstamp:10293659128 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288093: rtcpu_nvcsi_intr: tstamp:10293659128 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004

...

hello fumiya.fujinaka,

that’s DT property, lane_polarity is the configuration of CAM0/CAM1 camera connectors lane_polarity swizzle for Orin NX.
you’ll see description about this property, re-cap as below…

                                * lane_polarity
                                * Based on the camera connector pin.
                                * CSIx_D0 | CSIx_D1 | CSI(X+1)_D0 | CSI(X+1)CSIx_D1
                                *    LSB  |   BIT1  |     BIT2    |      MSB
                                * if there is a polarity swap on any lane, the bit corrsponding
                                * to the lane should be set
                                * e.g. polarity swap on CSIx_D0 only -> lane_polarity = "1"; 0001
                                * e.g. polarity swap on CSIx_D1 and CSI(X+1)_D0 -> lane_polarity = "6"; 0110

Hello, JerryChang

Thank you for your reply.
I understand what it does. But I would like to know why it is needed.
As far as I know, the pins of OrinNX and XavierNX modules are compatible.
And the XavierNX module(tegra194-camera-rbpcv2-imx219.dtsi) doesn’t have this setting.
That’s why I don’t understand why this polarity setting is needed.

Module pin assign:

Jetson_Orin_NX_Series_and_Orin_Nano_Series_Design_Guide_DG-10931-001_v1.0.pdf

Jetson_Xavier_NX_Product_Design_Guide_DG-09693-001_v1.7.pdf

hello fumiya.fujinaka,

it’s on the Orin module design, i.e. CSI0 D1 and CSI1 D0 P/N will always been swizzled for P/N.

Hello, JerryChang

Thank you for your reply.
Oh… I see, this setting is necessary when using CSI0 D1 and CSI1 D0 of OrinNX.
Are there any plans to modify the OrinNX module design?
Or is it a policy to make the setting of lane_polarity mandatory without changing the module?
I would like to know the policy because it seems to affect the design of custom boards.

no… it’s the same for all series of Orin NX modules.

no… it’s the same for all series of Orin NX modules.

OK, thanks.

About another question.
What could be the reason why it doesn’t work on J1 even if you set lane_porarity=6?
Could you tell me what kind of error it is or where the definition of the status is written?
I also attach the full list of trace logs: log_serial_a_polarity6.txt (6.9 MB)

     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293650666 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293650666 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293651239 class:GLOBAL type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
     kworker/0:4-387     [000] ....   306.288087: rtcpu_nvcsi_intr: tstamp:10293651239 class:CORRECTABLE_ERR type:STREAM_VC phy:0 cil:0 st:0 vc:0 status:0x00000004
...
     kworker/0:4-387     [000] ....   306.288435: rtcpu_vinotify_error: tstamp:10294382089 cch:0 vi:0 tag:CSIMUX_FRAME channel:0x00 frame:1 vi_tstamp:329419963136 data:0x0000000100400060

hello fumiya.fujinaka,

may I also know what’s the lane configuration? is it works with 2-lane config?

Yes, the sensor module has the same interface as the Raspberry Pi’s camera and works with 2lane.
A part of the device tree is extracted as follows.

mode0 {
	tegra_sinterface = "serial_a";
	lane_polarity = "6";

	mclk_khz = "37125";
	num_lanes = "2";
	embedded_metadata_height = "1";
	phy_mode = "DPHY";
	discontinuous_clk = "no";
	dpcm_enable = "false";
	cil_settletime = "0";

	active_w = "2608";
	active_h = "1964";
	mode_type = "bayer";
	pixel_phase = "rggb";
	dynamic_pixel_bit_depth = "12";
	csi_pixel_bit_depth = "12";
	readout_orientation = "0";
	line_length = "2800";
	inherent_gain = "1";
	pix_clk_hz = "240000000";

	gain_factor = "10";
	step_gain_val = "3";
	min_gain_val = "0";
	max_gain_val = "720";
	default_gain = "0";
	
	framerate_factor = "10";
	min_framerate = "250";
	max_framerate = "250";
	step_framerate = "1";
	default_framerate = "250";

	exposure_factor = "1000000";
	min_exp_time = "74";
	max_exp_time = "400000";
	step_exp_time = "18";
	default_exp_time = "5000";

	min_hdr_ratio = "1";
	max_hdr_ratio = "1";
};

Hello,

I found the factor.
After some experimentation, it seems that my device does not receive data when I specify a higher data rate.
The maximum data rate that worked was 720Mbps on J1 and 1180Mbps on J9.
I don’t know the cause…, but it seems unlikely that it is caused by OrinNX module and software.

The issue seems to be elsewhere, so I’m closing this topic.
Thanks for your support!

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