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.

TMS320F280039C: Abort and crash booting SYS/BIOS

Part Number: TMS320F280039C

I have a new board design that has the 280039 processor. It is a derivative product from another that also has a 280039 processor. Some of the pinouts have changed but overall not much. Therefore, we have experience with a working SYS/BIOS on a 280039. However, on this new board SYS/BIOS will crash or go to abort (depending on whether I add some test code or not). I'll focus on the "abort" case for now. When this happens all of the PIEIER registers have been initialized to zero. So, there are no PIE interrupts available. I thought this might be due to an NMI so I created a simple handler for that and added a breakpoint there but it does not hit the breakpoint.

The code path is quite short before the failure. It runs main, starts the first task, and then it's toast. Up to this point, the code is the same as the parent product that it is derived from. It looks to me like something is stepping on the SYS/BIOS memory because what I see in the ROV doesn't make sense for such a small code run. Additionally, this code runs on the parent product. It will crash after close to a minute. But that is to be expected because some of the IO is mapped differently. But the code actually comes up and runs. However, on the derivative system that this is supposed to run on, it doesn't.

When it goes into the "abort" loop, the only interrupt enabled is Int13 and it looks as though the flag is 1. I think this interrupt is setup by the OS for the OS. Is that correct?

See the attached .zip file for screen shots and code snippet.

Any help is appreciated.

TI_forum_boot_issue_1.zip

  • Here are the software components (Products) used in the build:

  • INT13 is CPU Timer 1, so it's probably being used for the SYS/BIOS Clock module tick. You should be able to see it in the Hwis in ROV.

    Are you using the same linker command file as before? Any clocking changes?

    I know you created an NMI handler, but just in case the breakpoint isn't working for some reason, can you check the NMI flags in the Expressions window too?

    Whitney

  • Looking at the linker command file, I'm thinking that maybe the copy-out of the RAM functions is wrecking the SYS/BIOS? I acquired this project from someone else and I always find the command file syntax a little funky. Can someone look at this linker command file and see if the RAM functions "LOAD_START, LOAD_SIZE, and RUN_START" make sense. I this linker command file, those are "declared" (is that the right word) at the bottom of the file with the prefix .TI.ramfunc.

    There is not a lot of ram functions. But there is an assembly routine that has a ram function statement. From the assembly file:

    ; .sect ".text"
    .sect "ramfuncs"
    .newblock

    ... code ...

    ... code ...

    ... etc ...

    From the .map file:

    225   1:ramfuncs 0 0000b439 00000025
    226  61: 0000b439 00000025 AsmRoutines.obj (ramfuncs)
    3178 17:0 000a0cc1 RamfuncsLoadEnd
    3179 17:abs 00000029 RamfuncsLoadSize
    3180 17:0 000a0c98 RamfuncsLoadStart
    3181 17:0 0000b439 RamfuncsRunEnd
    3182 17:abs 00000029 RamfuncsRunSize
    3183 17:0 0000b410 RamfuncsRunStart
    4923 17:0 0000b410 RamfuncsRunStart
    4925 17:0 0000b439 RamfuncsRunEnd
    5364 17:0 000a0c98 RamfuncsLoadStart
    5365 17:0 000a0cc1 RamfuncsLoadEnd
    6499 17:abs 00000029 RamfuncsLoadSize
    6500 17:abs 00000029 RamfuncsRunSize

    The upload won't allow a file with the .cmd extension. So, I am changing the extension to .txt for this upload.

    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 = 0x00000800
       //RAMLS1           : origin = 0x00008800, length = 0x00000800
       //RAMLS2           : origin = 0x00009000, length = 0x00000800
       //RAMLS3           : origin = 0x00009800, length = 0x00000800
       //RAMLS4           : origin = 0x0000A000, length = 0x00000800
       //RAMLS5           : origin = 0x0000A800, length = 0x00000800
       //RAMLS6           : origin = 0x0000B000, length = 0x00000800
       //RAMLS7           : origin = 0x0000B800, length = 0x00000800
    
       RAMGS0           : origin = 0x0000C000, length = 0x00001000
       RAMGS1           : origin = 0x0000D000, length = 0x00001000
       RAMGS23          : origin = 0x0000E000, length = 0x00001FF8
       //RAMGS3           : origin = 0x0000F000, length = 0x00000FF8
       // RAMGS3_RSVD      : origin = 0x0000FFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    
       BOOTROM          : origin = 0x003F8000, length = 0x00007FC0
       SECURE_ROM       : origin = 0x003F2000, length = 0x00006000
    
       RESET            : origin = 0x003FFFC0, length = 0x00000002
    
       /* Flash sectors */
       /* BANK 0 */
    /*   FLASH_BANK0_SEC0  : origin = 0x080002, length = 0x000FFE
       FLASH_BANK0_SEC1  : origin = 0x081000, length = 0x001000
       FLASH_BANK0_SEC2  : origin = 0x082000, length = 0x001000
       FLASH_BANK0_SEC3  : origin = 0x083000, length = 0x001000
       FLASH_BANK0_SEC4  : origin = 0x084000, length = 0x001000
       FLASH_BANK0_SEC5  : origin = 0x085000, length = 0x001000
       FLASH_BANK0_SEC6  : origin = 0x086000, length = 0x001000
       FLASH_BANK0_SEC7  : origin = 0x087000, length = 0x001000
       FLASH_BANK0_SEC8  : origin = 0x088000, length = 0x001000
       FLASH_BANK0_SEC9  : origin = 0x089000, length = 0x001000
       FLASH_BANK0_SEC10 : origin = 0x08A000, length = 0x001000
       FLASH_BANK0_SEC11 : origin = 0x08B000, length = 0x001000
       FLASH_BANK0_SEC12 : origin = 0x08C000, length = 0x001000
       FLASH_BANK0_SEC13 : origin = 0x08D000, length = 0x001000
       FLASH_BANK0_SEC14 : origin = 0x08E000, length = 0x001000
       FLASH_BANK0_SEC15 : origin = 0x08F000, length = 0x001000
    */
       /* BANK 1 */
       FLASH_BANK1_SEC0  : origin = 0x090002, length = 0x000FFE
       FLASH_BANK1_SEC1  : origin = 0x091000, length = 0x001000
       FLASH_BANK1_SEC2  : origin = 0x092000, length = 0x001000
       FLASH_BANK1_SEC3  : origin = 0x093000, length = 0x001000
       //FLASH_BANK1_SEC4  : origin = 0x094000, length = 0x001000
       //FLASH_BANK1_SEC5  : origin = 0x095000, length = 0x001000
       //FLASH_BANK1_SEC6  : origin = 0x096000, length = 0x001000
       //FLASH_BANK1_SEC7  : origin = 0x097000, length = 0x001000
       //FLASH_BANK1_SEC8  : origin = 0x098000, length = 0x001000
       //FLASH_BANK1_SEC9  : origin = 0x099000, length = 0x001000
       //FLASH_BANK1_SEC10 : origin = 0x09A000, length = 0x001000
       //FLASH_BANK1_SEC11 : origin = 0x09B000, length = 0x001000
       //FLASH_BANK1_SEC12 : origin = 0x09C000, length = 0x001000
       //FLASH_BANK1_SEC13 : origin = 0x09D000, length = 0x001000
       //FLASH_BANK1_SEC14 : origin = 0x09E000, length = 0x001000
       //FLASH_BANK1_SEC15 : origin = 0x09F000, length = 0x001000
    
      /* BANK 2 */
       FLASH_BANK2_SEC0  : origin = 0x0A0000, length = 0x001000
       //FLASH_BANK2_SEC1  : origin = 0x0A1000, length = 0x001000
       //FLASH_BANK2_SEC2  : origin = 0x0A2000, length = 0x001000
       //FLASH_BANK2_SEC3  : origin = 0x0A3000, length = 0x001000
       //FLASH_BANK2_SEC4  : origin = 0x0A4000, length = 0x001000
       //FLASH_BANK2_SEC5  : origin = 0x0A5000, length = 0x001000
       //FLASH_BANK2_SEC6  : origin = 0x0A6000, length = 0x001000
       //FLASH_BANK2_SEC7  : origin = 0x0A7000, length = 0x001000
       //FLASH_BANK2_SEC8  : origin = 0x0A8000, length = 0x001000
       //FLASH_BANK2_SEC9  : origin = 0x0A9000, length = 0x001000
       //FLASH_BANK2_SEC10 : origin = 0x0AA000, length = 0x001000
       //FLASH_BANK2_SEC11 : origin = 0x0AB000, length = 0x001000
       //FLASH_BANK2_SEC12 : origin = 0x0AC000, length = 0x001000
       //FLASH_BANK2_SEC13 : origin = 0x0AD000, length = 0x001000
       //FLASH_BANK2_SEC14 : origin = 0x0AE000, length = 0x001000
       //FLASH_BANK2_SEC15 : origin = 0x0AF000, length = 0x000FF0
    
    // FLASH_BANK0_SEC15_RSVD     : origin = 0x0AFFF0, length = 0x000010  /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    	RAMLS01234567           : origin = 0x00008000, length = 0x004000
    	FLASH_B1_4_THRU_15		: origin = 0x094000, length = 0xC000
    	FLASH_B2_1_THRU_15		: origin = 0x0A1000, length = 0xEFE8
    }
    
    
    SECTIONS
    {
       codestart        : > BEGIN, ALIGN(8)
       .text            : >FLASH_B2_1_THRU_15, ALIGN(8)
       .cinit           : > FLASH_BANK1_SEC1,  ALIGN(8)
       .switch          : > FLASH_BANK1_SEC1,  ALIGN(8)
       .reset           : > RESET,                  TYPE = DSECT /* not used, */
    
       .stack           : > RAMGS0,  ALIGN(8)
    
       .data            : > RAMLS01234567 | RAMGS0 | RAMGS1
       DMARAM	    	: > RAMGS23
    
    #if defined(__TI_EABI__)
       .init_array      : > FLASH_BANK1_SEC1,  ALIGN(8)
       .bss             : > RAMLS01234567
    
    
    
       .bss:output      : > RAMLS01234567
       .bss:cio         : > RAMGS1
       .data            : > RAMLS01234567
       .sysmem          : > RAMLS01234567
       .const           : > FLASH_B1_4_THRU_15,  ALIGN(8)
       ramfuncs		: > RAMLS01234567
    #else
       .pinit           : > FLASH_BANK1_SEC1,  ALIGN(8)
       .ebss            : > RAMLS3 | RAMLS4 | RAMLS5 | RAMLS6
       .esysmem         : > RAMGS23
       .cio             : > RAMGS23
       .econst          : > FLASH_B1_4_THRU_15
    #endif
    
        ramgs0 : > RAMGS0
        ramgs1 : > RAMGS0
    
        /*  Allocate IQ math areas: */
       IQmath           : > FLASH_BANK2_SEC0, ALIGN(8)
       IQmathTables     : > FLASH_BANK2_SEC0, ALIGN(8)
    
       .TI.ramfunc      : LOAD = FLASH_BANK2_SEC0,
                          RUN = RAMLS01234567,
                          LOAD_START(RamfuncsLoadStart),
                          LOAD_SIZE(RamfuncsLoadSize),
                          LOAD_END(RamfuncsLoadEnd),
                          RUN_START(RamfuncsRunStart),
                          RUN_SIZE(RamfuncsRunSize),
                          RUN_END(RamfuncsRunEnd),
                          ALIGN(8)
    
    }
    
    
    
    See attached file....

  • That all looks fine to me. Check the SYS/BIOS-generated linker.cmd file too just to make sure it's not conflicting with this one.

    It still doesn't make much sense that the application (exact same .out?) would work on one board and not the other if it was a linker issue though. If they're both F280039, there's no difference in memory.

    Whitney

  • Hi Whitney,

    In the linker command file, how does the line "TI.ramfunc :LOAD = ..." relate to "SECTIONS { ramfuncs :> RAMLS01234567 }"?

    I am stepping through the memcpy for the RAM functions and the addresses seem invalid?

    I don't see any references to establish a relationship in the linker command file between the "LOAD-RUN" entries and the "SECTIONS ramfuncs" entries.

  • That's a good catch. Do you know if your application is using both ramfuncs and .TI.ramfunc? Do you see anything being placed in ramfuncs in your .map file or is it unused?

    Basically, at some point there was a change to the compiler that prompted us to rename our default load-to-Flash-run-from-RAM functions from "ramfuncs" to ".TI.ramfunc" in our examples (you can look up ramfunc in the compiler guide for more info about the feature that was added). If you have some older code that is still using the ramfuncs name though, you will need to make sure it's treated the same way in your .cmd file as .TI.ramfunc. In your case, it's only being allocated to RAM, so there's no mechanism to reinitialize it from Flash.

    If it turns out you need both ramfuncs and .TI.ramfunc, you can do something like below to make sure they're both covered in your memcpy

       GROUP
       {
           .TI.ramfunc
           ramfuncs
    
       } LOAD = FLASH_BANK2_SEC0,
             RUN = RAMLS01234567,
             LOAD_START(RamfuncsLoadStart),
             LOAD_SIZE(RamfuncsLoadSize),
             LOAD_END(RamfuncsLoadEnd),
             RUN_START(RamfuncsRunStart),
             RUN_SIZE(RamfuncsRunSize),
             RUN_END(RamfuncsRunEnd),
             ALIGN(8)

    Whitney

  • Hi Whitney,

    I added the group as you suggested. First, I only put ramfuncs in it because we don't use .TI.ramfunc anywhere. However, I got a link error so  .TI.ramfunc must be used in a TI library. So, I put both in the GROUP like you did in your example.

    Oddly, the address used in the memcpy() did not change. Looking at the memory, the addresses do not seem correct. 

    TI_forum_boot_issue_ramfunc.zip

  • The address didn't change, but did the RamfuncsLoadSize? Looking at the map file how big are ramfuncs and .TI.ramfunc separately.

    When you say the addresses do not seem correct, what do you mean? Their contents don't look correct? They don't match the .map file? I do think the SYS-BIOS_boot_issue_ramfunc_3_to_mem.png screenshot looks a bit weird just given how it's not showing the symbol names for the functions that are supposed to be stored there, but maybe that's because it's code, not data. Does it look different in the Disassembly view instead of the Memory Browser? I assume that screen capture was taken before the copy since it's all still 0s?

    Whitney