AnsweredAssumed Answered

Burst on ECSPI2 on i.MX8M Mini EVK

Question asked by frk on Feb 19, 2020
Latest reply on Feb 20, 2020 by igorpadykov

Hello,

 

I'm trying to use ecspi2 on the i.MX8M Mini EVK using spidev.

 

I've followed the hint of the following topic to set spidev :

https://community.nxp.com/thread/502230

 

My main question is the following one :

Why the chip select toggle between each byte sent whereas I send 255 byte each time?

 

I use the following simple code :

 

static void transfer(int fd, uint8_t const *tx, uint8_t const *rx, size_t len)
{
    int ret;
    struct spi_ioc_transfer tr = {
        .tx_buf = (unsigned long)tx,
        .rx_buf = (unsigned long)rx,
        .len = len,
        .delay_usecs = delay,
        .speed_hz = speed,
        .bits_per_word = bits,
    };

 

    ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
    if (ret < 1)
        pabort("can't send spi message");
}

 

...

uint8_t default_tx[255] ;
uint8_t default_rx[ARRAY_SIZE(default_tx)] = { 0, };

for (i = 0; i < SIZESPI; i++)
            default_tx[i] = i;
transfer(fd, default_tx, default_rx, sizeof(default_tx));

 

Using a scope, I see that the chip select timing is pretty strict but its value change 255 times.

 

Best regards,

 

Frederic

Outcomes