This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NOT_AVAILABLE_BECAUSE_PROTECTION, jlink fails, nRF Connect for desktop fails

I keep seeing NOT_AVAILABLE_BECAUSE_PROTECTION errors on all sub-programs of nRF Connect when attempting to program the associated firmware (RSSI viewer, Bluetooth Low Energy, Programmer, etc). J-Link command line keeps flagging the part as protected every time I connect to it:

nrfjprog gives:

C:\windows\system32>nrfjprog --family nrf52 --recover
Recovering device. This operation might take 30s.
ERROR: Recover failed. Please make sure that the correct device family is given
ERROR: and try again.

C:\windows\system32>nrfjprog -v
nrfjprog version: 10.12.1
JLinkARM.dll version: 6.90

I can only program the part through dropping a hex file on the JLINK drive or through nRF Connect SDK version of SES.

Part = nRF52840

nRF Connect for Desktop v3.6.1

How can I use any of the nRF Connect for Desktop apps?

Thanks,

Bob

  • Hi Simon,

    I'm afraid that only worked on one board. I have a couple others that still show the failure. Any new thoughts?

    Thanks,

    Bob

  • Hi

    Sorry about the late reply, but I've been out of office during the Holiday, and we're just getting back to full staff. What J-Link version do you have in these faulty boards? Other people reporting this J-Link version issue also fixed it by reinstalling the interface MCU firmware and downgrading the J-Link version to a supported one.

    Please also check out our DK checklist to see if any of these "regular" fixes help you out.

    Best regards,

    Simon

  • Hi Simon,

    Happy New Year! I was also out for the holiday break.

    I'm afraid I'm still stuck. I tried loading the J-Link BIN file through the BOOTLOADER drive, and am using J-Link v6.88a. I went through the DK checklist. I also tried the following J-Link commands which we typically use in a script. This time, I just copied and pasted each command into a J-Link terminal:

    H:\>jlink
    SEGGER J-Link Commander V6.88a (Compiled Nov 18 2020 15:10:56)
    DLL version V6.88a, compiled Nov 18 2020 15:09:23
    
    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00
    Hardware version: V1.00
    S/N: 682863243
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    VTref=3.300V
    
    
    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: NRF52840_XXAA
    Type '?' for selection dialog
    Device>
    Please specify target interface:
      J) JTAG (Default)
      S) SWD
      T) cJTAG
    TIF>s
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "NRF52840_XXAA" selected.
    
    
    Connecting to target via SWD
    InitTarget() start
    InitTarget() end
    Found SW-DP with ID 0x2BA01477
    DPIDR: 0x2BA01477
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x02880000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    Cortex-M4 identified.
    J-Link>WriteDP 1 0x50000000
    Writing DP register 1 = 0x50000000 (0 write repetitions needed)
    J-Link>WriteDP 2 0x01000000
    Writing DP register 2 = 0x01000000 (0 write repetitions needed)
    J-Link>WriteAP 1 0x00000001
    Writing AP register 1 = 0x00000001 (0 write repetitions needed)
    J-Link>ReadAP 2
    Reading AP register 2 = 0x00000001 (0 read repetitions needed)
    J-Link>ReadAP 2
    Reading AP register 2 = 0x00000000 (0 read repetitions needed)
    J-Link>WriteAP 0 0x00000001
    Writing AP register 0 = 0x00000001 (0 write repetitions needed)
    J-Link>WriteAP 0 0x00000000
    Writing AP register 0 = 0x00000000 (0 write repetitions needed)
    J-Link>WriteAP 1 0x00000000
    Writing AP register 1 = 0x00000000 (0 write repetitions needed)
    J-Link>ReadAP 3
    Reading AP register 3 = 0x00000001 (0 read repetitions needed)
    J-Link>ReadAP 3
    Reading AP register 3 = 0x00000001 (0 read repetitions needed)
    J-Link>
    

    At the end, notice the ReadAP command is always returning 1, which indicates APPPROTECT is still set.

    Now when I try `nrfjprog -f nrf52 --recover`, I see:

    H:\>nrfjprog -f nrf52 --recover
    Recovering device. This operation might take 30s.
    ERROR: Recover failed. Please make sure that the correct device family is given
    ERROR: and try again.
    
    H:\>

    The same happens on both PC and Mac systems, using different USB cables.

    Cheers,

    Bob

  • Hi Simon,

    I got everything working. You were on the right track about J-Link versions, though I had to go further back.

    I did the following:

    1. Uninstall all Nordic and SEGGER software
    2. Reboot PC
    3. Install the nRF Command Line Tools v9.8.1
    4. Start an EVKs into bootloader mode and upload the J-LINK-OB BIN file from your site
    5. Restart the EVK and run `nrfjprog -f nrf52 --recover`
    6. Accept the firmware update to v6.40
    7. Process completes with erasing code and UICR
    8. Restart EVK

    For good measure, I uninstalled Bitdefender to be sure it wasn't blocking anything. I got some errors when it was running, so maybe it prevented some files getting installed correctly.

    I also did some further testing. It seems the recovery error creeps in with nRF Command Line Tools v10.11.0 and later when the release notes state things about APPPROTECT and other related entries.

    I'll keep using v10.10.0 for now.

    Cheers,

    Bob

  • nRF Connect for Desktop still gives the protection error - on just the Bluetooth Low Energy app. I believe it has its own newer J-Link version, but can't seem to find it on my system.

Related