[SOLVED] Stop Debug Session (Shift-F5) leaving CPU halted?

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Stop Debug Session (Shift-F5) leaving CPU halted?

    When I finish a debug session and click "Stop Debug Session" when the CPU is halted, I notice that the CPU continues executing even though CPU is halted in the debugger.

    Is there a way to configure Ozone so that the CPU remains halted when I stop my debug session?

    The post was edited 2 times, last by rbresalier ().

  • Hello,

    Thank you for your inquiry.
    This is expected behaviour as control over the device is only given during the debug session.
    When leaving the debug session we leave the application running to enable setups where you would attach to certain code parts for example, but do not want to impact the applications behaviour after leaving the debug session.

    But for some other cases it might be useful/important to halt after ending the debug session.

    For that we have the exec command SetRestartOnClose. It is unfortunately not documented yet but available for many years now. We will update the documentation accordingly.

    The defaultvalue is =1 and will let the target run after debug stop.
    How to use command strings generally is explained here:
    wiki.segger.com/J-Link_Command…ng_J-Link_Command_Strings

    For Ozone it would be
    Exec.Command("SetRestartOnClose=0");
    to set it to halt after debug stop.

    Please use this option with caution and only if really necessary e.g. where a running target might leave equipment damaged due to broken code or similar. In all other cases we recommend to leave it on default.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Is there a way to make possible the following behavior:

    1) If my target is executing (not halted) while under Ozone control and I end the debug session, the target keeps running.
    2) If my target is halted/suspended while under Ozone control and I end the debug session the target remains halted
  • After some experments I found that indeed setting SetRestartOnClose=0 has the desired behavior from my previous post. If the CPU is running and SetRestartOnClose=0 is set, then when stopping debugging the CPU is still running.
  • Hi ,

    Great to hear that you are up and running again.
    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.