"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:

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.".
[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.".
[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.".
[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.".
[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: JLinkARM DLL reported an error. Try again. If error condition
ERROR: persists, run the same command again with argument --log, contact Nordic
ERROR: Semiconductor and provide the generated log.log file to them.
NOTE: For additional output, try running again with logging enabled (--log).
NOTE: Any generated log error messages will be displayed.

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.

Reply
  • 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.

Children
  • 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

  • At first I was using the latest drivers, but then in the process of elimination I went few releases back. Did not help though..

    Oh I should also add, that there is an LED that is ON when code is running. When I try to connect to the board, it blinks at the same time as debugger LED, which probably means that the IC resets, right?

    Regarding your second question, I currently have 5 non working boards. Each of them lasted "some" number of sessions and then stopped responding. So it's not a single board issue.

    Is it possible that firmware somehow remapped gipo pins? I'm using nrf_ble_template and did not mess with any gpios, so that would be weird, but it could be..

  • So I was reading ERRATA of the IC and found something interesting. Could this be the issue?

  • Hi,

     

    That errata is referring to specific states, ie. that you have the debugger attached (and active) and you use systemoff mode.

    Given that you are not able to access the device using the programmer, I suspect that your debug session is inactive.

    kristjanb said:

    Oh I should also add, that there is an LED that is ON when code is running. When I try to connect to the board, it blinks at the same time as debugger LED, which probably means that the IC resets, right?

    Regarding your second question, I currently have 5 non working boards. Each of them lasted "some" number of sessions and then stopped responding. So it's not a single board issue.

    Is it possible that firmware somehow remapped gipo pins? I'm using nrf_ble_template and did not mess with any gpios, so that would be weird, but it could be..

    The debugger will try to reset your board, which is highly likely the reason why you see the LED blink.

    It is unlikely that the firmware starts reconfiguring the pins.

     

    Could you try reducing the clock speed when recovering your device? This is done with the "-c" switch:

    nrfjprog --recover -c 125 --log

     

    If it still fails, could you share the generated log.log file?

     

    Kind regards,

    Håkon

  • I'm having the same issue. Here's the logs when using Programmer (nRF Connect for Desktop): 

    2023-06-13T02:28:47.131Z INFO Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
    2023-06-13T02:28:47.132Z INFO JLink OB firmware version
    2023-06-13T02:28:47.137Z INFO Device family
    2023-06-13T02:28:47.139Z INFO Device version
    2023-06-13T02:28:47.140Z INFO Board version
    2023-06-13T02:28:47.143Z INFO Loading readback protection status for Application core
    2023-06-13T02:28:47.450Z ERROR Failed to load readback protection status: async task failure for id: 51386707499 msg: [jlink] JLINKARM_DLL_ERROR (Origin: "Error when running operation: protection-get")
Related