AnsweredAssumed Answered

SPI read/write with changing modes fail

Question asked by Abhinandan B R on Sep 16, 2019
Latest reply on Sep 18, 2019 by igorpadykov

Hi all,

I am testing spi read and write in imx6 as master. The method of my testing includes testing read/write for all modes.

So, first I test read/write separately for SPI mode 0... then do the same read/write test for mode 1... then for mode 2 and finally mode 3.

But this sequence of changing modes and repeating the read/write test is failing.

A single test application is used to test the above sequence.

 

If we change the sequence of testing to SPI mode 1, mode 0 mode 3 and then mode 2 in the end, it is found to be working fine and also this sequence is repeatable.

In all cases, frame size is 32bits and data length is 12 bytes.

 

Below is the spi configuration used in imx6 dts

&ecspi2 {
 pinctrl-names = "default";
 pinctrl-0 = <&pinctrl_ecspi2>;
 fsl,spi-num-chipselects = <2>;
 cs-gpios = <&gpio2 26 0>, <&gpio2 27 0>;
 dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;
 dma-names = "rx", "tx";
 status = "okay";

 

 spi@0 {
 compatible = "spidev";
 spi-max-frequency = <50000000>;
 reg = <0>;
 };

 

 spi@1 {
 compatible = "spidev";
 spi-max-frequency = <50000000>;
 reg = <1>;
 };

}

 

Please let me know if this behavior is expected in this testing.

If not, please point me to the recommended fix I can try out, so that all sequences works.

 

Regards,

Abhinandan

Outcomes