Part Number: MSP430FR5994
Hello,
I read data from an SPI flash using DMA.
Randomly, there is one byte in the read buffer that is corrupted. The corrupted byte is always equal to 0xFC.
It happens more frequently as the transfer size increases. Under 20 bytes read, it never happens.
At first, I though about a messy pointer but that can't be as the code waits for DMA transfer completion with:
while((SPI_TX_DMACTL & DMAIFG) == 0){};
while((SPI_RX_DMACTL & DMAIFG) == 0){};
SPI_TX_DMACTL = SPI_DMA_STOP;
SPI_RX_DMACTL = SPI_DMA_STOP;
while((SPI_UCBxSTATW & UCBUSY) != 0){};
The corrupted byte is present immediately when the transfer finishes.
Oscilloscope probing of the SPI bus at the MSP pins reveals no corrupted bytes. There is no 0xFC transferred on the SPI bus at any time. Never. Data read from flash is exactly what it must be.
It really looks like the DMA or SPI is behaving wrong internally.
SPI clock is 8MHz.
The problem occurs on all of our devices so it is not related to a damaged part.
Absolutely unusual.
Any thoughts?
Regards,
Frederic