"Bricking" a custom board by unplugging SWD debugger mid-session?

Hey guys.

I'm having a weird issue. I'm using a custom PCB with NRF52810 and S112 soft device, which has tag-connect connector for SWD debugger and it does not click into place, so it happens sometimes that connection is cut during debugging session. 

After N sessions, board stops responding. I have 4 different boards infront of me, all of them used to work, and then suddenly stoppe. I keep getting that: Unsupported device. The detected device could not be recognized as neither JLink device nor Nordic USB device.

The code seems to still run on the IC, but I cannot connect to it anymore.

I tried using command tools to recover board and I keep getting the same error. It seems that board just does not respond.

There was one instance of a different error, where I tried connecting to the board via NRF Connect programmer and got the message that memory is protected (I did not activate this..). But when I restarted the tool, I got the first message again (unsupported device).

So my question would be, is it possible that this happens because of random connection cut while debugging? Or could there be something else?

Any help would be greatly appreciated as I have only one board left.

command line log:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
C:\Program Files (x86)\Nordic Semiconductor\nrf-command-line-tools\bin>nrfjprog --recover
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
ERROR: Unable to connect to a debugger.[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
[error] [SeggerBackend] - JLinkARM.dll reported "-1", "An unknown error.".
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thanks!

Kristjan

Parents
  • Let me expand on this:

    When I encountered these issues, I was using SEGGER J-link.

    I fixed the problem (for a day) by using NRF DK as Jlink. This seemed to work, until about an hour ago, when the same issues began happening again. I must have reprogramed the board at least 50 times and then suddenly it stops responding. However, the processor still runs as I can connect to it with BLE.

  • Hi,

     

    Which version of nrfjprog and jlink are you using? 

    You can download the latest here: https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download

     

    kristjanb said:
    However, the processor still runs as I can connect to it with BLE.

    Thank you for this info, this effectively rules out any assertion loops (ie. reset loops) in the firmware.

    Do you see this behavior on one board only, or is it several ?

     

    Kind regards,

    Håkon

  • Could you share the generated .log file?

    Which device are you using?

    Which debugger/programmer is being used?

     

    Kind regards,

    Håkon

  • The log file looks identical as that shown in the original post by Kristjan so I have not included it.

    I'm using a J-Link LITE CortexM programmer with a Macbook to program a nRF52832 device.

    I have two different nRF52 PCB layouts (using different modules, but the same nRF52 SoC) and have never experienced the issue with the other one which has a much more secure programming pin connection.

    The VRef voltage is just a little over 3.3V.

    I can mostly rule out an issue with the J-Link programmer itself as it will program other nRF52-based products nearby.

    The reset pin does work as the device in question appears to reset and the code that was previously programmed on it executes.

  • Hi,

     

    Mathew said:
    The log file looks identical as that shown in the original post by Kristjan so I have not included it.

    There will be a .log file generated, which holds more info than what is written to stdout. can you attach this?

     

    Kind regards,

    Håkon

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [2023-Jun-15 11:16:07] [ info] --------------------------------------------------------------------------------
    [2023-Jun-15 11:16:07] [ info] nrfjprog --recover -c 125 --log
    [2023-Jun-15 11:16:07] [ info] nrfjprog version 10.14.0 external
    [2023-Jun-15 11:16:07] [ info] --------------------------------------------------------------------------------
    [2023-Jun-15 11:16:07] [ info] Load library at /Applications/Nordic Semiconductor/lib/libnrfjprogdll.dylib.
    [2023-Jun-15 11:16:07] [ info] Library loaded, loading member functions.
    [2023-Jun-15 11:16:07] [ info] Member functions succesfully loaded.
    [2023-Jun-15 11:16:07] [debug] [ Client] - open
    [2023-Jun-15 11:16:07] [debug] [ Client] - start
    [2023-Jun-15 11:16:08] [ info] [ Client] - stdout: Jlinkarm nRF Worker ready. Handling sequence eb186995-c78c-4406-85fc-7b4a7a6a7385.
    [2023-Jun-15 11:16:08] [debug] [SeggerBackend] - Logger sink registered in Segger backend logger
    [2023-Jun-15 11:16:08] [debug] [ JLink] - Logger sink registered in JLink logger
    [2023-Jun-15 11:16:08] [debug] [ nRFXX] - open
    [2023-Jun-15 11:16:08] [debug] [SeggerBackend] - open_dll
    [2023-Jun-15 11:16:08] [debug] [SeggerBackend] - No J-Link DLL path was provided. Attempting to auto detect.
    [2023-Jun-15 11:16:08] [ info] [SeggerBackend] - Load library at /Applications/SEGGER/JLink/libjlinkarm.dylib.
    [2023-Jun-15 11:16:08] [trace] [ Client] - Command open executed for 138 milliseconds with result 0
    [2023-Jun-15 11:16:08] [debug] [ Client] - enum_emu_snr
    [2023-Jun-15 11:16:08] [trace] [ Client] - Command enum_emu_snr executed for 2 milliseconds with result 0
    [2023-Jun-15 11:16:08] [debug] [ Client] - connect_to_emu_with_snr
    [2023-Jun-15 11:16:08] [ info] [SeggerBackend] - Library loaded, loading member functions.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi,

     

    Looks like the debugger isn't able to connect at all.

    Have you tried to use JLinkExe instead to see that it outputs?

    Here's a quick way to connect to a nrf52832:

    Fullscreen
    1
    2
    3
    4
    device nrf52
    si 1
    speed 250
    connect
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    If it still fails, then it sounds like there's a electrical problem in the SWD lines.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    Looks like the debugger isn't able to connect at all.

    Have you tried to use JLinkExe instead to see that it outputs?

    Here's a quick way to connect to a nrf52832:

    Fullscreen
    1
    2
    3
    4
    device nrf52
    si 1
    speed 250
    connect
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    If it still fails, then it sounds like there's a electrical problem in the SWD lines.

     

    Kind regards,

    Håkon

Children
No Data