关于imx6D的ECSPI CS信号

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

关于imx6D的ECSPI CS信号

Jump to solution
1,586 Views
1282497337
Contributor II

hi,

我尝试使用imx6D的SPI5(master)与SPI转UART(slave)进行通信,slave设备要求CS保持两个字节有效(cmd+data),但是imx6每发送一个字节,CS就会被拉高,在该情况下我的设备就无法获取data,使用spidev_test.c设置cs_change不起作用,查看spi-imx.c驱动似乎没有对cs_change进行任何处理,根据数据手册IMX6DQRM第21章的描述, 我想设置成Figure 21-8 的状态,当我设置SS_CTL[3:0] 0000 时,内核好像被hangs up了,当设置SS_CTL[3:0]为SS_CTL[3:0] 0001时,CS输出状态为Figure 21-9,kernel为3.14.52,对此不知道该如何去设置,还请不吝指教。
谢谢!
Alee

0 Kudos
1 Solution
947 Views
jimmychan
NXP TechSupport
NXP TechSupport

FYI. linux-imx.git - i.MX Linux Kernel 

For example: 

&ecspi1 {

         fsl,spi-num-chipselects = <1>;

         cs-gpios = <&gpio4 9 0>;

         pinctrl-names = "default";

         pinctrl-0 = <&pinctrl_ecspi1>;

         status = "okay";

 

         flash: m25p80@0 {

                  #address-cells = <1>;

                  #size-cells = <1>;

                  compatible = "st,m25p32";

                  spi-max-frequency = <20000000>;

                  reg = <0>;

         };

 

 

 

pinctrl_ecspi1: ecspi1grp {

                          fsl,pins = <

                                   MX6QDL_PAD_KEY_COL1__ECSPI1_MISO     0x100b1

                                   MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI   0x100b1

                                   MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK      0x100b1

                                   MX6QDL_PAD_KEY_ROW1__GPIO4_IO09             0x1b0b0

                          >;

                  };

 

View solution in original post

0 Kudos
5 Replies
947 Views
jimmychan
NXP TechSupport
NXP TechSupport

you can change the CS to GPIO. Then you can use the GPIO to output the CS signal that you need.

0 Kudos
947 Views
1282497337
Contributor II

hi jim,

thank you for the answer,I also think about it ,but it is complex ,because it seem like I can't use the spi controller with no CS pin.I'm try to give it another CS pin, but all of the SPI5 CS pin used by other functions,so what should I do if I change the CS to GPIO.


Thanks,
Alee

0 Kudos
948 Views
jimmychan
NXP TechSupport
NXP TechSupport

FYI. linux-imx.git - i.MX Linux Kernel 

For example: 

&ecspi1 {

         fsl,spi-num-chipselects = <1>;

         cs-gpios = <&gpio4 9 0>;

         pinctrl-names = "default";

         pinctrl-0 = <&pinctrl_ecspi1>;

         status = "okay";

 

         flash: m25p80@0 {

                  #address-cells = <1>;

                  #size-cells = <1>;

                  compatible = "st,m25p32";

                  spi-max-frequency = <20000000>;

                  reg = <0>;

         };

 

 

 

pinctrl_ecspi1: ecspi1grp {

                          fsl,pins = <

                                   MX6QDL_PAD_KEY_COL1__ECSPI1_MISO     0x100b1

                                   MX6QDL_PAD_KEY_ROW0__ECSPI1_MOSI   0x100b1

                                   MX6QDL_PAD_KEY_COL0__ECSPI1_SCLK      0x100b1

                                   MX6QDL_PAD_KEY_ROW1__GPIO4_IO09             0x1b0b0

                          >;

                  };

 

0 Kudos
947 Views
1282497337
Contributor II

hi, jim

Thanks for your help.

it's work 

thanks!!!

0 Kudos
947 Views
jimmychan
NXP TechSupport
NXP TechSupport

you are welcome

0 Kudos