CTRL-AP secured /unsecured problem when trying to view log with J-Link RTT view from nRF52840DK with loaded bsp pca10056.hex that comes with nRF5 SDK 17.1.0

Can’t RTT view even provided precompiled code that comes with nRF5 SDK v17.1.0. Tried also the .hex versions that came with older SDK back to 15.3 – same story . Tried even the Blinky example (despite it doesn’t have any logging inside) – still same CTRL-AP alertFrowning2

When connect  RTT View to the nRF52840DK and get right away a message that the device is secured and need to be unsecured.

But if I accept the proposed option Yes, then it wipes the flash including the bsp example code

If answer No  - J-Link RTT refuses to connect and aborts the session.

Found similar thread, but for different chip, so cant try the code provided there. Didn’t see (maybe missed as the thread is long ) explanation of a solution for the problem that could apply to provided examples precompiled .hex files without recompiling again?

Parents
  • Hello,

    In order to keep APPROTECT disabled across resets, it is necessary to store the 'HwDisabled' value in the non-volatile UICR.APPROTECT register. This is easiest accomplished with the 'nrfjprog --recover' command. 

    E.g.,

    $ nrfjprog --program ble_app_uart_pca10056_s140.hex --recover --verify -r

    You can also verify if the APPROTECT register is written with the 'HWDisabled' with the following command:

    $ nrfjprog --memrd 0x10001208 // Should return 0x0000005A

    Note: the new approtect mechanism is not supported in SDK 15.3.0. Please refer to IN 141 for more details.

    Best regards,

    Vidar

  • Hi Vidor,

    Thank you for quick response. Researching your answer (especially  IN 141) rise 2 more questions:

    - In  IN 141 is mentioned MDK 8.40.2 or later which I never used so far (just bare SES as it comes). Now I found the downloads for MDK for SES, but cant find any documents how to install it and how to work/use it inside SES?

    -Also, the MDK downloads come in few flavors (beside licensing) :

    nrf_mdk_8_63_1_ses_bsdlicense.empackage

    nrf_mdk_8_63_1_ses_riscv_bsdlicense.empackage

    My wild guess is that the first one is applicable for nRF52840, 52832 etc. ARM based devices?

    Thank you and best regards

  • Hi,

    The SDK project are including the MDK files which are included with the SDK (/nRF5_SDK_17.1.0_ddde560/modules/nrfx/mdk - version 8.40.3) and not the ones installed with the emPackage. Are you currently working on SDK v17.1.0, or do you work with an older SDK that requires you to update the MDK files to be compatible with the new silicon revision?

    The RISCV variant is probably including startup and device files for the RISCV cores on our nRF54 devices.

  • Hi Vidor,

    I currently work with 17.1.0, but will  use some my old works that were initially made with 17 , 17.0.2 and may be some that were even with 16.

    As you mentioned that the MDK module provided with SDK17.1.0 is version 8.40.3, but I found this Nordic publication Working with the nRF52 Series' improved APPROTECT  that states:

    “Using the latest version of the MDK is recommended because the MDK also implements workarounds for errata.
    NOTE:
     If using the nRF5 SDK then ensure that it has been updated to MDK version 8.45.0 or newer.”

    Didn’t find yet info how to update the SDK 17.1.0 MDK module with the latest 8.63.1?

    Thank you and best regards

  • Hi,

    I think the easiest way to update the MDK in the nRF5 SDK is to copy the MDK files from the nrfx repo at https://github.com/NordicSemiconductor/nrfx/tree/v3.6.0/mdk to your SDK  (/nRF5_SDK_x.y.z/modules/nrfx/mdk). The other alternative is to download and install the MDK empackage, then copy the files installed by the package to the MDK folder in your SDK.

    Note: the MDK version is defined in the nrf.h header: https://github.com/NordicSemiconductor/nrfx/blob/075e9e711383bb3babfae4249fd59c8c8d882f72/mdk/nrf.h#L39

    samsam said:
    NOTE: If using the nRF5 SDK then ensure that it has been updated to MDK version 8.45.0 or newer.”

    There was a bug in the errata check for the nRF52833 that was addressed in version 8.45.0, but the nRF52840 was not affected.

    Best regards,

    Vidar

  • Hi Vidar,

    Will try it ASAP.

    BTW while I was trying  nrfjprog commands that you gave as well the ones posted in the Nordic blog I realized that my command line tools (ver 6.88a) might be too old as I didn’t get expected results, but when I tried to install the latest version downloaded from the Nordic website nrf-command-line-tools-10.24.2-x64.exe, found bugs in the installer, which took me extra time until find workaround Frowning2 Do you have bug report page where could report this when have some extra time?

     

     

     

    Thank you and best regards

  • Hi,

    I should have also mentioned that nrfjprog must be up-to-date to support the new silicon. Regarding the bug you encountered during installation, please post the details here or in a new ticket, and I will create an internal bug report.

    Thanks,

    Vidar

Reply Children
  • Bug report  - nrf-command-line-tools-10.24.2-x64.exe   doesn’t installs properly when there is existing older version of command-line tools:

    I had already installed nRF-Command-Line-Tools_10_9_0_Installer_64.exe     from before.

     

    When tried to  run for first time  nrf-command-line-tools-10.24.2-x64.exe    with all defaults: When command line tolls finished installation without reporting any problems, installer ask me to install and newer version of J-Link which I also accepted as well some VC++ redistributal files after which I also accepted.

    After this installation finished, nrfjprog was not  working/recognized. When I looked at the installation folder : - in bin subfolder there was only 2 files  - one  .dll and one .exe (but was not nrfjprog.exe). When I looked in the Windows PATH system variable – the pointer to    C:\Program Files\Nordic Semiconductor\nrf-command-line-tools\bin    was also gone/not available anymore.

    Restarted Windows – no any change in content and behavior as before restart

    Run  nrf-command-line-tools-10.24.2-x64.exe  for second time    - selected option “Repair”. Finished normal, but  nrfjprog still was not working, the \bin folder content was same and still there was no pointer  to \bin in my PATH

    Restarted Windows – no any change in content and behavior as before restart

    Run  nrf-command-line-tools-10.24.2-x64.exe  for third time    - selected option “Uninstall”

    Checked to    C:\Program Files\ - uninstaller have wiped completely former Nordic Semiconductor  folder.

    Run  nrf-command-line-tools-10.24.2-x64.exe  for fourth time    - this time installer installed nrf-command-line-tools, but didn’t ask me for installing JLink or any adittional files. Now finally the installation and PATH were Ok.

    P.S. Let me know if this installer makes log file somewhere, so to send it /attach it as well.

    Thanks

Related