ADV7280m configuration

Dear all,

I’d appreciate if anyone can help me step by step instruction for driver installation of ADV7280M on jetson nano.

Thanks

could you please let me know what was the steps that you follow to get jetson to work with adv7280m?
mahinishohre@gmail.com
@mrjcho

Hi mahinishohre
I used hoanganhv1svm’s code and it works for me. My problem was caused by the bad impedance of the PCB tracks. This may differ from your case.
However, I do found it is not stable on my hardware but I am working on something else now. Hopefully, I will look at it soon next month.
BR
Jack Ho

Dear @hoanganhv1svm ,
Could you please send me the driver of this ADV7280m that works for Nvidia Jetson to linux4es@gmail.com, please?

Thanks very much in advance,
K.

Hi khang,

Some file had been modified for adv7280m. You can compare with your code.

adv7280m.zip (17.3 KB)

Sorry late reply,

this is my driver

adv7280m.zip (17.3 KB)

Dear @hoanganhv1svm ,

Thanks very much. I have more question : should I still modify the VI source code for hard-coding 1 lane, resolution as well as apply the patch in following discussion : TX2-4GB NVCSI/VI error with JetPack 4.3 ?

Best regards,
Khang

Our project has been released. It’s work with jetpack 4.2. Not test with jetpack 4.3!
Your question: If you using more device with same hw (1lane), hard-code NVCSI will woking well, if you using some device with diffrent hw, you must sent params to vi driver each device.

Hi, can i use the same driver for adv7282m also ?

i applied your dt and code but notable to detect device
issue is discussed here ; Adv7282 PAL to MIPI CSI Linux Driver Development - Jetson & Embedded Systems / Jetson Xavier NX - NVIDIA Developer Forums
Kindly help

Can you please help me in know where exactly i am doing wrong ?

Sr bro,
Our project has been released. Nothing changed from attachment above.
Please verify with your BSP.
Thanks

also can you let me know how to apply the device tree that you have made, rest all i was able to do
why is the device tree i2c register value 0x21 for both devices , isnt it should be 7282 device address ?

You can flash your device tree binary on jetson nano directly.

1st: transfer your device tree binary to nano kit
scp bootloader/signed/tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt nano@192.168.55.1:/home/nano

2nd: on nano, using dd command, copy all data to device tree partition
sudo dd if=tegra210-p3448-0000-p3449-0000-a02.dtb.encrypt of=/dev/mmcblk0p10

3rd: reboot

With i2c address, you can detect real address by i2cdetect command.

Thanks for the response,

the device is responding to i2cget -y 2 0x21 , but not for i2c detect
i understood that the adv devices mostly wont respond to i2cdetect as they need write followed by read (assumption)
leaving i2cdetect issue aside

i went forward , i was able to see the appearance of video0 node in /dev
i went to see dmesg | grep 7282 the log is as follows

Line 594: [    2.158727] adv7282 9-0021: chip found @ 0x21 (i2c-2-mux (chan_id 0))
Line 607: [    2.176037] adv7282: probe of 9-0021 failed with error -121
Line 608: [    2.176116] adv7282 10-0021: chip found @ 0x21 (i2c-2-mux (chan_id 1))
Line 610: [    2.197643] adv7282 10-0021: adv7282-m probed!
Line 610: [    2.197643] adv7282 10-0021: adv7282-m probed!
Line 816: [    3.179292] tegra194-vi5 15c10000.vi: subdev adv7282 10-0021 bound

so i can clearly see the device is probed sucessfully and video node is created

i went forward to see whether i can open the cheese app,it crashed
the dmesg then read with latest error as below

Line 1057: [  126.993369] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 64

Also tried running V4l2-ctl command to see what happened, below is log.

[  126.982514] [RCE] vi5_hwinit: firmware CL2018101701 protocol version 2.2
[  126.993369] tegra194-vi5 15c10000.vi: corr_err: discarding frame 1, flags: 0, err_data 64
[  127.094630] [RCE] WARNING: t194/isp5.c:901 [config_channel] "All error notifications not enabled: correctable=0x00 uncorrectable=0x00"
[ 1010.279683] tegradc 15200000.nvdisplay: blank - powerdown
[ 1010.340088] extcon-disp-state external-connection:disp-state: cable 47 state 0
[ 1010.340093] Extcon AUX1(HDMI) disable
[ 1010.362677] tegra_nvdisp_handle_pd_disable: Powergated Head1 pd
[ 1010.363213] tegra_nvdisp_handle_pd_disable: Powergated Head0 pd
[ 1250.786347] tegradc 15200000.nvdisplay: unblank
[ 1250.789496] tegra_nvdisp_handle_pd_enable: Unpowergated Head0 pd
[ 1250.790038] tegra_nvdisp_handle_pd_enable: Unpowergated Head1 pd
[ 1250.799203] Parent Clock set for DC plld2
[ 1250.803686] tegradc 15200000.nvdisplay: hdmi: tmds rate:148500K prod-setting:prod_c_hdmi_111m_223m
[ 1250.805107] tegradc 15200000.nvdisplay: hdmi: get YCC quant from EDID.
[ 1250.841632] extcon-disp-state external-connection:disp-state: cable 47 state 1
[ 1250.841637] Extcon AUX1(HDMI) enable
[ 1250.860333] tegradc 15200000.nvdisplay: unblank
[ 1250.860349] tegradc 15210000.nvdisplay: blank - powerdown
[ 1637.863589] tegra194-vi5 15c10000.vi: =================  START STATUS  =================
[ 1637.863597] tegra194-vi5 15c10000.vi: ==================  END STATUS  ==================
[ 1637.867148] adv7282 10-0021: adv7180_g_dv_timings():
[ 1637.874207] Unable to handle kernel NULL pointer dereference at virtual address 000001e8
[ 1637.874379] Mem abort info:
[ 1637.874435]   ESR = 0x96000005
[ 1637.874491]   Exception class = DABT (current EL), IL = 32 bits
[ 1637.874590]   SET = 0, FnV = 0
[ 1637.874645]   EA = 0, S1PTW = 0
[ 1637.874702] Data abort info:
[ 1637.874753]   ISV = 0, ISS = 0x00000005
[ 1637.874819]   CM = 0, WnR = 0
[ 1637.874879] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc1330a6000
[ 1637.875089] [00000000000001e8] *pgd=0000000000000000, *pud=0000000000000000
[ 1637.875235] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 1637.875338] Modules linked in: fuse zram overlay bnep rtl8822ce rtk_btusb btusb btrtl btbcm btintel cfg80211 spidev userspace_alert nvgpu bluedroid_pm ip_tables x_tables
[ 1637.875756] CPU: 0 PID: 11880 Comm: v4l2-compliance Tainted: G        W       4.9.201-tegra #12
[ 1637.876404] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[ 1637.876897] task: ffffffc1908cc600 task.stack: ffffffc1516d8000
[ 1637.877364] PC is at tegra_vi5_g_volatile_ctrl+0x48/0x120
[ 1637.881784] LR is at tegra_vi5_g_volatile_ctrl+0x2c/0x120
[ 1637.887034] pc : [<ffffff8008b49268>] lr : [<ffffff8008b4924c>] pstate: 40400145
[ 1637.894644] sp : ffffffc1516dbac0
[ 1637.897623] x29: ffffffc1516dbac0 x28: ffffffc1e0fd2800 
[ 1637.903229] x27: 000000000f000000 x26: 0000000000000000 
[ 1637.908820] x25: ffffff800a01f750 x24: 0000000000000047 
[ 1637.914067] x23: 0000000000000001 x22: 0000000000000018 
[ 1637.919141] x21: ffffffc1516dbb60 x20: ffffffc1e2aaf820 
[ 1637.924827] x19: ffffffc1e0fd2800 x18: 0000000000000001 
[ 1637.930429] x17: 0000007f83021530 x16: ffffff8008272650 
[ 1637.935867] x15: ffffffffffffffff x14: ffffffc1516dbac0 
[ 1637.941555] x13: ffffffc1516db9c5 x12: 0000000000000000 
[ 1637.947491] x11: ffffffc1516db980 x10: ffffffc1516db980 
[ 1637.953181] x9 : 0000000000000002 x8 : 0000000000000002 
[ 1637.958954] x7 : ffffff8008fc7100 x6 : 0000000000000090 
[ 1637.964215] x5 : 000000000000008d x4 : 0000000000000001 
[ 1637.969804] x3 : 00000000009a2033 x2 : 0000000000000000 
[ 1637.975140] x1 : ffffffc1908cc600 x0 : 00000000009a2032

I assume the problem is at timings ?

Hello,
When you read video0 on /dev with v4l2-ctl, nothing show?
Give me your output with v4l2-ctl -d videoX --all
X is number of video device file

yes the chese crashes, info you asked is below, i am not doing much change from your code, just renamed device tree info to 7282 and vi and csi address is followed as per xavier nx formats in dt.

Driver Info (not using libv4l2):
	Driver name   : tegra-video
	Card type     : vi-output, adv7282 10-0021
	Bus info      : platform:15c10000.vi:2
	Driver version: 4.9.201
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format
Priority: 2
Video input : 0 (Camera 2: ok)
DV timings:
	Active width: 0
	Active height: 0
	Total width: 0
	Total height: 0
	Frame format: progressive
	Polarities: -vsync -hsync
	Pixelclock: 0 Hz
	Horizontal frontporch: 0
	Horizontal sync: 0
	Horizontal backporch: 0
	Vertical frontporch: 0
	Vertical sync: 0
	Vertical backporch: 0
	Standards: 
	Flags: 
Format Video Capture:
	Width/Height      : 720/576
	Pixel Format      : 'UYVY'
	Field             : Alternating
	Bytes per Line    : 1440
	Size Image        : 829440
	Colorspace        : SMPTE 170M
	Transfer Function : Default (maps to Rec. 709)
	YCbCr/HSV Encoding: Default (maps to ITU-R 601)
	Quantization      : Default (maps to Limited Range)
	Flags             : 

User Controls

                     brightness 0x00980900 (int)    : min=-128 max=127 step=1 default=0 value=0 flags=slider
                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=128 value=128 flags=slider
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=128 value=128 flags=slider
                            hue 0x00980903 (int)    : min=-127 max=128 step=1 default=0 value=0 flags=slider
                 fast_switching 0x00981970 (bool)   : default=0 value=0

Camera Controls

           sensor_configuration 0x009a2032 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, volatile, has-payload
         sensor_mode_i2c_packet 0x009a2033 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, volatile, has-payload
      sensor_control_i2c_packet 0x009a2034 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, volatile, has-payload
                    bypass_mode 0x009a2064 (intmenu): min=0 max=1 default=0 value=0
                override_enable 0x009a2065 (intmenu): min=0 max=1 default=0 value=0
                   height_align 0x009a2066 (int)    : min=1 max=16 step=1 default=1 value=1
                     size_align 0x009a2067 (intmenu): min=0 max=2 default=0 value=0
               write_isp_format 0x009a2068 (int)    : min=1 max=1 step=1 default=1 value=1
       sensor_signal_properties 0x009a2069 (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
        sensor_image_properties 0x009a206a (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
      sensor_control_properties 0x009a206b (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
              sensor_dv_timings 0x009a206c (u32)    : min=0 max=0 step=0 default=0 flags=read-only, has-payload
               low_latency_mode 0x009a206d (bool)   : default=0 value=0
               preferred_stride 0x009a206e (int)    : min=0 max=65535 step=1 default=0 value=0
                   sensor_modes 0x009a2082 (int)    : min=0 max=30 step=1 default=30 value=30 flags=read-only

Attached are trace logs, can we deduce anything from it, FYI the log is taken for resolution 720/570
trace_log720570.gz (242.8 KB)

Changes done i am posting as diff -files, Main only change is with the Device Tree file



> 19d18
> < #include <dt-bindings/platform/t210/t210.h>
> 20a20
> > 
> 23c23
> < 		vi_base: vi {
> ---
> > 		vi@15c10000  {
> 25a26
> > 
> 50c51
> < 		csi_base: nvcsi {
> ---
> > 		nvcsi@15a00000 {
> 68c69
> < 							remote-endpoint = <&rbpcv2_imx219_dual_out0>;
> ---
> > 							remote-endpoint = <&rbpcv2_imx219_out0>;
> 87c88
> < 					csi_chan1_port0: port@2 {
> ---
> > 					csi_chan1_port0: port@0 {
> 96c97
> < 					csi_chan1_port1: port@3 {
> ---
> > 					csi_chan1_port1: port@1 {
> 112c113
> < 				compatible = "adi,adv7280-m";
> ---
> > 				compatible = "adi,adv7282-m";
> 114c115
> < 				reg = <0x21>;
> ---
> > 				reg = <0x10>;
> 123c124
> < 				sensor_model = "adv7280-m";
> ---
> > 				sensor_model = "adv7282-m";
> 127,131d127
> < 				// mclk = "extperiph1";
> < 				// refclk_hz = <28636363>;
> < 				// linux,phandle = <0x118>;
> < 				// phandle = <0x118>;
> < 
> 138c134
> < 						rbpcv2_imx219_dual_out0: endpoint {
> ---
> > 						rbpcv2_imx219_out0: endpoint {
> 149c145
> < 			imx219_cam1: rbpcv2_imx219_e@10 {
> ---
> > 			imx219_cam1: rbpcv2_imx219_c@10 {
> 152c148
> < 				reg = <0x21>;
> ---
> > 				reg = <0x10>;
> 165,168d160
> < 				// mclk = "extperiph1";
> < 				// refclk_hz = <28636363>;
> < 				// linux,phandle = <0x118>;
> < 				// phandle = <0x118>;
> 176a169
> > 							status = "okay";
> 246c239
> < 				badge = "porg_front_RBPCV2";
> ---
> > 				badge = "jakku_front_RBP194";
> 251c244
> < 					devname = "adv7280 7-0021";
> ---
> > 					devname = "adv7282 7-0021";
> 260c253
> < 				badge = "porg_rear_RBPCV2";
> ---
> > 				badge = "jakku_rear_RBP194";
> 265,266c258,259
> < 					devname = "adv7280 8-0021";
> < 					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_imx219_e@10";
> ---
> > 					devname = "adv7282 8-0021";
> > 					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_imx219_c@10";

I double went through the code , device tree and the trace log,
why do you thing this short frame error keeps coming, kindly help me in this regard

Now i have switched to jetson nano and used the code straight away just by hardcoding resolution to 720x576 inside the file, but i am currently facing following error

[ 382.706704] adv7282 7-0021: adv7180_mbus_fmt: w=720, h=576
[ 382.706708] adv7282 7-0021: adv7180_mbus_fmt: w=720, h=576
[ 382.827556] vi 54080000.vi: cil_settingtime was autocalculated
[ 382.827566] vi 54080000.vi: csi clock settle time: 13, cil settle time: 10
[ 382.829220] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 0
[ 383.041201] video4linux video0: frame start syncpt timeout!0
[ 383.046948] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 383.046953] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
[ 383.046957] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
[ 383.046997] vi 54080000.vi: cil_settingtime was autocalculated
[ 383.047001] vi 54080000.vi: csi clock settle time: 13, cil settle time: 10
[ 383.055122] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 2
[ 383.075031] vi 54080000.vi: tegra_channel_error_status:error 4000 frame 3

For a discontinous clock the following is the error

[ 99.187358] vi 54080000.vi: csi clock settle time: 13, cil settle time: 10
[ 99.390078] video4linux video0: frame start syncpt timeout!0
[ 99.395759] video4linux video0: TEGRA_VI_CSI_ERROR_STATUS 0x00000000
[ 99.395766] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000000
[ 99.395770] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000010
[ 99.395774] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00040041

Please expalin what is clock being discontinous ? i dont think my device supports such feature.

I am not sure why its happening, can you please help.