I’m still seeing this error within dmesg:
[ 374.093537] video4linux video0: frame start syncpt timeout!0
After looking through the X1 TRM I found the debug and status registers for CSI on pages 2303 - 2368
Specifically I noticed the following registers:
CSI_PIXEL_STREAM_PIXEL_PARSER_A_STATUS_0 (Page 2307)
CSI_CSI_CIL_A_STATUS_0 (Page 2315)
CSI_CSI_CILA_STATUS_0 (Page 2315)
CSI_DEBUG_CONTROL_0 (Page 2314)
CSI_DEBUG_COUNTER_0_0 (Page 2325)
CSI_DEBUG_COUNTER_1_0 (Page 2325)
CSI_DEBUG_COUNTER_2_0 (Page 2325)
Enabling Debug Messages
After some grepping around in the kernel there was a file called (head slappingly obvious enough)
/drivers/media/platform/tegra/csi/csi2_fops.c
where there already is code that will print these registers out.
I enabled the DEBUG flag and changed all dev_dbg to dev_info and now I see where, I think, the error is.
Exercising CSI Capture
To exercise everything I run this command:
v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=data.raw
I see this result on the console:
ubuntu@tegra-ubuntu:~$ v4l2-ctl -d /dev/video0 -w --verbose --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=data.raw
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: failed: Invalid argument
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_STREAMON: ok
Index : 0
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 0
Length : 4147200
Bytesused: 4147200
Timestamp: 18446743798852329136.18446744073434681117s (Monotonic, End-of-Frame)
Index : 1
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 1
Length : 4147200
Bytesused: 4147200
Timestamp: 18446743798852329136.18446744073434681117s (Monotonic, End-of-Frame)
Index : 2
Type : Video Capture
Flags : mapped, done, error
Field : None
Sequence : 2
Length : 4147200
Bytesused: 4147200
Timestamp: 18446743798852329136.18446744073434681117s (Monotonic, End-of-Frame)
So it attempted and failed to capture 3 images, outputting dmesg I get this:
[37514.706577] ov5647 6-0036: ov5647_power_on: power on
[37514.749070] ov5647 6-0036: camera_common_try_fmt: size 1920 x 1080
[37514.749079] ov5647 6-0036: camera_common_try_fmt: got controls from v4l2_g_ctrl
[37514.749084] ov5647 6-0036: could not find device ctrl.
[37514.789411] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[37514.789418] csi2_pp_write:offset 0x0000001c val:0xffffffff
[37514.789422] csi2_cil_write:offset 0x00000010 val:0xffffffff
[37514.789427] csi2_cil_write:offset 0x00000014 val:0xffffffff
[37514.789431] csi2_cil_write:offset 0x0000000c val:0x00000000
[37514.789434] csi2_cil_write:offset 0x00000000 val:0x00000000
[37514.789437] csi2_cil_write:offset 0x00000008 val:0x0000004a
[37514.789445] vi vi: csi2_read:port 0 offset 0x000000d0
[37514.789449] csi2_cil_write:offset 0x00000000 val:0x00000000
[37514.789453] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[37514.789456] csi2_pp_write:offset 0x00000010 val:0x0000f007
[37514.789459] csi2_pp_write:offset 0x00000018 val:0x00000000
[37514.789462] csi2_pp_write:offset 0x00000004 val:0x2a0301f0
[37514.789465] csi2_pp_write:offset 0x00000008 val:0x00000011
[37514.789468] csi2_pp_write:offset 0x0000000c val:0x00140000
[37514.789470] csi2_pp_write:offset 0x00000014 val:0x00000000
[37514.789473] csi2_pp_write:offset 0x00000000 val:0x003f0001
[37514.789476] csi2_pp_write:offset 0x0000021c val:0x454340e1
[37514.789479] csi2_pp_write:offset 0x00000010 val:0x0000f005
[37514.789789] ov5647 6-0036: ov5647_s_stream++
[37514.811617] ov5647 6-0036: ov5647_set_gain: gain 0100 val: 0010
[37514.812213] ov5647 6-0036: ov5647_set_frame_length: val: 1104
[37514.812786] ov5647 6-0036: ov5647_set_coarse_time: val: 1096
[37514.814224] ov5647 6-0036: ov5647_set_coarse_time_short: val: 1096
[37514.815395] ov5647 6-0036: ov5647_s_stream--
[37515.014015] video4linux video0: frame start syncpt timeout!0
[37515.019906] csi2_pp_read:offset 0x0000001c
[37515.020001] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004000
[37515.020055] csi2_cil_read:offset 0x00000010
[37515.020122] vi vi: TEGRA_CSI_CIL_STATUS 0x00000013
[37515.020169] csi2_cil_read:offset 0x00000014
[37515.020238] vi vi: TEGRA_CSI_CILX_STATUS 0x00070070
[37515.020283] csi2_pp_read:offset 0x00000220
[37515.020346] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[37515.020392] csi2_pp_read:offset 0x00000224
[37515.020456] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[37515.020501] csi2_pp_read:offset 0x00000228
[37515.020565] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x0000008b
[37515.020623] csi2_cil_write:offset 0x00000020 val:0x00000001
[37515.020696] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[37515.020971] csi2_cil_write:offset 0x00000020 val:0x00000000
[37515.021052] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[37515.021133] csi2_pp_write:offset 0x00000010 val:0x0000f002
[37515.021201] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[37515.021251] csi2_pp_write:offset 0x0000001c val:0xffffffff
[37515.021300] csi2_cil_write:offset 0x00000010 val:0xffffffff
[37515.021349] csi2_cil_write:offset 0x00000014 val:0xffffffff
[37515.021396] csi2_cil_write:offset 0x0000000c val:0x00000000
[37515.021442] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.021489] csi2_cil_write:offset 0x00000008 val:0x0000004a
[37515.021556] vi vi: csi2_read:port 0 offset 0x000000d0
[37515.021607] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.021674] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[37515.021724] csi2_pp_write:offset 0x00000010 val:0x0000f007
[37515.021771] csi2_pp_write:offset 0x00000018 val:0x00000000
[37515.021819] csi2_pp_write:offset 0x00000004 val:0x2a0301f0
[37515.021866] csi2_pp_write:offset 0x00000008 val:0x00000011
[37515.021913] csi2_pp_write:offset 0x0000000c val:0x00140000
[37515.021959] csi2_pp_write:offset 0x00000014 val:0x00000000
[37515.022006] csi2_pp_write:offset 0x00000000 val:0x003f0001
[37515.022054] csi2_pp_write:offset 0x0000021c val:0x454340e1
[37515.022101] csi2_pp_write:offset 0x00000010 val:0x0000f005
[37515.224186] video4linux video0: frame start syncpt timeout!0
[37515.230084] csi2_pp_read:offset 0x0000001c
[37515.230186] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004000
[37515.230240] csi2_cil_read:offset 0x00000010
[37515.230306] vi vi: TEGRA_CSI_CIL_STATUS 0x00000013
[37515.230352] csi2_cil_read:offset 0x00000014
[37515.230416] vi vi: TEGRA_CSI_CILX_STATUS 0x00060070
[37515.230463] csi2_pp_read:offset 0x00000220
[37515.230528] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[37515.230574] csi2_pp_read:offset 0x00000224
[37515.230640] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[37515.230684] csi2_pp_read:offset 0x00000228
[37515.230747] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x0000009a
[37515.230809] csi2_cil_write:offset 0x00000020 val:0x00000001
[37515.230882] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[37515.231141] csi2_cil_write:offset 0x00000020 val:0x00000000
[37515.231219] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[37515.231298] csi2_pp_write:offset 0x00000010 val:0x0000f002
[37515.231368] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[37515.231417] csi2_pp_write:offset 0x0000001c val:0xffffffff
[37515.231466] csi2_cil_write:offset 0x00000010 val:0xffffffff
[37515.231513] csi2_cil_write:offset 0x00000014 val:0xffffffff
[37515.231560] csi2_cil_write:offset 0x0000000c val:0x00000000
[37515.231606] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.231653] csi2_cil_write:offset 0x00000008 val:0x0000004a
[37515.231718] vi vi: csi2_read:port 0 offset 0x000000d0
[37515.231768] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.231835] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[37515.231883] csi2_pp_write:offset 0x00000010 val:0x0000f007
[37515.231930] csi2_pp_write:offset 0x00000018 val:0x00000000
[37515.231977] csi2_pp_write:offset 0x00000004 val:0x2a0301f0
[37515.232023] csi2_pp_write:offset 0x00000008 val:0x00000011
[37515.232070] csi2_pp_write:offset 0x0000000c val:0x00140000
[37515.232115] csi2_pp_write:offset 0x00000014 val:0x00000000
[37515.232162] csi2_pp_write:offset 0x00000000 val:0x003f0001
[37515.232209] csi2_pp_write:offset 0x0000021c val:0x454340e1
[37515.232255] csi2_pp_write:offset 0x00000010 val:0x0000f005
[37515.433915] video4linux video0: frame start syncpt timeout!0
[37515.440378] csi2_pp_read:offset 0x0000001c
[37515.440491] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004000
[37515.440544] csi2_cil_read:offset 0x00000010
[37515.440615] vi vi: TEGRA_CSI_CIL_STATUS 0x00000013
[37515.440661] csi2_cil_read:offset 0x00000014
[37515.440728] vi vi: TEGRA_CSI_CILX_STATUS 0x00060070
[37515.440774] csi2_pp_read:offset 0x00000220
[37515.440839] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[37515.440885] csi2_pp_read:offset 0x00000224
[37515.440947] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[37515.440991] csi2_pp_read:offset 0x00000228
[37515.441053] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000095
[37515.441112] csi2_cil_write:offset 0x00000020 val:0x00000001
[37515.441185] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[37515.441765] csi2_cil_write:offset 0x00000020 val:0x00000000
[37515.441851] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[37515.441934] csi2_pp_write:offset 0x00000010 val:0x0000f002
[37515.442003] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[37515.442053] csi2_pp_write:offset 0x0000001c val:0xffffffff
[37515.442101] csi2_cil_write:offset 0x00000010 val:0xffffffff
[37515.442149] csi2_cil_write:offset 0x00000014 val:0xffffffff
[37515.442197] csi2_cil_write:offset 0x0000000c val:0x00000000
[37515.442245] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.442292] csi2_cil_write:offset 0x00000008 val:0x0000004a
[37515.442356] vi vi: csi2_read:port 0 offset 0x000000d0
[37515.442407] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.442477] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[37515.442526] csi2_pp_write:offset 0x00000010 val:0x0000f007
[37515.442575] csi2_pp_write:offset 0x00000018 val:0x00000000
[37515.442622] csi2_pp_write:offset 0x00000004 val:0x2a0301f0
[37515.442669] csi2_pp_write:offset 0x00000008 val:0x00000011
[37515.442716] csi2_pp_write:offset 0x0000000c val:0x00140000
[37515.442762] csi2_pp_write:offset 0x00000014 val:0x00000000
[37515.442810] csi2_pp_write:offset 0x00000000 val:0x003f0001
[37515.442858] csi2_pp_write:offset 0x0000021c val:0x454340e1
[37515.442904] csi2_pp_write:offset 0x00000010 val:0x0000f005
[37515.644290] video4linux video0: frame start syncpt timeout!0
[37515.650172] csi2_pp_read:offset 0x0000001c
[37515.650270] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004000
[37515.650319] csi2_cil_read:offset 0x00000010
[37515.650388] vi vi: TEGRA_CSI_CIL_STATUS 0x00000013
[37515.650433] csi2_cil_read:offset 0x00000014
[37515.650502] vi vi: TEGRA_CSI_CILX_STATUS 0x00060070
[37515.650549] csi2_pp_read:offset 0x00000220
[37515.650613] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[37515.650659] csi2_pp_read:offset 0x00000224
[37515.650723] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[37515.650768] csi2_pp_read:offset 0x00000228
[37515.650830] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000089
[37515.650892] csi2_cil_write:offset 0x00000020 val:0x00000001
[37515.650964] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[37515.651260] csi2_cil_write:offset 0x00000020 val:0x00000000
[37515.651341] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[37515.651425] csi2_pp_write:offset 0x00000010 val:0x0000f002
[37515.651497] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[37515.651547] csi2_pp_write:offset 0x0000001c val:0xffffffff
[37515.651597] csi2_cil_write:offset 0x00000010 val:0xffffffff
[37515.651645] csi2_cil_write:offset 0x00000014 val:0xffffffff
[37515.651695] csi2_cil_write:offset 0x0000000c val:0x00000000
[37515.651741] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.651788] csi2_cil_write:offset 0x00000008 val:0x0000004a
[37515.651852] vi vi: csi2_read:port 0 offset 0x000000d0
[37515.651903] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.651969] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[37515.652018] csi2_pp_write:offset 0x00000010 val:0x0000f007
[37515.652065] csi2_pp_write:offset 0x00000018 val:0x00000000
[37515.652112] csi2_pp_write:offset 0x00000004 val:0x2a0301f0
[37515.652159] csi2_pp_write:offset 0x00000008 val:0x00000011
[37515.652206] csi2_pp_write:offset 0x0000000c val:0x00140000
[37515.652252] csi2_pp_write:offset 0x00000014 val:0x00000000
[37515.652300] csi2_pp_write:offset 0x00000000 val:0x003f0001
[37515.652349] csi2_pp_write:offset 0x0000021c val:0x454340e1
[37515.652396] csi2_pp_write:offset 0x00000010 val:0x0000f005
[37515.854128] video4linux video0: frame start syncpt timeout!0
[37515.861379] csi2_pp_read:offset 0x0000001c
[37515.861501] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004000
[37515.861553] csi2_cil_read:offset 0x00000010
[37515.861622] vi vi: TEGRA_CSI_CIL_STATUS 0x00000013
[37515.861667] csi2_cil_read:offset 0x00000014
[37515.861732] vi vi: TEGRA_CSI_CILX_STATUS 0x00060070
[37515.861779] csi2_pp_read:offset 0x00000220
[37515.861843] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000
[37515.861888] csi2_pp_read:offset 0x00000224
[37515.861950] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000
[37515.861995] csi2_pp_read:offset 0x00000228
[37515.862057] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x00000087
[37515.862116] csi2_cil_write:offset 0x00000020 val:0x00000001
[37515.862190] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000001
[37515.862484] csi2_cil_write:offset 0x00000020 val:0x00000000
[37515.862566] vi vi: csi2_write:port 0 offset 0x00000214 val:0x00000000
[37515.862647] csi2_pp_write:offset 0x00000010 val:0x0000f002
[37515.862716] vi vi: csi2_write:port 0 offset 0x00000218 val:0x00000000
[37515.862763] csi2_pp_write:offset 0x0000001c val:0xffffffff
[37515.862812] csi2_cil_write:offset 0x00000010 val:0xffffffff
[37515.862860] csi2_cil_write:offset 0x00000014 val:0xffffffff
[37515.862904] csi2_cil_write:offset 0x0000000c val:0x00000000
[37515.862949] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.862994] csi2_cil_write:offset 0x00000008 val:0x0000004a
[37515.863063] vi vi: csi2_read:port 0 offset 0x000000d0
[37515.863112] csi2_cil_write:offset 0x00000000 val:0x00000000
[37515.865864] vi vi: csi2_write:port 0 offset 0x000000d0 val:0x00000001
[37515.865915] csi2_pp_write:offset 0x00000010 val:0x0000f007
[37515.865941] csi2_pp_write:offset 0x00000018 val:0x00000000
[37515.865967] csi2_pp_write:offset 0x00000004 val:0x2a0301f0
[37515.865992] csi2_pp_write:offset 0x00000008 val:0x00000011
[37515.866015] csi2_pp_write:offset 0x0000000c val:0x00140000
[37515.866040] csi2_pp_write:offset 0x00000014 val:0x00000000
[37515.866063] csi2_pp_write:offset 0x00000000 val:0x003f0001
[37515.866087] csi2_pp_write:offset 0x0000021c val:0x454340e1
[37515.866110] csi2_pp_write:offset 0x00000010 val:0x0000f005
[37515.867244] csi2_pp_write:offset 0x00000010 val:0x0000f002
[37515.867366] ov5647 6-0036: ov5647_s_stream++
[37515.882842] ov5647 6-0036: ov5647_power_off: power off
Decoding
So no one needs to decode this on their own:
[37515.020623] csi2_cil_write:offset 0x00000020 val:0x00000001 CSI_CSICIL_SW_SENSOR_A_RESET_0
-CSI receive to reset
[37515.020971] csi2_cil_write:offset 0x00000020 val:0x00000000 CSI_CSICIL_SW_SENSOR_A_RESET_0
-CSI receiver out of reset
[37515.021133] csi2_pp_write:offset 0x00000010 val:0x0000f002 CSI_PIXEL_STREAM_PPA_COMMAND_0
-Disable Pixel Parser
[37515.021251] csi2_pp_write:offset 0x0000001c val:0xffffffff CSI_CSI_PIXEL_PARSER_A_STATUS_0
-Reset all Pixel Parser Status Bits
[37515.021300] csi2_cil_write:offset 0x00000010 val:0xffffffff CSI_CSI_CILA_STATUS_0
-Reset all CIL Status Bits
[37515.021349] csi2_cil_write:offset 0x00000014 val:0xffffffff CSI_CSI_CIL_A_STATUS_0
-Reset all CIL Status Bits
[37515.021396] csi2_cil_write:offset 0x0000000c val:0x00000000 CSI_CSI_CIL_A_INTERRUPT_MASK_0
-Clear all interrupt masks
[37515.021442] csi2_cil_write:offset 0x00000000 val:0x00000000 CSI_CILA_PAD_CONFIG0_0
-Reset pad configuration
[37515.021489] csi2_cil_write:offset 0x00000008 val:0x0000004a CSI_PHY_CILA_CONTROL0_0
-Settle time for data lane when moving from LP → HP to 10
-Bypass the Lower Power to High Power sequence detect (just look for LP00 instead of LP11->LP01->LP00)
[37515.021607] csi2_cil_write:offset 0x00000000 val:0x00000000 CSI_CILA_PAD_CONFIG0_0
-Reset pad configuration
[37515.021724] csi2_pp_write:offset 0x00000010 val:0x0000f007 CSI_PIXEL_STREAM_PPA_COMMAND_0
-Reset PPA
[37515.021771] csi2_pp_write:offset 0x00000018 val:0x00000000 CSI_CSI_PIXEL_PARSER_A_INTERRUPT_MASK_0
-Clear all interrupt masks
[37515.021819] csi2_pp_write:offset 0x00000004 val:0x2a0301f0 CSI_PIXEL_STREAM_A_CONTROL0_0
-Short frames will not be padded out
-Single bit Errors in the header will not be corrected
-Short line will not be padded out
-Throw away embedded data
-STORE: output for storing RAW data to memory through ISP
-Word Count Check is enabled
-CRC is checked
-Number of bytes per line is to be extracted from the header
-Data identifier byte in packet header should be compared agains CSI_PPA_DATA_TYPE and the VIRTUAL_CHANNEL_ID
-Packet header is sent
-CSI_A is used
[37515.021866] csi2_pp_write:offset 0x00000008 val:0x00000011 CSI_PIXEL_STREAM_A_CONTROL1_0
-Top Field detection for interlaced video frame (not used)
[37515.021913] csi2_pp_write:offset 0x0000000c val:0x00140000 CSI_PIXEL_STREAM_A_GAP_0
-Sets the min/max gap of viclk cycles from the end of the frame to the next frame
-Sets the min/max gap of viclk cycles from the end of one line to the next line
[37515.021959] csi2_pp_write:offset 0x00000014 val:0x00000000 CSI_PIXEL_STREAM_A_EXPECTED_FRAME_0
-Disable timeout between lines, if this were enable the CSI core would inject an ‘end frame’ into the stream
[37515.022006] csi2_pp_write:offset 0x00000000 val:0x003f0001 CSI_INPUT_STREAM_A_CONTROL_0
-Skip Packet feature is disabled
-Align CSIA and CSIB (I think this is used for 4 data lane mode)
-2 data lanes
[37515.022054] csi2_pp_write:offset 0x0000021c val:0x454340e1 CSI_DEBUG_CONTROL_0
-Configure Debug Count 2 to 69: PPA Headers Parsed (Number of Headers parsed)
-Configure Debug Count 1 to 67: PPA Frame Starts Outputted (Number of frame starts detected)
-Configure Debug Count 0 to 64: PPA Lines processed (Number of lines parsed)
[37515.022101] csi2_pp_write:offset 0x00000010 val:0x0000f005 CSI_PIXEL_STREAM_PPA_COMMAND_0
-Single Shot
-Enable
…Wait 200 ms…
ERROR Detected!
[37515.224186] video4linux video0: frame start syncpt timeout!0
Post Mortem
[37515.230186] vi vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00004000 CSI_CSI_PIXEL_PARSER_A_STATUS_0
-PPA_STMERR: Stream Error, set when the control output of PPA does not follow the correct sequence.
The correct sequence for CSI is: SF → (SL_DATA or EF), SL_DATA → (DATA or EL_DATA), DATA →
EL_DATA, EL_DATA → (SL_DATA or EF), EF → SF. Stream Errors can be caused by receiving a
corrupted stream.
[[37515.230306] vi vi: TEGRA_CSI_CIL_STATUS 0x00000013 CSI_CSI_CIL_A_STATUS_0
-CILA_CTRL_ERR: Control Error. Set when CIL-A detects LP state 01 or 10 followed by a stop state (LP11)
instead of transitioning into the Escape mode or Turn Around mode (LP00).
-CILA_SOT_MB_ERR: Start of Transmission Multi Bit Error. Set when CIL-A detects a multi bit start of
transmission byte error in one of the packet’s SOT bytes. The packet will be discarded.
-CILA_SOT_SB_ERR: Start of Transmission Single Bit Error. Set when CIL-A detects a single bit error in
one of the packet’s Start of Transmission bytes. The packet will be sent to the CSI-A for processing.
[37515.230416] vi vi: TEGRA_CSI_CILX_STATUS 0x00060070 CSI_CSI_CILA_STATUS_0
-CILA_DATA_LANE1_CTRL_ERR: Control Error. Set when CIL-A detects LP state 01 or 10 followed by a stop state (LP11) instead of transitioning
-CILA_DATA_LANE1_SOT_MB_ERR: Start of Transmission Multi Bit Error. Set when CIL-A detects a multi bit start of transmission byte error in one of the packet’s SOT bytes on data lane-1. The packet will be
discarded.
-CILA_DATA_LANE1_SOT_SB_ERR: Start of Transmission Single Bit Error. Set when CIL-A detects a single bit error in one of the packet’s Start of Transmission bytes on data lane-1. The packet will be sent to the CSI-A for processing.
(This one doesn’t happen all the time)
-CILA_DATA_LANE0_CTRL_ERR: Control Error. Set when CIL-A detects LP state 01 or 10 followed by a stop state (LP11) instead of transitioning
-CILA_DATA_LANE0_SOT_MB_ERR: Start of Transmission Multi Bit Error. Set when CIL-A detects a multi bit start of transmission byte error in one of the packet’s SOT bytes on data lane-0. The packet will be
discarded.
-CILA_DATA_LANE0_SOT_SB_ERR: Start of Transmission Single Bit Error. Set when CIL-A detects a single bit error in one of the packet’s Start of Transmission bytes on data lane-0. The packet will be sent to the CSI-A for processing.
[37515.230528] vi vi: TEGRA_CSI_DEBUG_COUNTER_0 0x00000000 CSI_DEBUG_COUNTER_0_0
PPA No Lines Processed
[37515.230640] vi vi: TEGRA_CSI_DEBUG_COUNTER_1 0x00000000 CSI_DEBUG_COUNTER_1_0
PPA No Frames Processed
[37515.230747] vi vi: TEGRA_CSI_DEBUG_COUNTER_2 0x0000009a CSI_DEBUG_COUNTER_2_0
154 Headers Parsed
Analysis
I’m not sure if the 154 headers parsed is significant or if the CSI core is attempting to parse garbage on the line as headers.
Based on the controller it looks like the LP11->LP01->LP00 is skipped and the CSI controller is looking for the high speed ‘synchronization’ token on the data lanes.
Unfortunately, I don’t have $4,000 a year to get the access to the MIPI D-PHY and CSI Specifications (ridiculous!) so I’ve been learning about it from various CSI/D-PHY Protocol Analyzer presentation decks from keysight, techtronics and the likes.
It seems like what should happen when the CSI transitions to high speed is:
SOT: Start of transmission
DATA IDENTIFIER: Identify packet
WORD COUNT: 16-bit word count (number of data words to send)
ERROR CORRECTION CODE: 8-bit ECC
DATA: WORD COUNT * Word Size Number of data packets to send
CHECKSUM: 16-bit Checksum Packet
EOT: End of transmission
Surprisingly, I can’t find the bit order of CSI, is it LSB or MSB first? I’ experimented with both directions but haven’t seen any improvement.
Any ideas?
Dave