Question
I'm using the SPI interface to access an SPI memory device using core and DMA
accesses. When I switch between the core and DMA transfers I notice that DMA
transaction transfers 8 bytes of garbage followed by the data. What could be
wrong?
Answer
The correct way of enabling DMA for SPI transfers is to first enable the DMA
and then enable the SPI controller. So if you're switching between core and
DMA transfers then you would disable the SPI at the end of the core transfer
and re-enable the SPI controller after you've enabled the DMA channel for DMA
transfers.