Page 1 of 1

DMA cache issues on SAM440ep

Posted: Sun Feb 16, 2020 1:51 am
by ncafferkey
Hi,

I have encountered problems with my network drivers on the SAM440ep because of differing behaviour of Exec's DMA functions.

For example, when I call StartDMA()/EndDMA() without the DMA_ReadFromRAM flag, addresses outside the specified memory region are clobbered if they are unlucky enough to share cache lines with the specified region. This does not happen on e.g. the A1SE or X1000. Is this difference due to hardware or software (i.e. kernel implementation) differences?

Also, there seems to be some ambiguity surrounding the use of DMA_ReadFromRAM. The CachePreDMA() AutoDoc states that it *should* be used when the transfer is from RAM to the peripheral device. However, for StartDMA(), at least on the SAM, it appears to be mandatory. Moreover, there is no guidance on whether to use the flag when the device will both read and write the memory area (as is often the case with device-specific DMA transfer descriptors for example).

I currently have OS4.1 Update 6: is there any change in behaviour in later releases?

Re: DMA cache issues on SAM440ep

Posted: Tue Feb 18, 2020 10:46 am
by tonyw
I can't answer your question, but I have pointed it out to others more skilled in the art.