K64 TX FIFO Underflow EDMA SPI Slave

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

K64 TX FIFO Underflow EDMA SPI Slave

1,053 Views
adamkent
Contributor I

I have a K64 SPI Slave using EDMA drivers from KSDK 1.3.0. The SPI master is sending 8K blocks of data (MODE0, 16 bit words) with a 10MHz SPI clock in what appears to be 128 byte bursts. My highest priority MQX task is spinning in a while loop waiting for 8K blocks of data from the master using call to DSPI_DRV_EdmaSlaveTransferBlocking. The master waits 2 milliseconds in between transfers and I have verified that the K64 is always ready to receive before the master initiates a transfer.

I turned on RX FIFO Overflow and TX FIFO Underflow interrupts because I was losing SPI data between master/slave. I am occasionally getting TX FIFO Underflow interrupts to occur. I added error handling and early abort to the DSPI_DRV_EdmaSlaveTransferBlocking API function so that I can recover from this condition, but I would like to know why this interrupt is occurring so that I may attempt to fix the problem. My understanding is that the DSPI/EDMA transfers are completely hardware driven at this point.

The K64 is running at 120MHz with a 60MHz bus clock.  I am using DSPI channel 0 in DMA mode. I have fixed priority DMA channels 0 and 1 for RX and TX respectively. The DMA interrupts are both set to high priority. No other peripherals  (UART, I2C, etc.) are active during the SPI transfers.

All peripherals are configured using Processor Expert.

Labels (1)
0 Kudos
2 Replies

640 Views
adamkent
Contributor I

Daniel,

Thank you for the response.

Just to be perfectly clear...It sounds like even though the DSPI is the only user of the eDMA in my case, I may still have problems if I try to use eDMA for both RX AND TX and that I can only use eDMA for one or the other. Is this correct?

Thanks again,

Adam

0 Kudos

640 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Adam:

Please refer to the known issue of MQX SPI driver,

pastedImage_1.png

I would suggest you check whether DSPI is the only user of eDMA.   Since you are using eDMA for rx and tx, you can disable tx edma or rx edma to see whether it helps.

Regards

Daniel