[SOLVED] How to keep debug connection alive between sleep cycles?

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

  • [SOLVED] How to keep debug connection alive between sleep cycles?

    Hi guys,

    We ship eval boards with our device "RSL10" from ON Semiconductor, which uses OB J-Link.
    We can debug the device just fine but we have trouble with applications that use sleep mode. Whenever the debugger detects the device is sleeping, it throw errors and closes the debug connection.
    I don't think the device support any kind of special low power mode debugging (no debug port clocks are active).

    So, we don't expect to be able to do anything while the device is asleep.

    The only thing we want is to be able to keep the debug connection alive, such that a breakpoint is hit next time the device wakes up. Is this possible?

    So far, we use a workaround when we want to debug the device state after waking up from sleep:
    1. Add an infinite loop trap in the part of the code that's run only after waking up from sleep
    2. Start a normal debug session that loads the code and let the target run.
    3. The debug connection is lost as soon as the device enter sleep mode, so we close the current debug session
    4. Open a new debug session that "re-attaches" to the running target (remove target reset, load of code or anything special from settings)
    5. Now, we can pause the debugger and see that our device is trapped in the infinite loop added in Step 1

    This is not ideal, as it's inconvenient and requires us to change the code.

    Is there anything else we can do to keep the debug connection alive?
    Maybe restore/retain some memory or debug registers?
    Maybe retain the GPIO pads connected to SWD?
    How does J-Link detects a disconnection? Just by detecting a read memory failure?

    We tried enabling low power mode in the J-Link DLL (wiki.segger.com/Generic_IDE#Low_power_debugging) but it did not work for us.

    Any help is appreciated.

    Best regards,
    Sergio.
  • Hello Sergio,

    Sorry for the delay in response.
    As this forum is not a support forum I created a new support request in our official support channel. You should receive an answer to your question shortly.
    For future inquiries we recommend using our official support channel. More information can be found in my signature.

    To avoid double information in different channels this thread will be closed 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.