This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Dear team:
Do we have a complete documentation of the memcpy and memcopy function?
I know this function use to copy the code from flash to ram, but some details of this function are not clear.
For example, how to get the starting address of the function when compiling? Is that code copied into RAM to run?
Do we have any documents or posts to introduce this function?
Best regards
I presume you don't need a description of how memcpy itself works. Instead, you want to know how ...
this function use to copy the code from flash to ram
I'll describe how it is typically done in C2000Ware example projects.
The linker command file has code similar to what is described in the Load at One Address, Run from a Different Address part of the larger article Linker Command File Primer. C code in the example project has lines similar to ...
/* In a header file */ extern uint16_t RamfuncsLoadStart; extern uint16_t RamfuncsLoadEnd; extern uint16_t RamfuncsLoadSize; /* In a C file */ memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
To understand the details of this C code, please search the C28x assembly tools manual for the sub-chapter titled Using Linker Symbols in C/C++ Applications.
Note that memcpy call must occur before any of the functions in the Ramfuncs section are called.
If you build for EABI, then the names of the symbols written in the linker command file must not use the leading underscore.
Thanks and regards,
-George