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.

TMS320F280049C: Auto boot from Flash not possible

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Hello,

I am working on a Sys/Bios project (F280049C). I would like to be able to boot from flash in standalone mode. The problem is that the controller does not jump to _c_int00 by itself. I have added the codestart_branch.asm to the project as well as the section definition in the linker.cmd file.

I have to say that it worked once before but after that several changes were made to the project and now the autostart does not work anymore.

Unfortunately I can't find the error.

I have already tried
- an adjustment of the gel file and there I commented out /* Enable NMI */.
- Emulation mode on flash changed during debugging and a CPU reset was done. I would like to explain the procedure briefly:

1. start debugging
2. jump by debugger in main() is done correctly
3. CPU Reset
4. break at address "0x3fb02a" with no debug information available, or outside of program code
5. scripts > EMU Boot Mode Select > EMU_BOOT_FLASH
6. CPU reset
7. jump in main() is done correctly

Shouldn't this work as standalone when I use EMU_BOOT_FLASH to get to the main()?

What is the problem? I can also provide other files from the project.

Regards
Kai

  • Hi Kai,

    Please refer to e2e thread here. It explains all the details required for switching from RAM configuration to Flash configuration.

    e2e.ti.com/.../878674

  • Hi Santosh,

    okay, I think I expressed myself a little bit incomprehensible. I will try to be more precise.

    I don't have a problem understanding what I need more documentation for. The problem is concrete that the program will not start after the boot process.

    If you activate the option "Enable boot from FLASH" in SYS/BIOS - Boot/Startup Options under System Configuration the boot process fails.

    The important thing is, if I include the f2802x_codestartbranch.asm and I tell this in the linker file I have to increase the length of Flash area "BEGIN" by 0x2. This leads me to conclude that the SYS/BIOS itself creates a codestart_branch and apply it to the program if the option "Enable boot from FLASH" is enabled. But apparently this option is not part of different to what I do in my codestart_branch. Because with mine the automatic booting works and with the Sys/Bios it doesn't.

    This is my codestart_branch:

    WD_DISABLE    .set    1        ;set to 1 to disable WD, else set to 0
    
        .ref _c_int00
        .global code_start
    
    ***********************************************************************
    * Function: codestart section
    *
    * Description: Branch to code starting point
    ***********************************************************************
    
        .sect "codestart"
    
    code_start:
        .if WD_DISABLE == 1
            LB wd_disable       ;Branch to watchdog disable code
        .else
            LB _c_int00         ;Branch to start of boot.asm in RTS library
        .endif
    
    ;end codestart section
    
    ***********************************************************************
    * Function: wd_disable
    *
    * Description: Disables the watchdog timer
    ***********************************************************************
        .if WD_DISABLE == 1
    
        .text
    wd_disable:
        SETC OBJMODE        ;Set OBJMODE for 28x object code
        EALLOW              ;Enable EALLOW protected register access
        MOVZ DP, #7029h>>6  ;Set data page for WDCR register
        MOV @7029h, #0068h  ;Set WDDIS bit in WDCR to disable WD
        EDIS                ;Disable EALLOW protected register access
        LB _c_int00         ;Branch to start of boot.asm in RTS library
    
        .endif
    
    ;end wd_disable
    
        .end

    How can you see what the SYS/BIOS has created or used?

  • I did not get a chance to look into this today. I will get back to it tomorrow.

  • Santosh,

    excuse me, but are there already statements about this?

    Regards
    Kai

  • Yes, SYS/BIOS will create an equivalent code start function. You can try opening the .map file that gets generated when you build with the SYS/BIOS Boot module enabled and see if it's being placed correctly at the flash entry address (BEGIN). Can you show me what settings you've used for the Boot module?

    Whitney

  • These are the settings I made when the FLASH option is disabled. Then I use my codestartbranch function shown above. Otherwise I have activated the two yellow marked options. My codestartbranch is excluded for the compiler. Below I show the two .map files.

    .map file with Sys/Bios codestartbranch config:

    ******************************************************************************
                 TMS320C2000 Linker PC v20.2.1                     
    ******************************************************************************
    >> Linked Tue Oct 27 17:33:20 2020
    
    OUTPUT FILE NAME:   <HVA_RTOS.out>
    ENTRY POINT SYMBOL: "_c_int00"  address: 00081ef7
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      D01SARAM              0000b000   00001000  00000000  00001000  RWIX
      BEGIN                 00080000   00000002  00000002  00000000  RWIX
      FLASHA                00080002   0000fffe  00006580  00009a7e  RWIX
      FLASHB                00090000   00010000  00000000  00010000  RWIX
      RESET                 003fffc0   00000002  00000000  00000002  RWIX
    
    PAGE 1:
      BOOT_RSVD             00000002   00000120  00000000  00000120  RWIX
      M01SARAM              00000122   000006de  0000018a  00000554  RWIX
      LS05SARAM             00008000   00003000  000020e0  00000f20  RWIX
      RAMGS0                0000c000   00002000  00000000  00002000  RWIX
      RAMGS1                0000e000   00002000  00000000  00002000  RWIX
      RAMGS2                00010000   00002000  00000000  00002000  RWIX
      RAMGS3                00012000   00002000  00000000  00002000  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    .ti_catalog_c2800_initF2837x_begin 
    *          0    00080000    00000002     
                      00080000    00000002     Boot.a28FP : Boot_asm.o28FP (.ti_catalog_c2800_initF2837x_begin)
    
    .cinit     0    00085ebc    000006a1     
    .....

    And the .map file with my codestart

    ******************************************************************************
                 TMS320C2000 Linker PC v20.2.1                     
    ******************************************************************************
    >> Linked Tue Oct 27 17:29:37 2020
    
    OUTPUT FILE NAME:   <HVA_RTOS.out>
    ENTRY POINT SYMBOL: "_c_int00"  address: 00081ef7
    
    
    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
    PAGE 0:
      D01SARAM              0000b000   00001000  00000000  00001000  RWIX
      BEGIN                 00080000   00000002  00000002  00000000  RWIX
      FLASHA                00080002   0000fffe  0000657e  00009a80  RWIX
      FLASHB                00090000   00010000  00000000  00010000  RWIX
      RESET                 003fffc0   00000002  00000000  00000002  RWIX
    
    PAGE 1:
      BOOT_RSVD             00000002   00000120  00000000  00000120  RWIX
      M01SARAM              00000122   000006de  0000018a  00000554  RWIX
      LS05SARAM             00008000   00003000  000020e0  00000f20  RWIX
      RAMGS0                0000c000   00002000  00000000  00002000  RWIX
      RAMGS1                0000e000   00002000  00000000  00002000  RWIX
      RAMGS2                00010000   00002000  00000000  00002000  RWIX
      RAMGS3                00012000   00002000  00000000  00002000  RWIX
    
    
    SECTION ALLOCATION MAP
    
     output                                  attributes/
    section   page    origin      length       input sections
    --------  ----  ----------  ----------   ----------------
    codestart 
    *          0    00080000    00000002     
                      00080000    00000002     f2802x_codestartbranch.obj (codestart)
    
    .TI.ramfunc 
    *          0    0008002d    00000004     RUN ADDR = 00009fbd
                      0008002d    00000004     sysctl.obj (.TI.ramfunc)
    
    .cinit     0    00085eba    000006a1     
    .....

  • Okay, good to know that BEGIN is at least populated with the init function. Can you also double check the boot mode selection pins on your board to make sure they are set to Flash boot?

    One thing that can be helpful in debugging standalone boot issues like this is to power cycle the board and then connect to it in CCS using a .ccxml file that has the GEL file removed. Without the GEL file, it won't do a reset upon connecting and so the state of the PC will be preserved. You can then load symbols and see where it has gotten stuck.

    Whitney

  • I can assure you that the pin configuration is correct. As already mentioned the program starts correctly when using the codestart_branch shown above.

    I have deleted the .gel file in the .ccxml file. But then a default folder will be selected automatically. Anyway, the controller seems to reset when I connect to the target. At this point I can't get anywhere without further help from Texas Instruments because I don't have access to the assembler code that is called in the codestart_branch generated by the sys/bios.

  • It's okay that it repopulated the "Initialization script" field--it's still not pointing to a .gel file so that's what we wanted. The reset it's referring to isn't necessarily one caused by the debugger connection.

    When you hit the suspend button, where does it halt? If the address appears to be where your application is, load the symbols for your .out. If it appears to be in boot ROM, load the symbols for it (they're in C2000Ware\libraries\boot_rom\f28004x\revB\rom_sources\ccs_files\cpu\Release).

    The code generated by SYS/BIOS can be found in the build folder in your CCS project in a directory called configPkg if you want to look at it. The ti_catalog_c2800_initF2837x_Boot_init function in app_p28FP.c is probably most of interest in this case. If you're specifically looking for that ti_catalog_c2800_initF2837x_begin section, you can see it in SYS/BIOS in \packages\ti\catalog\c2800\initF2837x\Boot_asm.s28.

    I'm wondering if the watchdog disable isn't happening soon enough. If you add a watchdog disable to Boot_asm.s28 like there is in your other code start file, does it boot?

    Whitney

  • I have looked at the function once. I cannot see the similar codestart_branch in it. Where is it executed?

    >>>> I'm wondering if the watchdog disable isn't happening soon enough. If you add a watchdog disable to Boot_asm.s28 like there is in your other code start file, does it boot? <<<<

    I will try to test that. Unfortunately I'm currently busy with other topics but I'll try as soon as possible.

  • There's some explanation of the boot flow here:

    That init function is called by xdc_runtime_Startup_reset__I (also in that same file) which is called as part of _c_int00 (see \packages\ti\targets\rts2800\boot_cg.asm).

    Let me know when you've had a chance to try power cycling, connecting (without the GEL file), and halting the CPU. Seeing where it's getting stuck when it fails to boot is should be helpful in identifying what is going wrong.

    Whitney