memcpy and cache on STM32F7

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

memcpy and cache on STM32F7

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: memcpy and cache on STM32F7

Post 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
Post Reply