This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Software breakpoints with J-Link probe

Hi,

I am not able to make software breakpoints working with a Segger J-Link probe.

As an exemple, here is my assert callback function:

void __attribute__((noreturn)) __assert_func(const char *file, int line, const char *func, const char *failedexpr) {
  asm volatile("bkpt");
  abort();
}

My program should be stopped automatically when entering any assert function. In general, I would like to stop the execution of my program using the asm volatile("bkpt") instruction.

Using an ST-Link v2 probe, the code above works. Unfortunately, it doesn't work with a Segger J-Link probe. Any experience with this ? Is any specific configuration require to make this working ?

Note: I use the latest available J-Link firmware "SEGGER J-Link Lite-Cortex-M V8.00" with SEGGER J-Link V5.12 software.

  • SEGGER J-Link GDB Server V5.12e Command Line Version JLinkARM.dll V5.12e (DLL compiled Apr 29 2016 15:03:58)

    Target device:                 nRF51822_xxAA
    Target interface:              SWD
    Target interface speed:        1000kHz
    
    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link Lite-Cortex-M V8 compiled Aug 20 2015 17:57:19
    Hardware: V8.00
    S/N: *****
    Feature(s): GDB
    
  • Hi Metch,

    here is the debugger and start up tab, I also tested with Jlink Lite and PCA10040 v0.9.0.

    image description

    image description

  • @hungbui, thanks for you answer. It still doesn't work on my side... I use the SEGGER J-Link GDB Server V5.12e version, I will try with the same version as you.

    Any custom settings in the "GDB client setup" and "Run/Restart Commands" ? I cannot see the configuration you use in the bottom of each images.

  • @metch: no, no modification from default setting:

    image description

    image description

  • I cannot make this running correctly :( The processor does not halt on the software breakpoint. I program an .elf file instead of an .out file. This is the only difference I see. I use the maximum (-g3) debug level when compiling. Maybe do you use nay other debug flags ? Could you please give me some information about the tools and version use use ? Segger tools, Eclipse, GCC/GDB and debug probe ?

Related