AnsweredAssumed Answered

Troubles with parallel camera on IPU2/CSI1

Question asked by chris whittenburg on Sep 25, 2015
Latest reply on Mar 31, 2017 by Seba Seba

I'm having trouble getting any data from a ar0130cs image sensor connected to IPU2/CSI1 of our Variscite DART (imx6q) board.  I'm able to talk to the sensor, and I see activity on the pclk, hsync, vsync, and data lines, but I just get timeouts when trying to get frames with yavta.  This is a 3.14.38 kernel...

 

I modified imx6qdl-var-dart.dtsi to add the sensor (it has it's own oscillator, and doesn't need any mclk from the i.mx6, but I have entries for it.)

 

&i2c3 {
  clock-frequency = <100000>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_i2c3_3>;
  status = "okay";


  ar0130cs: ar0130cs@10 {
  compatible = "aptina,ar0130cs";
  reg = <0x10>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_ar0130>;
  clocks = <&clks 200>;
  clock-names = "csi_mclk";
  csi_id = <1>;
  mclk = <24000000>;
  mclk_source = <0>;
  };

 

I added these entries for the pin multiplexer, which seems to be ok.  I'm only really using the top 8 bits (DATA19 to DATA12) bit I configured all of them:

 

 

pinctrl_ar0130: pinctrl_ar0130 { /* parallel camera */
  fsl,pins = <
       MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK       0xb0b1
       MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC       0xb0b1
       MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC       0xb0b1
       MX6QDL_PAD_EIM_DA10__GPIO3_IO10            0x1b0b1
       MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19       0xb0b1
       MX6QDL_PAD_EIM_A23__IPU2_CSI1_DATA18       0xb0b1
       MX6QDL_PAD_EIM_A22__IPU2_CSI1_DATA17       0xb0b1
       MX6QDL_PAD_EIM_A21__IPU2_CSI1_DATA16       0xb0b1
       MX6QDL_PAD_EIM_A20__IPU2_CSI1_DATA15       0xb0b1
       MX6QDL_PAD_EIM_A19__IPU2_CSI1_DATA14       0xb0b1
       MX6QDL_PAD_EIM_A18__IPU2_CSI1_DATA13       0xb0b1
       MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12       0xb0b1
       MX6QDL_PAD_EIM_EB0__IPU2_CSI1_DATA11       0xb0b1
       MX6QDL_PAD_EIM_EB1__IPU2_CSI1_DATA10       0xb0b1
       MX6QDL_PAD_EIM_DA0__IPU2_CSI1_DATA09       0xb0b1
       MX6QDL_PAD_EIM_DA1__IPU2_CSI1_DATA08       0xb0b1
  >;
};

 

I added this for the v4l2 capture device...  I think ipu_id=1 and csi_id=1 corresponds to "IPU2/CSI1", right?  Why does ipu numbering start with 0, but csi numbering starts with 1?

 

v4l2_cap_0 {
  compatible = "fsl,imx6q-v4l2-capture";
  ipu_id = <1>;
  csi_id = <1>;
  mclk_source = <0>;
  status = "okay";
};

 

Does any of that look wrong to anyone?  I also made some modifications to support 8-bit grayscale, but I'll post that separately.

 

root@var-som-mx6:~# yavta -i1 --format Y8 --size 1280x896 -c2 --file=image /dev/video0                                                                          
Device /dev/video0 opened.                                                      
Device `' on `' is a video output (without mplanes) device.                     
Input 1 selected                                                                
Video format set: Y8 (59455247) 1280x896 (stride 1280) field any buffer size 1146880                                                                            
Video format: Y8 (59455247) 1280x896 (stride 1280) field any buffer size 1146880
8 buffers requested.                                                            
length: 1146880 offset: 1147142144 timestamp type/source: unk/EoF               
Buffer 0/0 mapped at address 0x76ca7000.                                        
length: 1146880 offset: 1149239296 timestamp type/source: unk/EoF               
Buffer 1/0 mapped at address 0x76b8f000.                                        
length: 1146880 offset: 1151336448 timestamp type/source: unk/EoF               
Buffer 2/0 mapped at address 0x76a77000.                                        
length: 1146880 offset: 1153433600 timestamp type/source: unk/EoF               
Buffer 3/0 mapped at address 0x7695f000.                                        
length: 1146880 offset: 1155530752 timestamp type/source: unk/EoF               
Buffer 4/0 mapped at address 0x76847000.                                        
length: 1146880 offset: 1157627904 timestamp type/source: unk/EoF               
Buffer 5/0 mapped at address 0x7672f000.                                        
length: 1146880 offset: 1159725056 timestamp type/source: unk/EoF               
Buffer 6/0 mapped at address 0x76617000.                                        
length: 1146880 offset: 1161822208 timestamp type/source: unk/EoF               
Buffer 7/0 mapped at address 0x764ff000.                                        
                                                                                
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0                       
Unable to dequeue buffer: Timer expired (62).                                   
8 buffers released.                                                             
root@var-som-mx6:~#  

Thanks.

Outcomes