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.

TMS320F280037C: how to move flash function to ram

Part Number: TMS320F280037C
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi,

I am working on a project based on the F280037C device where I need to use the Flash API for erase/program operations. Since Flash API functions must execute from RAM, I am trying to move both the Flash API library functions and my Flash-related functions into RAM.

I understand how this is done in the Flash API examples provided in C2000Ware. The examples use a manually edited linker command file and define a section similar to:

GROUP
{
    .TI.ramfunc
    { -l FAPI_F28003x_EABI_v1.58.10.lib }
}
LOAD = FLASH_BANK0_SEC1,
RUN = RAMLS03,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
ALIGN(8)

However, my project uses SysConfig, which automatically generates the linker command file. Because of this:

  1. I cannot directly edit the generated .cmd file since SysConfig overwrites it during regeneration.

  2. I am not sure how to create the equivalent RAM function section using SysConfig.

  3. I am not sure how to correctly place the Flash API library (FAPI_F28003x_EABI_v1.58.10.lib) into a RAM-executed section when using SysConfig.

My questions are:

  1. What is the recommended way to move Flash API functions to RAM in a SysConfig-based project?

  2. Can this be done entirely through SysConfig?

  3. Is there any example project or documentation that shows how to configure RAM functions and Flash API library placement using SysConfig?

  4. If a custom linker command file is required, what is the recommended approach to avoid conflicts with the SysConfig-generated linker file?

Any guidance or example would be greatly appreciated.

Thank you.

  • Hi Harisha,

    Thank you for your question and apologies for the delayed response. Can you please try doing it the following way?

    1. Create a separate .cmd file (e.g., flash_api_ram.cmd) that defines your Flash API RAM section like so

    SECTIONS
    {
    GROUP
    {
    .TI.ramfunc
    { -l FAPI_F28003x_EABI_v1.58.10.lib }
    }
    LOAD = FLASH_BANK0_SEC1,
    RUN = RAMLS03,
    LOAD_START(RamfuncsLoadStart),
    LOAD_SIZE(RamfuncsLoadSize),
    LOAD_END(RamfuncsLoadEnd),
    RUN_START(RamfuncsRunStart),
    RUN_SIZE(RamfuncsRunSize),
    RUN_END(RamfuncsRunEnd),
    ALIGN(8)
    }

    NOTE - The linker will merge it with the SysConfig-generated .cmd file without conflicts, since the linker processes all .cmd files together

    2. Add the flash library to your linker search path. In CCS: Project Properties → C2000 Linker → File Search Path, add the path to FAPI_F28003x_EABI_v1.58.10.lib so the linker can resolve it.

    3.Assign all Flash related functions to .TI.ramfunc

    In your C source files, use the __attribute__((ramfunc)) or #pragma CODE_SECTION to place your wrapper functions into the .TI.ramfunc section:

    #pragma CODE_SECTION(myFlashErase, ".TI.ramfunc")
    void myFlashErase(void) {
    // Flash API calls here
    }

    4. Before calling any Flash API function, copy the section to RAM using memcpy()

    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    Can you try this and let me know if it works?

    Thanks,

    Ira

  • before only i got the thing like i created same thing what you explained in replay thanks for your replay