Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Problem to upload to nRF52-DK

Hello,

I just got in these days a nRF52-DK and just today I started to try stuff with it, I want to use PlatformIO and Zephyr.

First I try this:https://docs.platformio.org/en/latest/tutorials/nordicnrf52/zephyr_debugging_unit_testing_inspect.html#tutorial-nordicnrf52-zephyr-debugging-unit-testing-analysis then I realized that I needed to install USB drivers https://docs.platformio.org/en/latest/plus/debug-tools/jlink.html#debugging-tool-jlink, it looked like upload, because the led were blinking, but after power off and on was no possible to upload again.

I start to look for solutions but it is no possible to do "nrfjprog --recover" throws an error "[error]: [  nRF52] - Access protection is enabled, can't read device version." ad the target and "nrfjprog --deviceversionthrows "NRF51xxx_xxAA_REV1" instead of "NRF52832_XXAA" the other strange stuff is the "VTref=3.300V" in the target info in PlatformIO when trying to upload.

Also it is no posible to put the nRF52-DK in bootloader mode as described in https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf52832_dk%2FUG%2Fnrf52_DK%2Fboot_reset_but.html, but the jlink interface is recognized in JLinkConfig.exe but I could find a link to download a firmware for JLink_OB_nRF5340_NordicSemi the one on the site of nRF52-DK is J-Link-OB-SAM3U128-V2, and maybe use JLinkConfig to upgrade the firmware. I am not sure if the problem is the nRF5340 Interface MCU or the nRF52832 that remains in a strange stage.

Any way I will tray more stuff but I hope help in this issue because the DK was just new,

best regards,

Parents Reply Children
  • Thanks for the info. Seems that the board is still alive. 


    Please send us the log/screenshot you have when you call nrfjprog --recover -f NRF52 


    Also please try installing the nRF Connect for Desktop and then open the Programmer app inside. 

  • output from nrfjprog:

    This are also the logs from nrfjprog and from nRF Connect for Desktop programer:

    2022-08-26T17:57:09.749Z DEBUG Application data folder: C:\Users\PedroMarquez\AppData\Roaming\nrfconnect\pc-nrfconnect-programmer
    2022-08-26T17:57:09.801Z INFO Using nrf-device-lib-js version: 0.4.11
    2022-08-26T17:57:09.801Z INFO Using nrf-device-lib version: 0.11.8
    2022-08-26T17:57:09.801Z INFO Using nrfjprog DLL version: 10.15.4
    2022-08-26T17:57:09.802Z INFO Using JLink version: JLink_V7.70c
    2022-08-26T17:57:09.829Z DEBUG App pc-nrfconnect-programmer v3.0.3 official
    2022-08-26T17:57:09.829Z DEBUG App path: C:\Users\PedroMarquez\.nrfconnect-apps\node_modules\pc-nrfconnect-programmer
    2022-08-26T17:57:09.830Z DEBUG nRFConnect 3.11.1, required by the app is (^3.11.1)
    2022-08-26T17:57:09.830Z DEBUG nRFConnect path: C:\Users\PedroMarquez\AppData\Local\Programs\nrfconnect\resources\app.asar
    2022-08-26T17:57:09.830Z DEBUG HomeDir: C:\Users\PedroMarquez
    2022-08-26T17:57:09.830Z DEBUG TmpDir: C:\Users\PEDROM~1\AppData\Local\Temp
    2022-08-26T17:57:09.831Z INFO Installed JLink version does not match the provided version (V7.58b)
    2022-08-26T17:57:15.997Z DEBUG iface: LAN-Verbindung* 14
    2022-08-26T17:57:15.997Z DEBUG IP4: 192.168.137.1
    2022-08-26T17:57:15.997Z DEBUG IP6: fe80::14a4:3779:aed8:3b07
    2022-08-26T17:57:15.998Z DEBUG MAC: 2a:df:eb:f8:79:bf
    2022-08-26T17:57:15.998Z DEBUG Client Id: 42e8fcd4720dc6685c62e897d27ad008ffd937ba
    2022-08-26T17:57:16.817Z INFO Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
    2022-08-26T17:57:16.817Z INFO JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49
    2022-08-26T17:57:16.817Z INFO Device family NRF52
    2022-08-26T17:57:16.817Z INFO Device version UNKNOWN
    2022-08-26T17:57:16.817Z INFO Board version PCA10040
    2022-08-26T17:57:16.818Z INFO Loading readback protection status for Application core
    2022-08-26T17:57:17.051Z DEBUG Google Analytics for category pc-nrfconnect-programmer has initialized
    2022-08-26T17:57:17.242Z INFO Readback protection status: NRFDL_PROTECTION_STATUS_ALL
    2022-08-26T17:57:17.246Z INFO Parse memory regions for Application core
    2022-08-26T17:57:17.249Z INFO Update files regions according to Application core
    2022-08-26T17:57:17.249Z INFO Parse memory regions for file
    2022-08-26T17:57:17.253Z INFO Device is loaded and ready for further operation
    2022-08-26T17:57:27.050Z INFO Recovering NRFDL_DEVICE_CORE_APPLICATION core
    2022-08-26T17:58:28.225Z ERROR Failed to recover NRFDL_DEVICE_CORE_APPLICATION core: async task failure for id: 122422858 msg: RECOVER_FAILED (Origin: "Error when running nrfdl_device_control_recover")
    2022-08-26T17:58:28.226Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink OB version","label":"J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49"}
    2022-08-26T17:58:28.230Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink device family","label":"NRF52"}
    2022-08-26T17:58:28.231Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink device version","label":"UNKNOWN"}
    2022-08-26T17:58:28.232Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink device board version","label":"PCA10040"}
    2022-08-26T17:58:28.233Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open device","label":"jlink"}
    2022-08-26T17:58:28.234Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"architecture","label":"ia32"}
    2022-08-26T17:58:28.234Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Report error","label":"win32; ia32; v3.0.3; Failed to recover NRFDL_DEVICE_CORE_APPLICATION core: async task failure for id: 122422858 msg: RECOVER_FAILED (Origin: \"Error when running nrfdl_device_control_recover\")"}
    2022-08-26T17:58:28.237Z INFO Device recovery completed
    2022-08-26T17:58:28.239Z INFO Using @nordicsemiconductor/nrf-device-lib-js to communicate with target via JLink
    2022-08-26T17:58:28.240Z INFO JLink OB firmware version J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49
    2022-08-26T17:58:28.240Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink OB version","label":"J-Link OB-nRF5340-NordicSemi compiled Dec  3 2021 15:46:49"}
    2022-08-26T17:58:28.241Z INFO Device family NRF52
    2022-08-26T17:58:28.242Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink device family","label":"NRF52"}
    2022-08-26T17:58:28.243Z INFO Device version UNKNOWN
    2022-08-26T17:58:28.243Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink device version","label":"UNKNOWN"}
    2022-08-26T17:58:28.244Z INFO Board version PCA10040
    2022-08-26T17:58:28.244Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Open jlink device board version","label":"PCA10040"}
    2022-08-26T17:58:28.245Z INFO Loading readback protection status for Application core
    2022-08-26T17:58:28.696Z INFO Readback protection status: NRFDL_PROTECTION_STATUS_ALL
    2022-08-26T17:58:28.702Z INFO Parse memory regions for Application core
    2022-08-26T17:58:28.706Z INFO Update files regions according to Application core
    2022-08-26T17:58:28.707Z INFO Parse memory regions for file
    2022-08-26T17:58:28.710Z INFO Device is loaded and ready for further operation
    2022-08-26T17:58:28.713Z INFO Skipped reading, since at least one core has app readback protection
    2022-08-26T17:58:28.715Z INFO Resetting device
    2022-08-26T18:00:27.279Z INFO Parsing HEX file:  C:\Users\PedroMarquez\Downloads\nrf52dkfw110\led_softblink_pca10040.hex
    2022-08-26T18:00:27.298Z INFO File was last modified at  8/26/2022, 7:58:28 PM
    2022-08-26T18:00:27.305Z INFO Update files regions according to Application core
    2022-08-26T18:00:27.305Z INFO Parse memory regions for file
    2022-08-26T18:00:36.615Z INFO Recovering NRFDL_DEVICE_CORE_APPLICATION core
    2022-08-26T18:01:37.764Z ERROR Failed to recover NRFDL_DEVICE_CORE_APPLICATION core: async task failure for id: 311988089 msg: RECOVER_FAILED (Origin: "Error when running nrfdl_device_control_recover")
    2022-08-26T18:01:37.764Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Report error","label":"win32; ia32; v3.0.3; Failed to recover NRFDL_DEVICE_CORE_APPLICATION core: async task failure for id: 311988089 msg: RECOVER_FAILED (Origin: \"Error when running nrfdl_device_control_recover\")"}
    2022-08-26T18:01:37.768Z INFO Device recovery completed
    2022-08-26T18:01:37.769Z INFO Writing procedure starts for NRFDL_DEVICE_CORE_APPLICATION core
    2022-08-26T18:01:37.775Z INFO Writing HEX to NRFDL_DEVICE_CORE_APPLICATION core
    2022-08-26T18:01:37.976Z INFO Uploading image through JLink: 0%
    2022-08-26T18:01:38.163Z ERROR Device programming failed with error: async task failure for id: 373148467 msg: NOT_AVAILABLE_BECAUSE_PROTECTION (Origin: "Error when running fw program.")
    2022-08-26T18:01:38.164Z DEBUG Sending usage data {"category":"pc-nrfconnect-programmer","action":"Report error","label":"win32; ia32; v3.0.3; Device programming failed with error: async task failure for id: 373148467 msg: NOT_AVAILABLE_BECAUSE_PROTECTION (Origin: \"Error when running fw program.\")"}
    2022-08-26T18:01:38.166Z INFO Writing HEX to NRFDL_DEVICE_CORE_APPLICATION core completed
    2022-08-26T18:01:38.166Z INFO Writing procedure ends for NRFDL_DEVICE_CORE_APPLICATION core
    2022-08-26T18:01:38.168Z INFO Resetting device
    

    0068.log.log

  • Hi Pedro, 

    I did a test here and I had the same NRF51xxx_xxAA_REV1  return if I do --deviceversion after the nRF52 chip is protected (a power reset after programming). I assume this is normal because the chip is protected. 


    However, I can do --recover without any problem on my DK.

    So there must be something wrong that wouldn't allow nrfjprog to recover your DK. 

    Is there anything special about the PlatformIO firmware that you flashed on the board ? 
    Prior to the firmware you flashed, did you flash any firmware from our NCS SDK or nRF5 SDK? 

  • Hi Pedro, 


    Could you send us the hex file that generated from the example ? Especially if you still have the hex that you used to flash on the board ? 

    We are suspecting that the example may trigger manual system reset too early or enable WDT that can trigger a reset too early. 

    Here is a quote from our R&D team: 

    It seems that the recover hardware mechanism does not work as intended.
    nrfjprog writes the device CTRL-AP.ERASEALL register, but the CTRL-AP.ERASEALLSTATUS flag never indicates that the operation has been completed.



Related