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.

Compiler/TMS320F280049C: TMS320F280049C FlashApi using

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

Hello!
      The following problems were encountered when using the FlashApi of TMS320F280049C:

1. warning 28004x_generic_flash_lnk.cmd", line 282: warning #10068-D: no matching section

2. The FlashApi library file could not be found when linking:

undefined first referenced  symbol in file      

Fapi_checkFsmForReady() 
Fapi_doBlankCheck(unsigned long *, unsigned long, Fapi_FlashStatusWordType *) 
Fapi_doVerify(unsigned long *, unsigned long, unsigned long *, Fapi_FlashStatusWordType *) 
Fapi_getFsmStatus() 
Fapi_initializeAPI(volatile FMC_REGISTERS *, unsigned long) 
Fapi_issueAsyncCommandWithAddress(Fapi_FlashStateCommandsType, unsigned long *) 
Fapi_issueProgrammingCommand(unsigned long *, unsigned int *, unsigned int, unsigned int *, unsigned int, Fapi_FlashProgrammingCommandsType) 
Fapi_setActiveFlashBank(Fapi_FlashBankType)

But actually I have included the corresponding header files and libraries.

The corresponding configuration in the cmd file is as follows:

PAGE 0 :
 ......

RAMGS1 : origin = 0x00E000, length = 0x002000

RAMGS2 : origin = 0x010000, length = 0x002000

RAMGS3 : origin = 0x012000, length = 0x002000

/* Flash sectors */
FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */
......

SECTIONS

{

......

Flash28_API:
{
//-l F021_ROM_API_F28004x_FPU32.lib
-l F021_API_F28004x_FPU32.lib
}
LOAD = FLASHB,
RUN = RAMGS3,
LOAD_START(_Flash28_API_LoadStart),
LOAD_SIZE(_Flash28_API_LoadSize),
LOAD_END(_Flash28_API_LoadEnd),
RUN_START(_Flash28_API_RunStart),
RUN_SIZE(_Flash28_API_RunSize),
RUN_END(_Flash28_API_RunEnd),
PAGE = 0

  • Hi,

    Could you please use the project

    "flashapi_ex1_program_autoecc" from \C2000Ware_1_00_06_00\driverlib\f28004x\examples\flash\
    Or use this project as reference for modifying your project.

    Include options and linker options can be referred from here.
    Regarding the warning, use 28004x_flash_api_lnk.cmd linker command file.

    Please let me know if you need anything else.

    Thanks,
    Katta
  • Zhaoheng,

    The linker command file (28004x_flash_api_lnk.cmd) used with Flash API usage example (flashapi_ex1_program_autoecc) is available at C:\ti\c2000\C2000Ware_x_xx_xx_xx\device_support\f28004x\common\cmd.

    Also, the Flash API library is available at \C2000Ware_x_xx_xx_xx\libraries\flash_api\f28004x\lib.
    Please check the path you are using.

    Thanks and regards,
    Vamsi
  • Compare flashapi_ex1_program_autoecc and found the following differences:
    My cmd is:
    .TI.ramfunc : LOAD = FLASHCH,
    RUN = RAMGS1,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0, ALIGN(4)
    Flash28_API:
    {
    -l F021_API_F28004x_FPU32.lib
    }
    LOAD = FLASHB,
    RUN = RAMGS3,
    LOAD_START(_Flash28_API_LoadStart),
    LOAD_SIZE(_Flash28_API_LoadSize),
    LOAD_END(_Flash28_API_LoadEnd),
    RUN_START(_Flash28_API_RunStart),
    RUN_SIZE(_Flash28_API_RunSize),
    RUN_END(_Flash28_API_RunEnd),
    PAGE = 0
    flashapi_ex1_program_autoecc‘s cmd is:
    GROUP
    {
    .TI.ramfunc
    { -l F021_API_F28004x_FPU32.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),
    PAGE = 0, ALIGN(4)
  • Hi,

    Could you compile the code without any build errors?

    Looks like you are storing Flash API ramfuncs and .TI.ramfuncs in different sectors.

    Do you have Flash28_API_LoadStart, Flash28_API_LoadEnd etc. declared somewhere?

    Did you do a memcpy with above variables similar to
    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    Does RAMGS3 belong to PAGE 0?

    Please let us know your current issue.

    Thanks,
    Katta
  • Thanks for your reply!

    Could you compile the code without any build errors?
    No, compile stage have no error, linker stage have error: undefined first referenced symbol in file Fapi_checkFsmForReady() etc.

    Looks like you are storing Flash API ramfuncs and .TI.ramfuncs in different sectors.
    yes, I did storing Flash API ramfuncs and .TI.ramfuncs in different sectors.

    Do you have Flash28_API_LoadStart, Flash28_API_LoadEnd etc. declared somewhere?
    I have not declared Flash28_API_LoadStart, Flash28_API_LoadEnd somewhere, only in .cmd;
    In my program, just extern them.

    Did you do a memcpy with above variables similar to
    Yes, I do memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize); in my program.

    Does RAMGS3 belong to PAGE 0?
    Yes, RAMGS3 belong to PAGE 0.
  • Hi,

    Do you have  memcpy(&Flash28_API_RunStart, &Flash28_API_LoadStart, (size_t)&Flash28_API_LoadSize); used in the code.

    Could you please share your compiler settings?

    Did you update your linker file search path to C2000Ware_x_xx_xx_xx\libraries\flash_api\f28004x\lib
    from workspace_loc:/${ProjName}/Driver/common/lib?

    Thanks,
    Katta

  • Zhaoheng,

    Any update from your side?

    If you are still facing the issue could you please attach your project here? Remove any copyrighted information before sharing.

    Thanks,
    Katta
  • Thank you very much for your reply!
    The problem has been solved, due to the mixed compilation of C and C++.