How to attach to running target w/o reset from Linux JLinkGDBServer

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

  • How to attach to running target w/o reset from Linux JLinkGDBServer

    Hello,

    I am trying to work through the process of gdb + JLinkGDBServer attaching to a running device without invoking a reset on the device.
    Some environmental info:
    Ubuntu 11.04 Linux,
    arm-none-eabi-gdb V7.4.40,
    JLinkGDBServer V4.58 (JTAG, not SWD)
    target system is STM32L151 Cortex-M3

    I have tried starting JLinkGDBServer with the -noreset option but it appears not to work, at least on ubuntu linux.
    The target get a reset regardless of the -noreset option.

    Note: I have tried this with OpenOCD built for JLink support and it works (e.g. no reset).
    The significant difference is that OpenOCD, by default, does not do any resets at connect time, where as JLinkGDBServer (per docs) does a reset unless the -noreset option is specified.
    Most of developers in our shop use JLinkGDBServer, so I would prefer staying with JLinkGDBServer rather that trying to get them switched to OpenOCD.

    Can someone give detailed directions as to how (in particular from Linux) to attach to a running Cortex-M3 system?
    It would be much appreciated.

    Thanks
  • Hi,

    I just checked it again:
    The current GDBServer does not perform a reset of the target at startup by default.
    The doc is a bit outdated there because old/very old versions of the GDBServer always performed a reset of the target at startup.

    The only cases under which a reset of the target is performed:
    1) "monitor reset" is executed
    2) GDB sends a 'k', 'r' or 'R' packet which are packets that are used for (k)ill, (r)eset or (R)estart. These packets are used by some GDB based IDEs to provide a reset button etc. in the IDE.
    3) If attaching to the target is not possible which can happen for example if the target is in a low-power mode which disables the debug interface etc.
    If J-Link knows the device (if the device has been selected in GDBServer at startup via command line) and so can perform a special connect in such cases, it is possible that a reset is performed.


    Best regards
    Alex
    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.