AnsweredAssumed Answered

K60 SPI In DMA Mode has TX Underflows

Question asked by Nick Borton on Dec 10, 2014
Latest reply on Dec 18, 2014 by Nick Borton



I'm currently running into a problem where the SPI on some boards run into TX underflows when configured to use DMA.


My K60 is set up for the SPI to run in slave mode, 16 bits, with ~6MHz clock from master device. The DMA channel is configured to use scatter gather, so that all I really need to do in the interrupt is set the request enable for that DMA channel.


What I am finding is that the SPI peripheral triggers a TX Underflow interrupt in the middle of a DMA transfer!?!


Here is a dump of the TCD when the underflow occurs:

Breakpoint 4, SpiIntIsr (arg=0) at Spi.c:1826

1826          inst_handle->mErrorTxUnderflow++;

$7 = {SADDR = 0x1fff5e24, SOFF = 0x4, ATTR = 0x202, {NBYTES_MLNO = 0x4, NBYTES_MLOFFNO = 0x4, NBYTES_MLOFFYES = 0x4}, SLAST = 0x0, DADDR = 0x4002c034, DOFF = 0x0, {CITER_ELINKNO = 0x1fb, CITER_ELINKYES = 0x1fb}, DLAST_SGA = 0x0, CSR = 0xa, {BITER_ELINKNO = 0x200, BITER_ELINKYES = 0x200}}



I am running bare metal.