Hello all,
Im porting drivers from TX2 to Xavier NX, however I encountered the following error early on. I’ve read other forum questions on similar topic, but I could not make use of these answers.
Im not sure where’s the problem.
It seems to me as if the signal would not reach the ports electrically, but the electrical connection seems ok (checked with multimeter). Port binding seems correct (I expect signal on CAM0
, so => tegra_sinterface_a
=> port_index = 0
am I right?)
1. Background info:
a. Video information:
YUV 422 8-bit 1920x1080@30
b. I expanded the supported formats in sensor_common.c
(any other file I do not know of?):
else if (strncmp(pixel_t, "yuv_uyvy8", size) == 0)
*format = V4L2_PIX_FMT_UYVY;
c. L4T version: r35.2.1
d. I tried to disable ECC error checking in csi5_fops.c
, with no results (I manually typed patch from previous L4T versions though)
e. I tried different values for pix_clk_hz
and serdes_pix_clk_hz
f. Camera has no I2C, so it is streaming on power-on (with discontinuous clock)
2. Error info:
a. The tracing looks like this:
[001] .... 449.004047: tegra_channel_capture_setup: vnc_id 0 W 1920 H 1080 fmt 13
kworker/2:3-112 [002] .... 449.051114: rtcpu_vinotify_event: tstamp:14808926640 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:473882738208 data:0xcd9ce50010000000
kworker/2:3-112 [002] .... 449.051117: rtcpu_vinotify_event: tstamp:14808926802 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:473882749984 data:0x0000000031000001
kworker/2:3-112 [002] .... 449.107133: rtcpu_vinotify_event: tstamp:14809944119 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:473918060736 data:0xcd9ce20010000000
kworker/2:3-112 [002] .... 449.107135: rtcpu_vinotify_event: tstamp:14809944284 cch:0 vi:0 tag:VIFALC_TDSTATE channel:0x23 frame:0 vi_tstamp:473918072704 data:0x0000000031000002
b. Debug logs in dmesg:
[ 435.887171] [RCE] tegra_nvcsi_stream_set_config(vm0, stream=0, csi=0)
[ 435.887183] [RCE] MIPI clock = 297000 kHz, tHS-SETTLE = 0, tCLK-SETTLE = 0
[ 435.887189] [RCE] ===== NVCSI Stream Configuration =====
[ 435.887211] [RCE] stream_id: PP 0, csi_port: PORT A
[ 435.887219] [RCE] Brick: PHY 0, Mode: D-PHY
[ 435.887225] [RCE] Partition: CIL A, LP bypass: Enabled, Lanes: 2
[ 435.887230] [RCE] Clock information:
[ 435.887235] [RCE] MIPI clock rate: 297.00 MHz
[ 435.887240] [RCE] T_HS settle: 0, T_CLK settle: 0
[ 435.887245] [RCE] ======================================
[ 435.887250] [RCE] tegra_nvcsi_stream_open(vm0, stream=0, csi=0)
[ 435.887255] [RCE] nvcsi_calc_ths_settle ths_settle 20
[ 435.887260] [RCE] nvcsi_calc_ths_settle ths_settle 20
[ 435.887265] [RCE] nvcsi_calc_tclk_settle tclk_settle 33
[ 438.495153] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 438.495411] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 438.496056] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 438.496203] t194-nvcsi 13e10000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 438.496394] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 438.496546] t194-nvcsi 13e10000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 438.497024] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 441.311138] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 441.311366] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 441.312070] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 441.312223] t194-nvcsi 13e10000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 441.312420] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 441.312573] t194-nvcsi 13e10000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
[ 441.313049] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: successfully reset the capture channel
[ 443.871120] tegra-camrtc-capture-vi tegra-capture-vi: uncorr_err: request timed out after 2500 ms
[ 443.871334] tegra-camrtc-capture-vi tegra-capture-vi: err_rec: attempting to reset the capture channel
[ 443.872050] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 443.872206] t194-nvcsi 13e10000.host1x:nvcsi@15a00000: csi5_stream_close: Error in closing stream_id=0, csi_port=0
[ 443.872398] (NULL device *): vi_capture_control_message: NULL VI channel received
[ 443.872535] t194-nvcsi 13e10000.host1x:nvcsi@15a00000: csi5_stream_open: VI channel not found for stream- 0 vc- 0
DTB configuration:
/ {
tegra-capture-vi {
num-channels = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
vi_port0: port@0 {
reg = <0>;
vi_in0: endpoint {
//vc-id = <0>;
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&imx219_csi_out0>;
};
};
/*
vi_port1: port@1 {
reg = <1>;
vi_in1: endpoint {
//vc-id = <0>;
port-index = <4>;
bus-width = <2>;
remote-endpoint = <&imx219_csi_out1>;
};
};*/
};
};
host1x@13e00000 {
nvcsi@15a00000 {
num-channels = <1>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx219_csi_in0: endpoint@0 {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&imx219_phy_out0>;
};
};
port@1 {
reg = <1>;
imx219_csi_out0: endpoint@1 {
remote-endpoint = <&vi_in0>;
};
};
};
};
/*
channel@1 {
reg = <1>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx219_csi_in1: endpoint@0 {
port-index = <4>;
bus-width = <2>;
remote-endpoint = <&imx219_phy_out1>;
};
};
port@1 {
//status = "okay";
reg = <1>;
imx219_csi_out1: endpoint@1 {
//status = "okay";
remote-endpoint = <&vi_in1>;
};
};
};
};*/
};//nvcsi end
}; //host2x end
cam_i2cmux {
i2c_0:i2c@0 {
vendorname_fhd@10 {
#address-cells = <1>;
#size-cells = <0>;
status="okay";
devnode = "video0";
compatible = "vendorname,vendorname_fhd";
reg = <0x10>;
physical_w = "5.095";
physical_h = "4.930";
post_crop_frame_drop = "0";
use_sensor_mode_id = "true";
sensor_model ="Vendorname_FHD";
set_mode_delay_ms = "3000";
mode0 {
mclk_khz = "24000";
num_lanes = "2";
tegra_sinterface = "serial_a";
vc_id = "0";
discontinuous_clk = "yes";
dpcm_enable = "false";
cil_settletime = "0";
dynamic_pixel_bit_depth = "8";
//------------------------------
mode_type = "yuv";//
csi_pixel_bit_depth = "8";//
pixel_phase = "uyvy";//
//------------------------------
active_w = "1920";
active_h = "1080";
readout_orientation = "0";
line_length = "2200";//
inherent_gain = "1";
pix_clk_hz = "148500000";
serdes_pix_clk_hz = "148500000";
gain_factor = "10";
min_gain_val = "0"; // dB
max_gain_val = "300"; // dB
step_gain_val = "3"; // 0.3
default_gain = "0";
min_hdr_ratio = "1";
max_hdr_ratio = "1";
framerate_factor = "1000000";
min_framerate = "30000000";
max_framerate = "30000000";
step_framerate = "1";
default_framerate = "30000000";
exposure_factor = "1000000";
min_exp_time = "59"; //us, 2 lines
max_exp_time = "33333";
step_exp_time = "1";
default_exp_time = "59";// us
embedded_metadata_height = "0";
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
imx219_phy_out0: endpoint {
port-index = <0>;
bus-width = <2>;
remote-endpoint = <&imx219_csi_in0>;
};
};
};
};
};
// tegra camera platform:
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <1>;
max_lane_speed = <4000000>;///
min_bits_per_pixel = <8>;//
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;
max_pixel_rate = <240000>;