SPI RXDATA always 0

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

SPI RXDATA always 0

1,326 Views
muthuswamydiksh
Contributor II

I am reading only 0x00 in ECSPI RXDATA register.

I am using iMX6 with BSP 4.1.0. Kernel version 3.0.35.

I am using spidev4.2 as master and mode =0.

I can see that SCK and MOSI are sending out correct data.

I can also see correct data in MISO line.

But the RXDATA register always reads 0. I put a printk in spi_imx_buf_rx_##type in spi_imx.c file.

#define MXC_SPI_BUF_RX(type)                                            \

static void spi_imx_buf_rx_##type(struct spi_imx_data *spi_imx)         \

{ \

        unsigned int val = readl(spi_imx->base + MXC_CSPIRXDATA);       \

        printk(KERN_INFO"%s: %s: %d: rxdata = %u\n", __FILE__, __func__, __LINE__, val);              \ \

        if (spi_imx->rx_buf) {                                          \

                *(type *)spi_imx->rx_buf = val;                         \

spi_imx->rx_buf += sizeof(type);                        \

        } \

}

Val always prints 0.

I am not able to figure out why.

I am send two bytes. 1st is command and 2nd byte is dummy(0x00). On sending the second byte I can see the correct response on MISO line but it doesn’t reflect in RXDATA register.

I am doing 16 bits-per-word burst transfer. Since one command-response sequence takes 2 bytes.

I did multiple 16bpw transfer. But still I read only 0x00 in RXDATA register.

Request some help for me.

Thanks!

Labels (7)
0 Kudos
4 Replies

850 Views
wenjingwang
Contributor II

I have the same issue on my IMX6DL sabresd board, my question link is :

https://community.freescale.com/thread/332450dd

can any one help me about this issue? thanks.

0 Kudos

850 Views
igorpadykov
NXP Employee
NXP Employee

Hi Muthuswamy

actually there many i.MX6 processors: i.MXDQ,DLS,SL -

which one are you using ? Had you chance to test on Freescale

Reference boards: Sabre SDP/SDB/AI ?

Had you checked IOMUX settings, what pads were used, had

you checked if Daisy Chain involved in ECSPI input path ?

0 Kudos

850 Views
muthuswamydiksh
Contributor II

A resistor was not populated. That was causing the MISO line give correct output, but when looked closely, it could be observed that the amplitude of the data was ~1V. SO, the uC would read a 0 always. Solved.

chipexpert, thanks for your suggestions.

0 Kudos

850 Views
muthuswamydiksh
Contributor II

I have to complete it asap. Request your help.

0 Kudos