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.

TMS320F28075: Secondary bootloader for TMS320F28075

Part Number: TMS320F28075
Other Parts Discussed in Thread: C2000WARE, UNIFLASH

Hello Team,

We are planning to develop secondary bootloader in our project on TMS320F28075. But i am new to bootloader concept.So can anyone please help in below comments.

1.How to load two project files that is secondary bootloader and application file in one flash.

2. As main bootloader will jump to secondary bootoader(Sector A of flash) after bootup and then from secondary bootloader to main application(Rest of the flash except Sector A) jump is required. In this scenario which files of main application  need to be modified like makefile, linker files etc to fit it in to remaining flash. 

3. How to load bin file (chunks of data) in external flash memory.

Please suggest.

  • Hello

    1. Refer to the sci_flash_kernel example in C2000Ware under device_support
    2. Check out the example from #1 and see if that helps.
    3. Check out this: processors.wiki.ti.com/.../External_Flash_Programming_on_C2000

    Best regards
    Chris
  • Hello Chris,

    Thanks for the quick response, i have gone through the example code this example is somewhat useful for our project. but flash_programming_cpu01 is more useful for our project. 

    But i have confusion about linker file modification.

    MEMORY
    {
    PAGE 0: /* Program Memory */
    /* Memory (RAM/FLASH) blocks can be moved to PAGE1 for data allocation */
    /* BEGIN is used for the "boot to Flash" bootloader mode */

    BEGIN : origin = 0x080000, length = 0x000002
    RAMM0 : origin = 0x000122, length = 0x0002DE
    RAMD0 : origin = 0x00B000, length = 0x000800
    RAMLS03 : origin = 0x008000, length = 0x002000
    /* RAMLS1 : origin = 0x008800, length = 0x000800
    RAMLS2 : origin = 0x009000, length = 0x000800
    RAMLS3 : origin = 0x009800, length = 0x000800 */
    RAMLS4 : origin = 0x00A000, length = 0x000800
    RESET : origin = 0x3FFFC0, length = 0x000002

    /* Flash sectors */
    FLASHA : origin = 0x080002, length = 0x001FFE /* on-chip Flash */
    FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */
    FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */
    FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */
    FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */
    FLASHF : origin = 0x090000, length = 0x008000 /* on-chip Flash */
    FLASHG : origin = 0x098000, length = 0x008000 /* on-chip Flash */
    FLASHH : origin = 0x0A0000, length = 0x008000 /* on-chip Flash */
    FLASHI : origin = 0x0A8000, length = 0x008000 /* on-chip Flash */
    FLASHJ : origin = 0x0B0000, length = 0x008000 /* on-chip Flash */
    FLASHK : origin = 0x0B8000, length = 0x002000 /* on-chip Flash */
    FLASHL : origin = 0x0BA000, length = 0x002000 /* on-chip Flash */
    FLASHM : origin = 0x0BC000, length = 0x002000 /* on-chip Flash */
    FLASHN : origin = 0x0BE000, length = 0x002000 /* on-chip Flash */

    PAGE 1 : /* Data Memory */
    /* Memory (RAM/FLASH) blocks can be moved to PAGE0 for program allocation */

    BOOT_RSVD : origin = 0x000002, length = 0x000120 /* Part of M0, BOOT rom will use this for stack */
    RAMM1 : origin = 0x000400, length = 0x000400 /* on-chip RAM block M1 */
    RAMD1 : origin = 0x00B800, length = 0x000800

    RAMLS5 : origin = 0x00A800, length = 0x000800

    RAMGS0 : origin = 0x00C000, length = 0x001000
    RAMGS1 : origin = 0x00D000, length = 0x001000
    RAMGS2 : origin = 0x00E000, length = 0x001000
    RAMGS3 : origin = 0x00F000, length = 0x001000
    RAMGS4 : origin = 0x010000, length = 0x001000
    RAMGS5 : origin = 0x011000, length = 0x001000
    RAMGS6 : origin = 0x012000, length = 0x001000
    RAMGS7 : origin = 0x013000, length = 0x001000
    }


    SECTIONS
    {

    /* Allocate program areas: */
    .cinit : > FLASHD PAGE = 0
    .pinit : > FLASHD, PAGE = 0
    .text : >> FLASHD | FLASHE PAGE = 0
    codestart : > BEGIN PAGE = 0

    #ifdef __TI_COMPILER_VERSION__
    #if __TI_COMPILER_VERSION__ >= 15009000
    GROUP
    {
    .TI.ramfunc
    { -l F021_API_F2837xD_FPU32.lib}

    } LOAD = FLASHD,
    RUN = RAMLS03,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0
    #else
    GROUP
    {
    ramfuncs
    { -l F021_API_F2837xD_FPU32.lib}

    } LOAD = FLASHD,
    RUN = RAMLS03,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0
    #endif
    #endif

    /* Allocate uninitalized data sections: */
    .stack : > RAMM1 PAGE = 1
    .ebss : >> RAMLS5 | RAMGS0 | RAMGS1 PAGE = 1
    .esysmem : > RAMLS5 PAGE = 1

    /* Initalized sections go in Flash */
    .econst : >> FLASHF | FLASHG PAGE = 0
    .switch : > FLASHD PAGE = 0

    Filter_RegsFile : > RAMGS0, PAGE = 1

    SHARERAMGS0 : > RAMGS0, PAGE = 1
    SHARERAMGS1 : > RAMGS1, PAGE = 1

    /* Flash Programming Buffer */
    BufferDataSection : > RAMD1, PAGE = 1, ALIGN(4)

    .reset : > RESET, PAGE = 0, TYPE = DSECT

    }

    In flash_programming_cpu01 i found above linker file, which i am referring in our code also but i am not aware about how to modify linker file.

    mainly Sections part is really confusing, can you please elaborate on that.

    Regards,

    Sandeep

  • Hello

    Here are some resources for understanding the linker:
    processors.wiki.ti.com/.../Linker_Command_File_Primer
    processors.wiki.ti.com/.../C28x_Compiler_-_Understanding_Linking

    Let me if you have a specific question on the linker.

    Best regards
    Chris
  • i am not understanding below part in sections,

    ifdef __TI_COMPILER_VERSION__
    #if __TI_COMPILER_VERSION__ >= 15009000
    GROUP
    {
    .TI.ramfunc
    { -l F021_API_F2837xD_FPU32.lib}

    } LOAD = FLASHD,
    RUN = RAMLS03, 
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0 
    #else
    GROUP
    {
    ramfuncs
    { -l F021_API_F2837xD_FPU32.lib}

    } LOAD = FLASHD,
    RUN = RAMLS03, 
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0 
    #endif
    #endif

    my code is having below declaration in sections which is different than above

    #ifdef __TI_COMPILER_VERSION__
    #if __TI_COMPILER_VERSION__ >= 15009000
    .TI.ramfunc : {}
    LOAD = FLASHD,
    RUN = RAMLS1,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0
    #else
    ramfuncs :LOAD = FLASHD,
    RUN = RAMLS1,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0, ALIGN(4)
    #endif
    #endif

    so what is the difference between above 2 declarations and which one to consider for secondary bootloader.

    Regards,

    Sandeep

  • Hello

    There's a couple aspects to this.
    One is the #if, #else items. This is there purely because of the transition to using the ".TI.ramfunc" naming versus the older "ramfuncs".
    Next it the GROUP for the top one which means both the ramfunc and flash library are going to be loaded to flash but then run from RAM.
    On to the load/run, this is for certain codes that are stored flash but need to be run from RAM.
    What memories it is using (FLASHA, FLASHD, etc) are up to your design. If you are going to be programming to flash during your bootloader, then probably best to start from the top one that's already including the library.

    Best regards
    Chris
  • Thanks Chris, that's really helpful.

    How to load two project files that is secondary bootloader and application file in one flash. Does this possible from ccs debugger.

    is it possible that ccs will erase the required sectors of flash for loading secondary bootloader ? And then same thing will happen during the application code writing on flash ?

    if yes, then is there any setting in ccs to do this?

    Regards,

    Sandeep Chavan

  • Hello

    You can't program two projects. You need to combine them to a single image using the C2000 HEX Utility. See ROMs directive: http://www.ti.com/lit/spru513

    An alternative is to use Uniflash which can program more than one project image.

    Best regards
    Chris