spi first time op error in imx6ull with kernel 4.19.35

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

spi first time op error in imx6ull with kernel 4.19.35

733 Views
240697273
Contributor I

hardware: imx6ull

kernel: kernel 4.19.35

in custom board, i use ecspi1 controller two devices,  dts as follow:

ecspi1 {
   fsl,spi-num-chipselects = <2>;
   cs-gpios = <
      &gpio5 9 0
      &gpio3 5 0
   >;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_ecspi1_1 &pinctrl_ecspi1_spi0 &pinctrl_ecspi1_spi1>;
   status = "okay";

   spi0: spidev0 {
      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "rohm,dh2228fv";
      spi-max-frequency = <20000000>;

      reg = <0>;
   };
   spi1: spidev1 { 

      #address-cells = <1>;
      #size-cells = <1>;
      compatible = "rohm,dh2228fv";
      spi-max-frequency = <20000000>;

      reg=<1>;

   };
};

when kernel start, i use app operate spidev1 to read devid,  it's failed to get it in first time, and soon on  i read it again, it's always ok. only first read error.

when kernel start, i read spidev0 devid in first time, it's always ok contain first time. wha't wrong with it, help me

i use logic analyize the wave when first read spidev1, wave form as follow:

   pastedImage_1.png

please ignore mosi, before operate ecspi1, i config spi works mode3, but i found CLK is low in idle in first transfer, again test wave about spidev1, i can read fine devid, CLK wave is high in idle about its wave, what's wrong with it at first time, please help me, thanks

0 Kudos
1 Reply

605 Views
igorpadykov
NXP Employee
NXP Employee

Hi he

for such weird behaviour one can try to rebuild all image from scratch, try

with minimal configuration. Use nxp bsps described on

i.MX Software and Development Tools | NXP 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos