nRF51 devkit - how to restore the original Atmel JLink firmware

I programmed an nRF51 devkit for wireshark/nrfsniffing, but now need to restore the original or updated Atmel firmware on nrf51 dev kit for programming BLE chips. Where do I find the JLink files and instructions?

Currently the nRF Connect for Desktop Programmer finds the board and displays nRF51 DK, but no mem layout or family. Opening a hex file does nothing but throw JLink errors: 

10:35:41.679
Using nrfutil-device version: 2.0.3
10:35:41.679
Using nrf-device-lib version: 0.17.3
10:35:41.679
Using nrfjprog DLL version: 10.23.1
10:35:41.679
Using JLink version: JLink_V7.80c
10:35:41.679
Installed JLink version does not match the expected version (JLink_V7.88j)
10:35:41.807
Getting serialport options from persistent store D200BCKB.pc-nrfconnect-programmer
10:35:44.114
Getting serialport options from persistent store 000681344811.pc-nrfconnect-programmer
10:35:44.457
Getting serialport options from persistent store 000681344811.pc-nrfconnect-programmer
10:36:38.588
Error: Failed with exit code 1. Failed to device info one or more devices: * 681344811: [jlink] JLINKARM_DLL_ERROR, code: Nrfjlink. Message: Operation device-info failed, [jlink] JLINKARM_DLL_ERROR.
10:36:38.589
Using nrfutil device to communicate with target via JLink
10:36:40.312
Reading readback protection status for Application core
10:36:40.313
Failed to reading readback protection status for application core core. Error: [object Object], message: Batch task protection-get failed, [jlink] JLINKARM_DLL_ERROR
10:36:40.556
Error: Failed with exit code 1. One or more batch tasks failed: - [jlink] JLINKARM_DLL_ERROR, code: Nrfjlink. Message: Batch task protection-get failed, [jlink] JLINKARM_DLL_ERROR.
10:36:40.556
Error: Failed with exit code 1. One or more batch tasks failed: - [jlink] JLINKARM_DLL_ERROR, code: Nrfjlink. Message: Batch task protection-get failed, [jlink] JLINKARM_DLL_ERROR.
10:59:30.491
Parsing HEX file: M:\Wald\BLE\UART_Flex_FWCode\customService2\pca10028\s130\arm5_no_packs\_build\BLE_ForeWarm_V0_4_7.hex
10:59:30.501
File was last modified at 12/13/2023, 3:29:25 PM
10:59:30.517
Update files regions according to Application core
10:59:30.517
Parse memory regions for file
  • Hi,

    Based on wha tyou write and from the log it looks like you have contact with the debugger. And if so, there is no point in restoring the firmware on the onboard debugger (generally that is also only needed if you have previously replaced it yourself).

    However, the problem could be that the debugger does not have contact with the nRF. A typical reason for this to happen is if you have cut the solder bridge by the current measurement port. If so, either solder it back on or short the current measurement port. Does that help?

  • Einar,

    Does that help? Well, yes and no. I am not familiar with the term "onboard debugger", but assume you mean that part of the code in the Atmel device on the DK that handles JLink and Debugging.

    It turned out that I had an incomplete update of the Programmer's JLink version because of a hidden popup requesting my ok. Apparently the install scripts need adjusting to ensure popping to the top of the desktop stack.

    So after finishing that update, and checking that the current port was shorted (yes, it was), I ran the programmer again. 

    The Programmer is now v4.2.0. Now I get the following heading and error:

    10:50:37.779
    Using nrfutil-device version: 2.0.3
    10:50:37.780
    Using nrf-device-lib version: 0.17.3
    10:50:37.780
    Using nrfjprog DLL version: 10.23.1
    10:50:37.780
    Using JLink version: JLink_V7.88j
    10:54:10.864
    ...
    10:52:18.575
    SoftDevice detected, id 0x87 (S130 v2.0.1)
    10:52:18.714
    Error: Failed with exit code 1. One or more batch tasks failed: - [jlink] INVALID_DEVICE_FOR_OPERATION, code: Nrfjlink. Message: Batch task reset failed, [jlink] INVALID_DEVICE_FOR_OPERATION.
    I get the same error repeated for any of the buttons in the DEVICE menu.
    As I said above, I had set up this DK for Wireshark and nRF Sniffing. Part of that was manually installing new JLink code for Debugging (I believe, but could be wrong). If that code is supposed to be compatible with programming, I now just need to know how to get Programmer to read the BLE device info correctly!
    Steve
  • Hi,

    Steve said:
    As I said above, I had set up this DK for Wireshark and nRF Sniffing. Part of that was manually installing new JLink code for Debugging

    There is no need to change the onboard debugger (which is the Atmel chip on the DK) for using the sniffer. You only re-program nRF for this. Generally, you never need to change the onboard debugger except accept a firmware update of that in some cases when you have updated to a newer J-Link driver pack. (Historically there was a reason for chanigng the onboard debugger firmware, which was if you were using mbed, as that needed for a different debugger firmware in that case, and this is why there is a support for this on the old development kits).

    Steve said:
    I now just need to know how to get Programmer to read the BLE device info correctly!

    Regardign the error message regarding INVALID_DEVICE_FOR_OPERATION I see the same on my end and have forwarded it to the team responsible for desktop apps, but from what I can see on my end the latest version of the programmer app is functional both for wiring to the nRF51 and reading back (but not for resetting the device). 

    Is it so that you are not able to program or read back? If so, which version of J-Link and nRF Connect Programmer do you use? If you have previously attempted to manually update the onboard debugger and that happens to be in a bad state you could try to update it, but I would recomend doing that via the Segger J-Link Configuratior that is part of the Segger driver pack you should allready have installed. Then, you can right-click on the device and select "Replace firmware" to recover. If that does not solve this issue it is likely not related to the onboard debugger firmware.

  • Einar,

    I am not using mbed. I can program and read back, but always the INVALID_DEVICE error shows up.

    I would be happy to just ignore the INVALID_DEVICE err., but when the BLE device is programmed this way, it advertises, but cannot connect to our App. Nor can Nordic nRF Connect - which throws log Error 133 (0x85): GATT ERROR. Again the J-Link is my prime suspect.

    The SEGGER J-Link Configuration V6.34b shows this emulator connected via USB:

    • Product: J-Link OB-SAM3U128-V2-NordicSem V1.00
    • S/N: 681344811  (matches the label on the DK Atmel cover)
    • USB Id: same as S/N
    • Host Firmware: 2018 Jul 12 11:44
    • Emulator Firmware: 2022 Sep 21 09:5* (New)

    After replacing firmware, above list remains the same except:

    • Emulator Firmware: 2018 Jul12 11:44

    I still get the INVALID_DEVICE error, BUT now the device can connect with nRF Connect, but only briefly before it disconnects, this time with Error 8: GATT CONN TIMEOUT. This change in response tells me either the J-Link firmware was corrupted, or the old Host and new Emulator Firmware are incompatible. PLEASE CHECK the instructions for installing Wireshark and nRF Sniffer for problems with the J-Link changes!!!

    I think I might also have something else wrong now... the DK on board BLE has different pin configurations than what this firmware expects for my custom PCB. I'll get back to you.

    Why doesn't the Programmer have a Verify function? Glaring omission!

    Alright, I did have problems on my end too. With the right firmware and the right App, the Programmer can load the firmware and it will run properly. I still get the INVALID_DEVICE error but apparently it can be ignored. 

  • Hi,

    Steve said:
    I would be happy to just ignore the INVALID_DEVICE err., but when the BLE device is programmed this way, it advertises, but cannot connect to our App. Nor can Nordic nRF Connect - which throws log Error 133 (0x85): GATT ERROR. Again the J-Link is my prime suspect.

    You are able to program the device, and it advertises, so I do not see why there is any reason to suspect an issue with the J-Link?

    Steve said:
    this time with Error 8: GATT CONN TIMEOUT. This change in response tells me either the J-Link firmware was corrupted,

    This indicate an issue in the nRF or peer device, somethign causing Bluetooth problems. Not an issue with the J-Link. As you get this, you are even able to debug, so the debugger seems to work fine.

    Steve said:
    I think I might also have something else wrong now... the DK on board BLE has different pin configurations than what this firmware expects for my custom PCB. I'll get back to you.

    This seems to be closer to the issue. It will be interesting to hear what you learn from your debugging.

    Steve said:
    Why doesn't the Programmer have a Verify function? Glaring omission!

    I agreee. I suggest you use nrfjprog for that (and for other programming tasks as well if you are fine with command line tools). It has more features. Note that from nRF Command Line tools version 10.23.4 we no longer test on nRF51, so you should stick with 10.23.2.

    Steve said:
    I still get the INVALID_DEVICE error but apparently it can be ignored. 

    Yes. There are some issues with thenRF51 compatibility in the programmer app as it is no longer being tested on the nRF51 DK and will not support the nRF51 going forward.

Related