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.

TMS320F2800137: Issue with flash programming using serial boot (SCI_Boot) when booting in SCI boot mode from software itself (not using boot pins)

Part Number: TMS320F2800137
Other Parts Discussed in Thread: C2000WARE

While programming F2800137 using serial flash programmer utility, it works fine when we boot (SCI Boot Mode) the device using boot pins ( GPIO32 and GPIO24)

We are able to program both the files (kernel and the application) properly. execution of the application file is also fine.

But when we boot the device from software itself, i.e. using SCI_Boot(0x01); we face some issue:

1. The device go to sci boot mode successfully

2. Programming of kernel file is also fine and the kernel boots properly.

3. While programming the application file we got following messages 

This seems to be some DCSM related issue, as when we change the the CMD file to use the flash up to sector 31 it works fine but when we use sector 32 and above we get the above message.

when we use sector 32 (address 0x088000) we get ERROR Address: 0x884a0

when we use sector 64 (address 0x090000) we get ERROR Address: 0x904a0

when we use sector 96 (address 0x098000) we get ERROR Address: 0x984a0

I am attaching the files as below for your reference

1. Kernel file used

7536.flash_kernel_ex3_sci_flash_kernel.txt

2. Application txt file (converter using .hex2000 utility)

LED_500.txt

3. cmd file used in the project

1351.cmd.txt
MEMORY
{
   BEGIN            : origin = 0x00080000, length = 0x00000002
   BOOT_RSVD        : origin = 0x00000002, length = 0x00000126

   RAMM0            : origin = 0x00000128, length = 0x000002D8
   RAMM1            : origin = 0x00000400, length = 0x000003F8
   // RAMM1_RSVD       : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

   RAMLS0           : origin = 0x00008000, length = 0x00002000
   RAMLS1           : origin = 0x0000A000, length = 0x00001FF8
   // RAMLS1_RSVD      : origin = 0x0000BFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */

   RESET            : origin = 0x003FFFC0, length = 0x00000002

   /* Flash sectors */
   FLASH_BANK0_SEC_0_7     : origin = 0x080002, length = 0x1FFE  /* on-chip Flash */
   FLASH_BANK0_SEC_8_15    : origin = 0x082000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_16_23   : origin = 0x084000, length = 0x2000  /* on-chip Flash */
   //FLASH_BANK0_SEC_24_31   : origin = 0x086000, length = 0x14000  /* on-chip Flash */
   FLASH_BANK0_SEC_24_31   : origin = 0x086000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_32_39   : origin = 0x088000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_40_47   : origin = 0x08A000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_48_55   : origin = 0x08C000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_56_63   : origin = 0x08E000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_64_71   : origin = 0x090000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_72_79   : origin = 0x092000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_80_87   : origin = 0x094000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_88_95   : origin = 0x096000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_96_103  : origin = 0x098000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_104_111 : origin = 0x09A000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_112_119 : origin = 0x09C000, length = 0x2000  /* on-chip Flash */
   FLASH_BANK0_SEC_120_127 : origin = 0x09E000, length = 0x1FF0  /* on-chip Flash */

   // FLASH_BANK0_SEC_127_RSVD : origin = 0x0A0FF0, length = 0x0010  /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
}

SECTIONS
{
   codestart        : > BEGIN

   .text            : >>  FLASH_BANK0_SEC_24_31 | FLASH_BANK0_SEC_32_39, ALIGN(8)

   .cinit           : > FLASH_BANK0_SEC_0_7, ALIGN(8)
   .switch          : > FLASH_BANK0_SEC_0_7, ALIGN(8)

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

   .stack           : > RAMM1

#if defined(__TI_EABI__)
   .bss             : > RAMLS0
   .bss:output      : > RAMLS0
   .init_array      : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
   .const           : >> FLASH_BANK0_SEC_8_15 | FLASH_BANK0_SEC_16_23, ALIGN(8)
   .data            : > RAMLS0
   .sysmem          : > RAMLS0
  .bss:cio          : > RAMLS0
#else
   .pinit           : >> FLASH_BANK0_SEC_0_7, ALIGN(8)
   .ebss            : > RAMLS0
   .econst          : >> FLASH_BANK0_SEC_32_39, ALIGN(8)
   .esysmem         : > RAMLS0
   .cio             : > RAMLS0
#endif

#if defined(__TI_EABI__)
   .TI.ramfunc      : LOAD = FLASH_BANK0_SEC_0_7,
                      RUN = RAMLS0,
                      LOAD_START(RamfuncsLoadStart),
                      LOAD_SIZE(RamfuncsLoadSize),
                      LOAD_END(RamfuncsLoadEnd),
                      RUN_START(RamfuncsRunStart),
                      RUN_SIZE(RamfuncsRunSize),
                      RUN_END(RamfuncsRunEnd),
                      ALIGN(8)
#else
   .TI.ramfunc      : LOAD = FLASH_BANK0_SEC_0_7,
                      RUN = RAMLS0,
                      LOAD_START(_RamfuncsLoadStart),
                      LOAD_SIZE(_RamfuncsLoadSize),
                      LOAD_END(_RamfuncsLoadEnd),
                      RUN_START(_RamfuncsRunStart),
                      RUN_SIZE(_RamfuncsRunSize),
                      RUN_END(_RamfuncsRunEnd),
                      ALIGN(8)
#endif

    /*  Allocate IQ math areas: */
   IQmath           : > FLASH_BANK0_SEC_8_15, ALIGN(8)
   IQmathTables     : > FLASH_BANK0_SEC_8_15, ALIGN(8)
}

  • When you mention using SCI Boot via SW, are you calling directly into that function in the ROM, or have you used that content to replicate your own SCI Boot in RAM/Flash?  Just want to be sure of the source code here.  The Boot ROM has some initialization it does prior to jumping to the boot mode specified by the pins, I suspect the delta here between that code and when you call into the boot is creating some issues. Let me know how you are implementing in SW and we can look into this further.

    Best,

    Matthew

  • are you calling directly into that function in the ROM

    I am calling directly into the ROM, the SCI_Boot function is located at 0x003fe0c4 in ROM of 2800137, I am branching directly to this address, Below is the steps I am following for this:

    void Enter_Boot_Mode(void){
    int delay_loop=0;
    DINT;
    IER = 0x0000; // Interrupt should be disable before calling the boot loader
    IFR = 0x0000;

    for(delay_loop=0;delay_loop<15;delay_loop++){
    ms(200);
    }

    DisableDog();


    EALLOW;

    ((void (*)())0x003fe0c4)(0x01);    // Boot loader called here

    asm(" LB 0x000000");
    EDIS;
    }

    Few more observations:

    1. After calling SCI_boot function as above, and trying to use "C2prog" instead of "serial_flash_programer" (utility provided with C2000ware) then it works fine

    2. Calling the SCI_boot function at first in main, without doing anything (no clock configuration, no peripheral configuration, nothing) then the programming works fine even with "serial_flash_programer".

    I suspect it is something to do with the initialization to be done before calling the SCI_boot function.

    Can you please help me provide some documents or material to read and find out what kind of initialization, stack pointer re-init or any other thing to be done before calling SCI_boot function