AnsweredAssumed Answered

imx6ul evk board spi not work

Question asked by tony zhang on Dec 15, 2016
Latest reply on Dec 18, 2016 by tony zhang

Hi.

 I use imx6ul evk demo board to test spi interface, (ECSPI4)

the dts is :

.....

ecspi4 {
pinctrl_ecspi4: ecspi4grp {
fsl,pins = <
MX6UL_PAD_ENET2_TX_CLK__ECSPI4_MISO 0x000010B0
MX6UL_PAD_ENET2_TX_DATA1__ECSPI4_SCLK 0x000010B0
MX6UL_PAD_ENET2_TX_EN__ECSPI4_MOSI 0x000010B0
>;
};
pinctrl_ecspi4_cs: ecspi4_csgrp {
fsl,pins = <
MX6UL_PAD_UART5_TX_DATA__GPIO1_IO30 0x000010B0
>;
};
};

.....

&ecspi4 {
fsl,spi-num-chipselects = <1>;
pinctrl-names = "default";
cs-gpios = <&gpio1 30 0>;
pinctrl-0 = <&pinctrl_ecspi4 &pinctrl_ecspi4_cs>;
status = "okay";

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

 

 

Then use imx-test test demo to test the spi.

it shows:

root@imx6ulevk:/usr/test# ./spi_test -D 2 -s 1000000 -b 8 E6E0
Execute data transfer test: 2 4 E[ 56.155739] tony--tony---spi_imx_setup
6E0
[ 56.161517] tony--tony---spi_imx_setup
[ 56.165357] tony--tony---spi_imx_setup
spi mode: 0
bits per word: 8
max speed: 10[ 56.175155] tony--tony--spi_imx_pio_transfer transfer->tx_buf[] = E6E0
00000 Hz (1000 KHz)
Corrupted data at 0 wbuf = 69 rbuf = 0
Corrupted data at 1 wbuf = 54 rbuf = 0
Corrupted data at 2 wbuf = 69 rbuf = 0
Corrupted data at 3 wbuf = 48 rbuf = 0
Data sent : E6E0
Data received :
Test FAILED.

 

 

I am not sure how can I let spi work normal.

 

TKS,

Outcomes