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.

[FAQ] F05 Flash: How can I debug code that does not run standalone without Code Composer Studio attached?

Other Parts Discussed in Thread: TMS320F2812

Q: My program runs correctly when debugging within Code Composer Studio, but when I attempt to run this standalone it does not work. Why is this occurring? 

  • A:

    Note: This answer applies to devices with F05 flash.  Refer to:  [FAQ] F05 Flash: Which C2000 devices have "F05 flash"?

    A: This can occur for a few different reasons:

    1. The boot mode selection is not "jump to flash". Check the boot ROM guide and data manual for the particular device.
    2. There are initialized sections allocated to load to RAM instead of flash. All initialized sections should have their load addresses allocated to flash so they can be programmed. Check the linker command file (.cmd) and the .map file to confirm all initialized sections are assigned to flash. Section 3 of the Running an Application from Internal Flash Memory on the TMS320F28xx DSP(SPRA958) App. Note explains where each compiler generated section should be allocated.
    3. If the code is time-critical and needs to be run from RAM, then it can be copied at runtime. SPRA958 explains how to copy the code.
    4. After you copy critical sections to RAM, make sure the copy really occurred - check the memory contents and disassembly window.
    5. Try running the flash to RAM copy routine first. Some functions may assume code has already been copied to RAM. For example, the delay function is used in the InitSysCtrl() function. This delay function is, by default, allocated to the functions TI's examples copy to RAM. If InitSysCtrl() is called before the copy to RAM then an exception will occur. This also occurs with InitAdc() if it is called before the copy function.
    6. An instruction was not added to branch to the beginning of application code at the flash entry point. This is discussed further in SPRA958.
    7. TMS320F2812 specific: In addition to the actual boot pins, the MP/MC pin needs to be pulled low to enable the boot ROM.

    To debug this issue, step through the code and try to determine where it is going wrong. Here are some debug suggestions:

    1. Flash the device
    2. Turn off the power
    3. Connect CCS and select "load symbols" only
    4. Place a breakpoint at the entry point to flash
    5. Reset the part with the debugger and run - did you hit the breakpoint? If so the boot mode looks ok
    6. Step the code until you find an issue.