Hi, I am trying to use the Flash API as outlined in "TMS320F280x Flash API" version 3.02. If I use memcpy I get compiler errors, if I use MemCopy I get linker errors. I've attached screen shots of the situation.
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.
Hi, I am trying to use the Flash API as outlined in "TMS320F280x Flash API" version 3.02. If I use memcpy I get compiler errors, if I use MemCopy I get linker errors. I've attached screen shots of the situation.
There is another thread about these 2 functions in the C2000 forum. It doesn't directly address the issue you mention, but does provide some insight into which of these you should focus on.
http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/t/197807.aspx
Please post the errors you are seeing with memcpy().
Carl,
When you use memcpy(), are you including <string.h> in your code? memcpy() is a standard library function.
MemCopy() is something we wrote ourselves previously. We are recommending people transition to memcpy() instead, which is what we are doing as well.
Regards,
Daniel
Also, the parameters should be of type unsigned long or Uint16. Not a pointer.
I didn't declare the parameters. I find them in Flash280x_API_Library.h declared as extern Uint16. I don't find the root declaration anywhere and I was assuming it was in the library or something. When I use these variables in memcpy the line is:
memcpy(&Flash28_API_LoadStart, &Flash28_API_LoadEnd, &Flash28_API_RunStart);
this same format works for the CSM stuff:
memcpy(&secureRamFuncs_runstart, &secureRamFuncs_loadstart, &secureRamFuncs_loadend - &secureRamFuncs_loadstart);
So, how should I proceed?
Thanks!
I am not sure about the library. Try declaring them in your file as well. If they are already delcared elsewhere, it will provide an error during compile. Ideally, the library would simply declare extern variables.
The function call parameters should use the & symbols. However, the variable types should be Uint16. I bring this up because in your screenshot, there was an error related to Uint16 * type.
Carl, from what I've seen memcpy uses "Loadsize" and MemCopy uses "LoadEnd".
To use memcpy try this:
Main.c:
memcpy(&Flash28_API_runstart, &Flash28_API_loadstart, (Uint32)(&Flash28_API_loadsize));
Flash_API_Library.h
extern Uint16 Flash28_API_loadstart;
extern Uint16 Flash28_API_loadsize; //modified by Omer to use memcpy instead.
extern Uint16 Flash28_API_runstart;
F2808.cmd
Flash28_API:
{
-lFlash2808_API_V302.lib(.econst)
-lFlash2808_API_V302.lib(.text)
} LOAD = FLASH_AB,
RUN = L0PROG,
LOAD_START(_Flash28_API_loadstart),
LOAD_SIZE(_Flash28_API_loadsize),
RUN_START(_Flash28_API_runstart),
PAGE = 0
Make sure to specify the correct flash and ram sections.
Omer