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.

CCS6: How to connect to (and debug) a running program



OS: Windows 10, CCS: 6.1.3

I am writing an Application Loader for the M3 core on an F28M36x part. This Application Loader has a few pertinent responsibilities:

  • Verify that the Application in Flash is correct, or download/update the Application from a server
  • Write some data to a block of RAM
  • Jump to and run the Application

All of this is working:

  • When the Application Loader downloads the Application to Flash, the contents of Flash are EXACTLY the same as if CCS had written the application to Flash
  • My Application's first statement in main() is "while (myValue != 0);" loop, where "myValue" is a volatile integer with a unique value. When the Application Loader jumps to the Application, I can see that it is executing this loop (verified by the current program counter matching the address from the MAP file, and also the value in R0 matches the unique signature for "myValue").
  • When the Application is stepping through the "while (myValue != 0);" loop, I verified that the block of RAM contains the data placed there by my Application Loader.

OK, so we're good so far. The unfortunate problem is that the Application doesn't behave the same as if I had loaded it from the debugger. So I stopped my debugger and reset the ControlCard (the development board). I can see by the LEDs that my Application Loader has jumped to the Application and that the Application is waiting in the "while (myValue != 0);" loop.

Now I want to connect to the system with a debugger and see what's going on. I created a custom "Code Composer Studio - Device Debugging" launch configuration with the following:

Program Tab:
    Load symbols only
Target Tab:
    Program/Memory Load Options
        Disable all breakpoints when loading a different program
        No Verification
        Auto connect if a child connects
        Disable interrupts: When Assembly Stepping, When Source Stepping
        NOTE: "Reset the target on a program load or restart" is NOT CHECKED
        NOTE: "Restart the target on a symbol load as well as a program load" is NOT CHECKED
    Auto Run and Launch Options
        Run to symbol: main
            On a program load or restart
        Connect to the target on debugger startup
        Continue debug launch if target connection or program load fails
    Misc/Other Options
        Automatically load module symbols: Never
        Simulators will flush the pipeline on a halt
        Automatically step over functions without debug...
        Allow software breakpoints to be used
        Synchronize breakpoints and symbols (with like cores)...
    Flash Settings
        OSCCLK: 20
        SPLLIMULT: 12
        SYSDIVSEL: 1 [/2]
        Backup/Restore clock register settings during Flash operations
        Download: Verify Only
        Erase Settings: Selected sectors Only (none selected)
        Enable Verbose Output

But when I launch this, the program counter is at 0x01001572 and my block of memory is zero'd out.

How do I connect to a running program without having RAM cleared and the current Program Counter changed?

  • Hello,
    A few things to consider:

    -If you wish to non-intrusively connect to a running target, also make sure the "Halt the target on a connect" option under the "Target" tab is unchecked. This will allow the debugger to establish a debug connection without halting the target (it will keep it running) and allow you to do real-time debug
    -check your GEL startup file, especially the actions in the OnTargetConnect() callback. See what kind of target access is being done there when the callback is called. You likely do not need a GEL file at all to debug the scenario you describe.

    Thanks
    ki
  • Ki,

    Thank you for the response.

    The "Halt the target on a connect" option is disabled (and unchecked).  I have not figured out any way to affect its setting.

    How do I disable the use of GEL files for this debug session?

    Thanks,
        -- Steve G.

  • The GEL file is defined in the target configuration file. See slide 15 of the below presentation (it is for v5 but the information is the same for v6):
    processors.wiki.ti.com/.../CCS_Modules_Library

    Thanks
    ki