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.

TMS320F280049: SYSBIOS boot from FLASH F280049

Part Number: TMS320F280049
Other Parts Discussed in Thread: SYSBIOS

Hi,

My last nemesis on this project and I know this question has been posed a number of times, I just can't seem to track down the answer. I have a SYSBIOS project that I am running on custom hardware, that I cannot get to boot from FLASH in standalone mode. The code runs fine using the emulator. I have compiled the blinky code and programmed that onto the board and that boots in standalone mode and runs. So from that exercise I will assume that this is not a hardware issue and must be a SYSBIOS cfg issue or link cmd file issue. Here is my boot/startup options:-

  

and here is my cmd file:-


MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to Flash" bootloader mode */

BEGIN : origin = 0x080000, length = 0x000002
RAMM0 : origin = 0x0000F5, length = 0x00030B

RAMLS0 : origin = 0x008000, length = 0x000800
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 */
/* BANK 0 */
FLASH_BANK0_SEC0 : origin = 0x080002, length = 0x000FFE /* on-chip Flash */
/*FLASH_BANK0_SEC1 : origin = 0x081000, length = 0x001000*/ /* on-chip Flash */
FLASH_BANK0_SEC2 : origin = 0x082000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC3 : origin = 0x083000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC4 : origin = 0x084000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC5 : origin = 0x085000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC6 : origin = 0x086000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC7 : origin = 0x087000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC8 : origin = 0x088000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC9 : origin = 0x089000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC10 : origin = 0x08A000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC11 : origin = 0x08B000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC12 : origin = 0x08C000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC13 : origin = 0x08D000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC14 : origin = 0x08E000, length = 0x001000 /* on-chip Flash */
FLASH_BANK0_SEC15 : origin = 0x08F000, length = 0x001000 /* on-chip Flash */

/* BANK 1 */
FLASH_BANK1_SEC0 : origin = 0x090000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC1 : origin = 0x091000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC2 : origin = 0x092000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC3 : origin = 0x093000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC4 : origin = 0x094000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC5 : origin = 0x095000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC6 : origin = 0x096000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC7 : origin = 0x097000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC8 : origin = 0x098000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC9 : origin = 0x099000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC10 : origin = 0x09A000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC11 : origin = 0x09B000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC12 : origin = 0x09C000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC13 : origin = 0x09D000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC14 : origin = 0x09E000, length = 0x001000 /* on-chip Flash */
FLASH_BANK1_SEC15 : origin = 0x09F000, length = 0x001000 /* on-chip Flash */

PAGE 1 :

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

RAMLS5 : origin = 0x00A800, length = 0x000800
RAMLS6 : origin = 0x00B000, length = 0x000800
RAMLS7 : origin = 0x00B800, length = 0x000800

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


SECTIONS
{
codestart : > BEGIN, PAGE = 0, ALIGN(4)
.text : >>FLASH_BANK0_SEC3 | FLASH_BANK0_SEC4 | FLASH_BANK0_SEC5 | FLASH_BANK0_SEC6, PAGE = 0, ALIGN(4)
.cinit : > FLASH_BANK0_SEC2, PAGE = 0, ALIGN(4)
.switch : > FLASH_BANK0_SEC2, PAGE = 0, ALIGN(4)
.reset : > RESET, PAGE = 0, TYPE = DSECT /* not used, */

.stack : > RAMM1, PAGE = 1

.init_array : > FLASH_BANK0_SEC2, PAGE = 0, ALIGN(4)
.bss : > RAMLS5, PAGE = 1
.bss:output : > RAMLS3, PAGE = 0
.bss:cio : > RAMLS0, PAGE = 0
.data : > RAMLS5 | RAMLS6, PAGE = 1
.sysmem : >> RAMLS5, PAGE = 1

/* Initalized sections go in Flash */
.const : > FLASH_BANK0_SEC4, PAGE = 0, ALIGN(4)

ramgs0 : > RAMGS0, PAGE = 1
ramgs1 : > RAMGS1, PAGE = 1
ramm0 : > RAMM0, PAGE = 0

.TI.ramfunc : LOAD = FLASH_BANK0_SEC1,
RUN = RAMLS0 | RAMLS1 | RAMLS2 |RAMLS3,
LOAD_START(RamfuncsLoadStart),
LOAD_SIZE(RamfuncsLoadSize),
LOAD_END(RamfuncsLoadEnd),
RUN_START(RamfuncsRunStart),
RUN_SIZE(RamfuncsRunSize),
RUN_END(RamfuncsRunEnd),
PAGE = 0, ALIGN(4)
}

Any help would be appreciated.

Thank you,

Richard. 

  • That all seems fine. If you look at your .map file, can you see the SYS/BIOS boot function in BEGIN?

    One thing that's sometimes helpful when debugging flash boot issues is to connect to the device after it boots from flash in a way that prevents CCS from resetting the device. That way you can hopefully see what kind of state it's in when it gets stuck. There's a nice video on how to do it here. Alternatively I sometimes create a copy of my .ccxml with the gel file removed and launch using that instead and then load the symbols for my .out.

    Whitney

  • Hi Whitney,

    This is what I have at 0x80000 in the FLASH,

    * 0 00080000 00000002
    00080000 00000002 Boot.a28FP : Boot_asm.o28FP (.ti_catalog_c2800_initF2837x_begin)

    I did debug the code by only loading the symbols and in Startup_exec it appears that when Startup_execImpl is called the address is 0x00000000:- 

    Void Startup_exec(Void)
    {
    Int i;

    if (module->execFlag == FALSE) {
    module->execFlag = TRUE;

    for (i = 0; i < Startup_firstFxns.length; i++) {
    /* REQ_TAG(SYSBIOS-955) */
    Startup_firstFxns.elem[i]();
    }

    (Startup_execImpl)();

    for (i = 0; i < Startup_lastFxns.length; i++) {
    /* REQ_TAG(SYSBIOS-956) */
    Startup_lastFxns.elem[i]();
    }
    }
    }

    Thanks,

    Richard.

  • What do you mean the address is 0x00000000? Like assembly single stepping the code into Startup_exeImpl() causes program counter to jump to 0x00000000?

    Have you specified any of your own custom "firstFxns" or "lastFxns" or is it just the SYS/BIOS generated ones that are running?

    Whitney

  • Whitney,

    When that call is made XAR7 contains 0x00000000. I have not defined any of my own startup functions. My gut feeling is that something is not being setup correctly, but this will require more time to track down then I currently have available. For the time being I have re-written the code without using SYSBIOS and this works. If anyone can point me to a SYSBIOS example that boots from FLASH on a F280049 I would be grateful.

     Thanks,

    Richard.

  • Okay, when I tried it (on an F2838x device), I could step into Startup_exeImpl() and see it go to xdc_runtime_Startup_exec__I() which was stored at a normal flash address. It got to main() fine from there. I'll try it out with an F280049 example in a bit.

    Whitney