Page 1 of 1

memcpy and cache on STM32F7

Posted: Tue Feb 28, 2017 10:24 am
by steved
AIUI memcpy() (and certain other functions) can be implemented in a platform-specific way to improve efficiency - perhaps using DMA. On the F7 that raises the issue of cache coherency. Is it reasonable to assume that if memcpy() uses DMA, cache coherency will be managed within the function? There's a modest performance hit to flushing/invalidating buffers, so I'd prefer not to do it unnecessarily.

Re: memcpy and cache on STM32F7

Posted: Tue Feb 28, 2017 10:35 am
by Giovanni
Hi,

I think that compiler-provided implementations would never use resources outside the CPU, so no copy using DMA, it would not be even portable. Use of DMA, in any possible scenario, would definitely be affected by cache coherency and that on any M7 device, not just STM32s.

On the other hand you should not expect the C library to handle coherency for you.

Giovanni