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.

CCS/msp430FR5739: I would like to know if there is a way to know from within your code that the code is running under a code composer debug session

Part Number: MSP430FR5739

Tool/software: Code Composer Studio

I have written some code that needs to take a different path when running under the debugger compared to when it is free running.

Is there any way to do this? Maybe writing some RAM location as part of the initialization or something along those lines....

  • Roger,

    I suppose you could have the GEL setup script for the debugger write to a RAM location like you suggested.

    If you launch a debug session. Then go to Tools -> GEL Files on the menu. This will show you the GEL files that are being loaded. Double click on the startup file to edit it. You could add something to the OnTargetConnect() function to write to an address.

    Something like this:


    OnTargetConnect()
    {
    *0x20000000 = 0x8000;

    }

    Regards,
    John
  • Thanks for the input.

    Perhaps I should expand a bit. I am using Code Composer Studio and programming a MSP430. Was not able to map your suggestion to anything in the GUI.

  • This is possible on MSP430.  I found an FR5739 and gave it a try this morning.  Looks like there is no default GEL file for this device so there are a few extra steps.

    Lets start by creating a GEL file.

    Then we need to specify that this GEL file is our startup script. By editing our target configuration.

    Now launch the debugger.

    You can open the memory browser and see that value was written to the address.

    You can see which GEL files are loaded by going to:

    Normally there is a file loaded by default so you can just go there and double click on the file to open it and edit it.  If you make changes to a file that is loaded you need to right click on it and select reload.

    There are more details on GEL in the help as well as here:

    http://processors.wiki.ti.com/index.php/GEL

    Regards,

    John

  • John, Outstanding! Worked like a champ. Thanks.