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.

Need help: My code only runs when I'm connected through my emulator

Other Parts Discussed in Thread: TMS320F2812

I created a new project for a board that's very similar to another I had previously created.  So I created the new project with my old project as a base.  The chip is the same, (TMS320F2812), and the connections aver very similar.

The project compiles and the code runs and does what I want it to do.

However, it will not run if I reset the CPU or disconnect from the emulator.  It only runs when I'm connected via my emulator immediately following a flash or if I do a Debug: Restart.  Not sure what to look at.  Any ideas?  Thanks in advance.

  • Have you configured your boot pins correctly to boot-to-flash?

    My assumption is that your code is located in flash memory.  You must set your GPIO pins to "boot to Flash" mode in order to execute your code.

    This is because, immediately following a reset, the 28x goes through the boot code first - determines which boot mode to choose via the boot pins - then runs from there. If boot pins are not configured for boot to flash mode, it will go off into the weeds. (Both when you run from Debug->Reset, and when you run with emulator disconnected, boot code will be executed. On the other hand, when you do a Debug->Restart, or load your code, it skips the boot code and immediately starts running your loaded code).

  • Thanks for the reply.

     

    I have the SCITXDA pin, (GPIOF4), pulled high according to the boot mode selection.  I'm not sure what else it could be.  Is there anything else I may not be configuring correctly?

  • It still seems like it has to do with the boot mode. The only reason I can think of for code running when you load in the debugger or pull a Debug-Restart, but NOT working when you pull a Debug->Reset->Run, or unplug the emulator cable is that the boot mode is somehow set incorrectly.

    To debug this, I suggest downloading the boot ROM code below:

    http://www.ti.com/litv/zip/spru095c

    1. Flash your code into your device. Then -
    2. Open f2812_boot_rom.pjt in CCSv3.
    3. Go to File->Load Symbols.->Load Symbols Only Then navigate to boot rom extracted folder /Debug/f2812_boot_rom.out
    4. In SelectMode_Boot.c, insert a hardware breakpoint after the following 2 lines:

      SelectMode_GPIOSelect();
      BootMode = GPIODataRegs.GPFDAT.all & MODE_MASK;

    1. Debug->Reset, then Run until you hit the hardware breakpoint.
    2. Single step through code to determine which boot mode is being entered... to make sure you are booting to Flash.
  • It could be that you've missed moving something into flash that needs to be there.  For example constant data (.const) and switch tables (.switch) need to be in flash.  If your emulator is connected, CCS may load these items into RAM for you.

    Here is an application note that may help:

    Running an Application from Internal Flash Memory on the TMS320F28xx DSP (http://www-s.ti.com/sc/techlit/spra958)

    -Lori

  • I've gone through and done this.  I found that BootMode is 0x101C, (whatever that means)

    Still no luck.  I've gone and used this project on my old board (from which the new project was derived).  I am having the same problem with my old board.  The code will not run on reset or upon power cycling without the emulator.  I think this proves it's not the boot pin setting as this older board works fine with the original  project.

    I've gone through and looked at all the build options carefully between old and new projects and can find no discrepancies.  The DSP281x_Headers_nonBIOS.cmd and F2812.cmd files are identical.  All the project settings are identical as far as I can tell.

     

    Please help, I'm stuck and need to get this done.

     

    Thanks

  • I've found my problem.  Although I had added the CodeStartBranch.asm file to my project, it didn't seem to take.  It worked only after selecting the Source folder from the project window and specifically adding the file to that location.  I find the project window in code composer a little funny sometimes.  I can't seem to add or remove things the way I want.  Problem solved.

    Thanks for the suggestions.