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.

CCS/TMS320F280049: Stand alone issue when locating TI Flash Api on RAM

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

  Hello, 

     I am experiencing a problem when trying to locate TI flash api in RAM (copy from flash to RAM). This is my linker file:

MEMORY
{

PAGE 0: /* Bootloader Flash code */

BEGIN                     : origin = 0x080000, length = 0x000002
BOOT_VERSION    : origin = 0x080002, length = 0x000002
BOOTLOADER        : origin = 0x080004, length = 0x001FFC

PAGE 1:  /* Data space */

DATARAM          : origin = 0x008000, length = 0x001000
CODERAM         : origin = 0x009000, length = 0x001000

PAGE 2:  /* CRC protected Data Space */

RAMM0            : origin = 0x0000F5, length = 0x00030B
RAMM1            : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */

PAGE 3:  /* Protected RAM Data Space */

RAMGS0        : origin = 0x00C000, length = 0x002000
RAMGS1        : origin = 0x00E000, length = 0x002000
RAMGS2        : origin = 0x010000, length = 0x002000
RAMGS3        : origin = 0x012000, length = 0x002000

PAGE 4:

RESET            : origin = 0x3FFFC0, length = 0x000002

}

SECTIONS
{

 codestart        : LOAD=BEGIN,PAGE = 0, ALIGN(2)

 BootVersion   : LOAD=BOOT_VERSION, PAGE = 0, ALIGN(2)

 .text                : LOAD=BOOTLOADER,  PAGE = 0, ALIGN(4)
 .cinit               : > BOOTLOADER,     PAGE = 0, ALIGN(4)
 .pinit               : > BOOTLOADER,     PAGE = 0, ALIGN(4)
 .switch            : > BOOTLOADER,     PAGE = 0, ALIGN(4)
 .econst           :{ *(.econst) }   LOAD= BOOTLOADER,  PAGE = 0, ALIGN(4)

 GROUP    {
        .TI.ramfunc
        /* { -l F021_API_F28004x_FPU32.lib} */
      }
        LOAD = BOOTLOADER, PAGE = 0,
        RUN = CODERAM, PAGE = 1,
        LOAD_START(_RamfuncsLoadStart),
        LOAD_SIZE(_RamfuncsLoadSize),
        LOAD_END(_RamfuncsLoadEnd),
        RUN_START(_RamfuncsRunStart),
        RUN_SIZE(_RamfuncsRunSize),
        RUN_END(_RamfuncsRunEnd)


 .cio             : > DATARAM,     PAGE = 1
 .ebss          : { *(.ebss) } > DATARAM,     PAGE = 1
 .esysmem  : > DATARAM,     PAGE = 1

 .stack         : > RAMM1,       PAGE = 2

 .reset         : > RESET,       PAGE = 4, TYPE = DSECT /* not used, */

 ramgs0     : > RAMGS0,    PAGE = 3
 ramgs1     : > RAMGS1,    PAGE = 3

}

  If line { -l F021_API_F28004x_FPU32.lib} within GROUP is commented, the application links and runs fine in a debug session and stand alone. 

  If line { -l F021_API_F28004x_FPU32.lib} within GROUP is NOT commented, the application links fine as well, but only runs on debug (where I verified that functions are well copied to RAM, and the app runs good from the very first code start brach). In stand alone it hangs. I am not too proficient doing debugging on running app maybe you can help me out. I tried to follow other posts procedures without much success.

 I am using the TI controlCARD development board for testing of the application.

  Any idea what may happen?    Thanks in advace and best regards.

  • Peyro,

    If you comment it, Flash API will get loaded to Flash and also gets executed from Flash. Flash API can be executed from one bank to perform erase/program operations on another bank. You should not try to erase/program the bank from which you are executing the Flash API. Hope you are aware of this.

    Before debugging your issue further, I have few questions:
    1) Why did you allocate CODERAM in Page 1 space? Please put it in Page 0 (code space)
    2) Why do you have Page 2, 3 and 4? You can either define memories in page 0 (code) or page 1 (data).

    Please check 28004x_flash_api_lnk.cmd provided at ti\c2000\C2000Ware_1_00_05_00\device_support\f28004x\common\cmd.

    Thanks and regards,
    Vamsi
  • Hello Vamsi, thanks after all for your reply! I split the linker on that way, for me was more clear to have these pages, sorry for that, I reassigned pages as you suggested. Regarding Flash operation, yes I was aware of that, but since this is a bootloader it could potentially perform writes on any bank, depending the application it is loading, this is why I am trying to locate the API on RAM. Here it goes the linker file I am using now (with the same issue, I just tried again):

    MEMORY
    {

    PAGE 0: /* Bootloader code */
    BEGIN : origin = 0x080000, length = 0x000002
    BOOT_VERSION : origin = 0x080002, length = 0x000002
    BOOTLOADER : origin = 0x080004, length = 0x001FFC

    CODERAM : origin = 0x009000, length = 0x001000

    RESET : origin = 0x3FFFC0, length = 0x000002


    PAGE 1: /* Data space */

    DATARAM : origin = 0x008000, length = 0x001000

    RAMM0 : origin = 0x0000F5, length = 0x00030B
    RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */

    RAMGS0 : origin = 0x00C000, length = 0x002000
    RAMGS1 : origin = 0x00E000, length = 0x002000
    RAMGS2 : origin = 0x010000, length = 0x002000
    RAMGS3 : origin = 0x012000, length = 0x002000

    }

    SECTIONS
    {

    codestart : LOAD=BEGIN,PAGE = 0, ALIGN(2)

    BootVersion : LOAD=BOOT_VERSION, PAGE = 0, ALIGN(2)

    .text : LOAD=BOOTLOADER, PAGE = 0, ALIGN(4)
    .cinit : > BOOTLOADER, PAGE = 0, ALIGN(4)
    .pinit : > BOOTLOADER, PAGE = 0, ALIGN(4)
    .switch : > BOOTLOADER, PAGE = 0, ALIGN(4)
    .econst :{ *(.econst) } LOAD= BOOTLOADER, PAGE = 0, ALIGN(4)

    GROUP {
    .TI.ramfunc
    { -l F021_API_F28004x_FPU32.lib}
    }
    LOAD = BOOTLOADER, PAGE = 0,
    RUN = CODERAM, PAGE = 0,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd)

    .cio : > DATARAM, PAGE = 1
    .ebss : { *(.ebss) } > DATARAM, PAGE = 1
    .esysmem : > DATARAM, PAGE = 1

    .stack : > RAMM1, PAGE = 1

    .reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */

    ramgs0 : > RAMGS0, PAGE = 1
    ramgs1 : > RAMGS1, PAGE = 1

    }
  • Hello Vamsi, just to report that I found the issue, it was a silly one :) since Flash_API is near 2K in size, the copy procedure to RAM was taking a little bit longer and watch dog which is enabled by default keeps resetting the uC, I disabled it on the first code start branch. Sorry for bothering you and thanks for support!!