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.

TMS320F28069: Missing LRETR after placing Flash2806x_API_wFPU_Library in ram

Part Number: TMS320F28069

Need help incorporating the Flash2806 lib

I'm placing the Flash2806x_API_wFPU_Library in RAM using the following linker command file

SECTIONS
{
   Flash28_API:
   {
       -lFlash2806x_API_wFPU_Library.lib(.econst)
       -lFlash2806x_API_wFPU_Library.lib(.text)
   }                  LOAD = APP_PROG,
                      RUN  = RAM_PROG,
                      LOAD_START(_Flash28_API_LoadStart),
                      LOAD_END  (_Flash28_API_LoadEnd),
                      RUN_START (_Flash28_API_RunStart),
                      PAGE = 0
}

In my program I call the Flash_APIVersionHex()

    Uint16 version = Flash_APIVersionHex();

I see that the function is called

767DD4E0    LCR          Flash2806x_APIVersionHex

but there is no LRETR at the end of the Flash286x_APIVersionHex. Instead the program continues into the next function and crashed my program

If I exclude the linker command above I see the same call as above and the LRETR is there.

  • I just realized that I missed the memcopy of the library

    #if(CONFIG_RUN_FROM_FLASH == 1u)
        (void)memcpy((void*)&Flash28_API_RunStart, (void*)&Flash28_API_LoadStart, (size_t)((uintptr_t)&Flash28_API_LoadEnd - (uintptr_t)&Flash28_API_LoadStart));
    #endif

    Solved my problem