Single bulk memory copy (instead of memcpy)
We are using STM32-767ZI and copying a small array into a memory area which is mapped to an external FPGA.
Looking for how to make the copy in a single bulk operation.
The options are:
1. with a loop:
while(i < destMemoryLength){
destMemoryAddress[i] = srcMemoryBuffer[i]; i++; }this is probably using the CPU for each copy. (guessing it's an assembly MOV operations for each).
2. with C memcpy(dest, src, size):
memcpy(destMemoryAddress, srcMemoryBuffer, sizeof(srcMemoryBuffer));
//Q: Is memcpy optimized to use a single CPU instruction, or uses a loop internally?
3. Is there another HAL\CMSIS\else command or function that does a bulk copy?
(in other words, what should we do to ensure a bulk copy, and not a byte-by-bye copy?)
Thanks!
#memory-to-memory #stm32-f7 #memcpy