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.

_F28x_usDelay works in Debug mode but not in Release mode

Other Parts Discussed in Thread: CONTROLSUITE

_F28x_usDelay works in Debug mode but not in Release mode.

I am using the F2837xD source files in controlSUITE and an example project.

In F2837xD_Examples.h there is a DELAY_US defined and I am using that in the main code.

In release mode when the software gets to the delay assembly function (F2837xD_usDelay.asm) the debugger stops and says "No source available for 0x3fe493" and the disassembly shows a "ESTOP0" assembly command. The program works up to the delay assembly code.

I looked closer and there is a C2000 assembly command SB called with a zero offset and a conditional code of unconditional. I think this means the same as while(1) in c code. Isnt it branching to the same line forever? 

Is there a workaround? I just need a delay function without creating it myself. Thanks.

  • which controlSuite example you are looking at? are you building the flash configuration for stand-alone run? the delay function has to be run from RAM so it needs to be relocated at runtime from flash to RAM and the RAM FUNCS placement and run time memcpy from main takes care of this. The flash configuration build enables all of this.

    .def _F28x_usDelay
    .sect "ramfuncs"

    Hope it helps.

    Best Regards
    Santosh Athuru
  • How do I configure the release configuration for a stand-alone run?
  • right click on the project name in the CCS, go to build configurations and set active menu, there you should see the build options for the project.

    Best Regards

    Santosh Athuru

  • Thanks, I dont see which build option it is. Ive tried looking through all of them.
  • which example from controLSuite  are you looking at? below might help.

    Best regards

    Santosh Athuru

  • I know how to choose between the Release and Debug, and the code you show is the code I am using for the delay function. If you choose the properties on that menu shown (in your picture) then there is a bunch of options under the Build menu. Has C2000 Compiler, C2000 Linker, and each has a bunch of menu items. How do I use this to make the program copy itself from FLASH to RAM and run off RAM after booting up?
  • Jason,
    if you look at the InitSysCtrl called from main() in the blinky_cpu01 example, it has below code that copies the RAM FUNCS from Flash to RAM. The linker command file linked in the FLASH build takes care of the LOAD/RUN sections of the RMAFUNCS.

    #ifdef _FLASH
    // Copy time critical code and Flash setup code to RAM
    // This includes the following functions: InitFlash();
    // The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart
    // symbols are created by the linker. Refer to the device .cmd file.
    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    // Call Flash Initialization to setup flash waitstates
    // This function must reside in RAM
    InitFlash();
    #endif


    Best Regards
    Santosh
  • That has been a part of the build. If this puts it into ram then why wouldnt it still work?
    I used a work around so that I dont use this funtion. Thanks