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.

How to attach from CCS5 to a running program

Hello,

I am trying to attach to a running program on an MSP430. I manage to halt the program from gdb, but I would like to attach from CCS to it and modify different variables.

Is it possible?

Ideally I would like CCS just to attach to the MCU without reseting it.

Thank you.

Best regards,

Cristian

  • Hi Cristian,

    Do you mean to say "modify variables" as in Modify watch expressions from the watch window during debugging?

    Regards,

    Gautam

  • Hello Gautam,

    Yes. Is it possible?

    The idea is that by variating inputs I get my program in a given state and from there I want to make a manual debugging.

    Thank you,

    Cristian

  • Yes, you can add the variables from the code to the watch window during the debug session. These watch expressions can be modified to observe respective output.

    Regards,

    Gautam

  • I know that one can do that. What I am not able to do is to prevent CCS from reseting the MCU and the program running on it.

    Is this possible?

    Thank you,

    Cristian

  • Yes, that's exactly what I'm trying to convey. While the code is running; you can change the value without resetting the MCU.

    Regards,

    Gautam 

  • Yes, you can do that. But my point is that I want to attach to a running program without restarting it.

    How can I do this?

    Thank you,

    Cristian

  • Can you further clarify by what do mean by :

      I want to attach to a running program without restarting it.

     ??


    Regards,

    Gautam

  • A program runs on the MCU. I want to connect to the MCU without loading another program and without interfeering with the corresponding state of the program.

    Is this more clear?

    Thank you,

    Cristian

  • Ok, now I understood 75% of your statement! Now, what do you want to connect to MCU???

      I want to connect to the MCU

    What do you mean by that?

    Try to be crystal clear on about what you want to achieve! Your problem statement is like a maze.

    Regards,

    Gautam


  • What I need is to be able to debug a running program. I DO NOT want to have the debugger upload or reset the program.

    Thank you,

    Cristian

  • Sorry Cristian, you can't do that!

    Brief info:  When a code is running and if you need to enter into debug mode then -> CCS will stop the code that is running -> will program the mcu with the latest code -> finally debug it! 

    Hope this clears your doubt.

    Regards,

    Gautam

  • Thank you Gautam for your fast replies.

    So if I get it right, I can not do avoid having CCS program the MCU before starting debugging. If this is the case, it is a pitty as with gdb this kind of behaviour is possible.

    Thank you again.

    Best,

    Cristian

  • Yes you're right!

    No prob, always here to help.

    Regards,

    Gautam

  • Cristian,

    Cristian Arfire said:

    So if I get it right, I can not do avoid having CCS program the MCU before starting debugging. If this is the case, it is a pitty as with gdb this kind of behaviour is possible.

    Yes, this is entirely possible - check the information below copied from another post of mine, which also includes an explanation of the "green bug" button functionality.

    another thread said:

    When you say "Debug Run" you mean the green bug button at the top toolbar? If so, this button executes a series of steps at once: it builds the active project, launches the debugger using the Active Debug configuration, connects to the target core, loads the code and then runs to main().

    In this case, to try and pinpoint the exact place the problem is occurring, can you ask your customer to manually launch the debugger and connect to the core?

    To do that, simply open the Target Configurations view (menu View --> Target Configurations), right-click on the .ccxml file and select Launch selected configuration. After the debugger launches, you can right-click on the core and select Connect. Once the core finishes executing its initialization GEL script, you can load the code by going to menu Run --> Load --> Load Program.

    Obviously that you would not do the last step (load the code itself).

    For additional insights regarding active and default configurations, check here (not entirely related to this thread, but I thought it may save you from confusion in the long run).

    Hope this helps,

    Rafael