[SOLVED] Reading UICR of nRF51422 which is locked

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Reading UICR of nRF51422 which is locked

    I use JLinkExe with a script to read the UICR of a nRF51422 processor. When the processor is secured, the UICR can still be read and can contain useful user information. Now with JLink version 6 the processor is automatic unsecured, which means a mass erase and so also the UICR information is lost. We use the UICR for a unique identifier and hardware information.
    With Windows there should be a possibility to hook JLINK_SYS_UnsecureDialog() and block the mass erase. We use Linux for our development environment and this function is not available. How can I block the automatic unsecure function for Linux and use JLinkExe to read the UICR of the nRF51422? Should we go back to version 4 or is there another solution?

    kind regards, Erik Postma
  • Hello Erik,

    Thank you for your inquiry.
    How are you securing your device?
    Generally when devices are secured the debug interface will be disabled thus a connect will already not work. If a connect does not work you can't read any registers.

    EPO4it.nl wrote:

    We use Linux for our development environment and this function is not available.
    Correct. Currently there is no option to disable mass erase on Linux. It is planned to be added later this year.
    However on most devices this will have no benefit as most debug features are disabled once device security is enabled.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello Nino,

    With the nRF51422 it is possible to block reading the device with the first part of the UICR. The first register in the UICR is CLENR0, which divides the flash in two regions. The fiirst region is mostly used for a softdevice like BLE or ANT. The next register is RBPCONF. it contains two values (PR0 and PALL). By writing 0 in these values reading back the flash is protected. This method I use for securing my code.

    Is it not possible to make a JLink version, that just reports that the processor is secured and mentions the availability of the unsecure command? A user can type unsecure him/herself. With version 4 of JLink there was no automatic unsecure process.

    Kind regards, Erik Postma
    Images
    • Screenshot from 2018-06-29 12:45:50.png

      66.38 kB, 727×664, viewed 635 times
  • Hello Erik,

    You can do so under Windows. Linux and macOS are currently not supported for that feature.

    SEGGER - Nino wrote:

    Correct. Currently there is no option to disable mass erase on Linux. It is planned to be added later this year.
    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.