OpenOCD debugging not working on boards with new flash protector

Hi all!
I have several pca10056 boards, some of which are quite old with a serial number < 1000000000. There are boards with higher serial numbers that come with factory-installed flash memory protection. On these new boards, debugging through openocd does not work. When connecting, openocd displays the error message "Error: No J-Link device found." This does not depend on whether I specify the serial number in the config or not. Here is an example of my config:

telnet_port 50002
gdb_port 50000

adapter driver jlink
adapter serial 1050232322
adapter speed 5000
transport select swd

command to start openocd:

openocd -f jlink_test_cfg.cfg 

If I change the adapter serial to 683681827, everything works. As a result, debugging only works on 3 old boards, it doesn't work on a bunch of new boards, I tried on all of them :). I remember for sure that it used to work for me, maybe the issue is with the firmware for J-Link. I also tried using an older version of OpenOCD (0.10.0), but the problem remained the same.

I'm currently using Openocd 0.12.0.
Version jlink SEGGER J-Link Commander V7.92c (Compiled Aug 30 2023 14:58:04).

Is it possible to try old firmware for JLink? If anyone has a similar problem, how did you solve it? I am using OpenOCD because I am unable to attach to the already running board using the J-Link GDB server in VSCode.

  • Yury Morgunov said:
    Is Monitor mode debugging available under license on pca10056?

    I think that the J-Link OB that is included on the DKs does not include a license for monitor mode debugging. On Windows machines, the J-Link driver will allow evaluation of the monitor mode debugging feature if the user accepts a license pop-up. 

    Yury Morgunov said:
    The goal is to completely stop the processor and see the current state

    That should not be a problem with any debugger, but we do not test this and I do not think we support OpenOCD with NCS but it looks like Zephyr does.

Related