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/TMS320F28069: Linking flash API problems

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

I am having problems linking to the flash API. In the sections portion of my linker file I have the following lines 

   GROUP               : LOAD = APP_FLASH,
                         RUN = RAML0_1,
                         LOAD_START(_RamfuncsLoadStart),
                         LOAD_END(_RamfuncsLoadEnd),
                         RUN_START(_RamfuncsRunStart),
                         crc_table(_CRCTestVector),
                         PAGE = 0
   {
        ramfuncs
        {-l "2806x_BootROM_API_TABLE_Symbols.lib"(.econst)}
        {-l "2806x_BootROM_API_TABLE_Symbols.lib"(.text)}
   }

However on the library include I am getting the warning "warning #10068-D: no matching section" I have included the path to the library in the linker paths. I have also made sure that Flash2806x_Program() function is getting called in my code. So it should be making use of the lib.

#include "Flash2806x_API_Config.h"
#include "Flash2806x_API_Library.h"

Has also been included.

What do I need to do differently to make the linker file pick up that the library is getting used?

For reference my code looks as follows:

#include "sw/drivers/cpu/src/32b/f28x/f2806x/cpu.h"

#include "Flash2806x_API_Config.h"
#include "Flash2806x_API_Library.h"

#include "variables.h"

//----------------------------------------
#ifdef __cplusplus
#pragma DATA_SECTION("FlashScalingVar");
#else
#pragma DATA_SECTION(Flash_CPUScaleFactor, "FlashScalingVar");
#endif
Uint32 Flash_CPUScaleFactor;

//----------------------------------------
#ifdef __cplusplus
#pragma DATA_SECTION("FlashCallbackVar");
#else
#pragma DATA_SECTION(Flash_CallbackPtr, "FlashCallbackVar");
#endif
void (*Flash_CallbackPtr) (void);

FLASH_ST g_FlashStatus;

struct parameterStoreage_struct parameterStorage;

void FlashAPIInit(void){
    EALLOW;
    Flash_CPUScaleFactor = SCALE_FACTOR;
#ifdef ENABLE_WATCHDOG
    Flash_CallbackPtr = FlashAPICallback;
#else
    Flash_CallbackPtr = 0;
#endif
    EDIS;
}

void storeParameters(){
    uint16_t index = *parameterStorage.indexCurrent;
    Uint16 status;
    int i;

    if(!index){
        return;
    }

    i = 0;
    while(index == *parameterStorage.indexCurrent){
        index &= ~((uint16_t)(1 << i));
        i++;
    }
    status = Flash2806x_Program((Uint16 *)parameterStorage.indexCurrent, (Uint16 *)&index, sizeof(index), &g_FlashStatus);
}


  • Hello

    You can include flash API symbol library in your project like a typical file, it doesn't have to be setup as you are doing (load/run). The symbol library is just the global flash API function symbols with their associated function address in ROM. When using flash API from ROM, you don't have to copy it to RAM to run it. Check out the flash API example in C2000Ware under /libraries for F2806x, this will show you what to do.

    See also: processors.wiki.ti.com/.../C28x_Compiler_-_Understanding_Linking

    Best regards
    Chris
  • I didn't realize that the flash API was in the ROM. Hadn't really looked at the name of the library file to see it had symbol in the name. Tou were right I did not need to load the functions into the RAM. I was just following step 6 in the flash API readme.

    In case anybody comes across this in the future:

    The reason my code wasn't actually working was that I didn't define the EmuKeyVar and EmuBModeVar. This meant that my FlashScalingVar pointer was offset by 2 since I was using the default F2806x_Headers_nonBIOS.cmd file.

    All I did to fix this was add 

    #pragma DATA_SECTION(EmuKey,"EmuKeyVar");
    Uint16 EmuKey;
    #pragma DATA_SECTION(EmuBMode,"EmuBModeVar");
    Uint16 EmuBMode;

    Everything is working now, thanks for the help

  • Great to hear you got it working!

    Best regards
    Chris