This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VEN-Q1: SPI rx fifo overflow problem.

Part Number: TDA4VEN-Q1

I am developping on TDA4VEN using rtos sdk 11.01. 

We have 2 TDA4VEN on our custom board connected via SPI. I am developing full-duplex communication between them.

Currently, I am facing an issue on spi slave side: MCSPI_transfer returns ok but the trasaction status is MCSPI_TRANSFER_CANCELLED. After checking further, I found that this is due to an RX FIFO OVERFLOW on slave side. 

So I would like to know under which conditions would an RX FIFO OVERFLOW occurs? and what is the recommended way to avoid it?

For reference, I have attached my SPI syscfg settings for both slave and master:

image.png

image.png

and the rx fifo overflow is from this code branch:

image.png

  • Hello,

    RX FIFO overflow in MCSPI slave mode occurs when data arrives faster than it can read it . The master sends data while the slave hasn't consumed previous data from the FIFO and RX FIFO is full and new data arrives .If using interrupt mode, the CPU takes too long to service the FIFO read interrupt and the slave application doesn't process received data quickly enough between transfers.

    what are your Rx fifo trigger levels ? keep it at minimum 8 or something.

    Are there any high priority events happening on slave other than SPI ?

    Regards

    Tarun Mukesh 

  • Rx Fifo trigger level is 16.

    interrupt priority is 4.

    I would like to know further:

    1. is priority number the smaller the number, the higher the priority? what is the recommended SPI priority?

    2. Would this problem be solved if I change it from interrupt mode to DMA mode?

  • Hello,

    is priority number the smaller the number, the higher the priority? what is the recommended SPI priority?

    Yes smaller the number higher the priority. You can go with the possible as lowest as possible. Rx FIFO trigger level you can change to 8.

    if these don't work out yet then you can also go with DMA Mode for faster operations

    Regards

    Tarun Mukesh

  • switched to DMA mode, and this problem disappears.

    thanks.