Porting/using TI AWR2243 with Jetson TX2

I’m trying to get data from a TI AWR2243 radar chip connected via CSI to a Jetson TX2. So far I’ve written a barebones driver (originally based on the imx185 driver), added a devicetree stanza and modified the nvidia sensor_common.c file to support bayer_rggb8 (the radar is configured to send data in RAW8 format).

The relevant devicetree stanza looks like this:

		awr2243@2 {
			compatible = "nvidia,awr2243";
			reg = <0x2>;
			spi-max-frequency = <0x1f78a40>;
			status = "okay";
			devname = "awr2243";
			devnode = "video0";
			sensor_model = "awr2243";
			linux,phandle = <0x1b5>;
			phandle = <0x1b5>;

			mode0 {
				mclk_khz = "300000";
				num_lanes = "2";
				tegra_sinterface = "serial_a";
				phy_mode = "DPHY";
				discontinuous_clk = "no";
				dpcm_enable = "false";
				cil_settletime = "0";
				dynamic_pixel_bit_depth = "8";
				csi_pixel_bit_depth = "8";
				mode_type = "bayer";
				pixel_phase = "rggb";

				active_w = "4096";
				active_h = "32";
				readout_orientation = "0";
				line_length = "4096";
				inherent_gain = "1";
				mclk_multiplier = "2";
				pix_clk_hz = "74250000";

				// unused - originally taken from imx185 devicetree entry
				gain_factor = "10";
				min_gain_val = "0";
				max_gain_val = "480";
				step_gain_val = "3";
				default_gain = "0";
				min_hdr_ratio = "1";
				max_hdr_ratio = "1";
				framerate_factor = "1000000";
				min_framerate = "1500000";
				max_framerate = "30000000";
				step_framerate = "1";
				default_framerate= "30000000";
				exposure_factor = "1000000";
				min_exp_time = "30";
				max_exp_time = "660000";
				step_exp_time = "1";
				default_exp_time = "33334";
				embedded_metadata_height = "1";
			};

			ports {
				#address-cells = <0x1>;
				#size-cells = <0x0>;
				port@0 {
					reg = <0x0>;
					// awr2243 out0
					endpoint {
						port-index = <0x0>;
						bus-width = <0x2>;
						// link awr2243 csi in0
						remote-endpoint = <0x2d>;
						linux,phandle = <0x1b6>;
						phandle = <0x1b6>;
					};
				};
			};
		};
	};

I can compile and install the driver module and a /dev/video0 device appears as expected. However, when I try to get data from this device I get errors in the syslog/kern.log:

...
Jul 20 17:43:28 radar-jt kernel: [  194.428804] [AWR2243]: power on
Jul 20 17:43:28 radar-jt kernel: [  194.452283] [AWR2243]: stream tegra-vi4 15700000.vi->awr2243 (1)
Jul 20 17:43:29 radar-jt kernel: [  195.534540] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
Jul 20 17:43:29 radar-jt kernel: [  195.541048] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
Jul 20 17:43:29 radar-jt kernel: [  195.551117] nvcsi 150c0000.nvcsi: csi4_stream_check_status (0) ERROR_STATUS2VI_VC0 = 0x00000004
Jul 20 17:43:29 radar-jt kernel: [  195.560099] nvcsi 150c0000.nvcsi: csi4_stream_check_status (0) INTR_STATUS 0x00000004
Jul 20 17:43:29 radar-jt kernel: [  195.568037] nvcsi 150c0000.nvcsi: csi4_stream_check_status (0) ERR_INTR_STATUS 0x00000004
Jul 20 17:43:30 radar-jt kernel: [  196.718513] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
Jul 20 17:43:30 radar-jt kernel: [  196.725076] tegra-vi4 15700000.vi: tegra_channel_error_recovery: attempting to reset the capture channel
Jul 20 17:43:30 radar-jt kernel: [  196.735110] nvcsi 150c0000.nvcsi: csi4_stream_check_status (0) ERROR_STATUS2VI_VC0 = 0x00000004
Jul 20 17:43:30 radar-jt kernel: [  196.743977] nvcsi 150c0000.nvcsi: csi4_stream_check_status (0) INTR_STATUS 0x00000004
Jul 20 17:43:30 radar-jt kernel: [  196.751954] nvcsi 150c0000.nvcsi: csi4_stream_check_status (0) ERR_INTR_STATUS 0x00000004
...

and also in the kernel trace log:

     kworker/4:1-1677  [004] .n..  1417.446106: rtcpu_vinotify_event: tstamp:44564265175 tag:CHANSEL_PXL_SOF channel:0x00 frame:0 vi_tstamp:44564264649 data:0x00000001
     kworker/4:1-1677  [004] ....  1417.446160: rtcpu_vinotify_event: tstamp:44564265406 tag:ATOMP_FS channel:0x00 frame:0 vi_tstamp:44564264675 data:0x00000000
     kworker/4:1-1677  [004] ....  1417.446162: rtcpu_vinotify_event: tstamp:44564266349 tag:CHANSEL_FAULT channel:0x00 frame:0 vi_tstamp:44564265956 data:0x00000200
     kworker/4:1-1677  [004] ....  1417.446164: rtcpu_vinotify_event: tstamp:44564266834 tag:CHANSEL_LOAD_FRAMED channel:0x01 frame:0 vi_tstamp:44564266500 data:0x08000000
     kworker/4:1-1677  [004] ....  1417.446165: rtcpu_vinotify_event: tstamp:44564269989 tag:CHANSEL_LOAD_FRAMED channel:0x01 frame:0 vi_tstamp:44564269603 data:0x08000000
     kworker/4:1-1677  [004] ....  1417.502157: rtos_queue_peek_from_isr_failed: tstamp:44566182320 queue:0x0b4b4500
     kworker/4:1-1677  [004] ....  1417.558140: rtcpu_vinotify_event: tstamp:44567389502 tag:CSIMUX_FRAME channel:0x00 frame:0 vi_tstamp:44567388763 data:0x000000a0
     kworker/4:1-1677  [004] ....  1417.558145: rtcpu_vinotify_event: tstamp:44567389673 tag:CHANSEL_SHORT_FRAME channel:0x01 frame:0 vi_tstamp:44567388763 data:0x00000001
     kworker/4:1-1677  [004] ....  1417.558147: rtcpu_vinotify_event: tstamp:44567389847 tag:ATOMP_FE channel:0x00 frame:0 vi_tstamp:44567388766 data:0x00000000

Note that I only want to get the “raw” data from the radar, i.e. bypassing the VI and saving the CSI data to memory/file. As far as I know, the configuration settings match the data format being sent by the radar chip. I’ve looked into these errors but can’t determine what’s going wrong. I’d appreciate any insight or help you could provide!

The trace log tell the short lines and short frames that tell the output size less than 4096x32
Also the “ERROR_STATUS2VI_VC0 = 0x00000004” tell crc error. Try below patch.

That doesn’t seem to have helped - I’m still getting the same errors in the kernel and trace logs.

Do you adjust the active_h/active_w in device tree to check the tag:CHANSEL_FAULT and tag:CHANSEL_SHORT_FRAME ?

Yes, I’ve tried multiple values for active_h/active_w in the device tree to resolve the short frame error. I don’t have a high-speed oscilloscope so am unable to capture raw data on the CSI bus to verify the amount of data in a frame, so my figures are based on calculations. Is there a register or debug option available that can tell me how much data was received before the short_frame error occurred?