UICR won't be completely erased (APPROTECT)

It seems that not all UICR registers are erased on this nRF52840 chip

nrfjprog -f nrf52 --recover

Just make sure one more time:

nrfjprog -f nrf52 --eraseuicr

nrfjprog -f nrf52 --readuicr uicr.bin --log
Storing data in 'uicr.bin'.

Displaying uicr:

It's indeed there

nrfjprog -f nrf52 --memrd 0x10001208 --w 8 --n 4    

0x10001208: 5A 00 00 00                                       |Z...|

And it can't be overwritten:

What's happening here?

The APPROTECT register should show 0xFF!

This is the chip:

0FAA as INFO.VARIANT (https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fficr.html&anchor=register.INFO.VARIANT)

I now also found https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Frev_history.html that 0x5A (HwDisabled) is an option for "Hardware disable of access port protection for devices where access port protection is controlled by hardware and software"

My problem is that after each power cycle it failed to flash without clearing UICR first.

Parents
  • We can erase UICR using JLinkExe

    halt
    w4 4001E504, 2
    w4 4001e50C, 1
    r

    We will see subsequently that indeed there's 0xFF written to the register at 0x10001208.

    After nrfjprog --recover we will find that this UICR value is overwritten by the Nordic tool to 0x5A.

    Hence, hereby clarifying what happens.

    @Nordic. Would you mind to add an option to nrfjprog to leave this register alone? Perhaps something like nrfjprog --someoption that erases everything WITHOUT writing to this field. For example, also e.g. nrfjprog --eraseall writes this register.

Reply
  • We can erase UICR using JLinkExe

    halt
    w4 4001E504, 2
    w4 4001e50C, 1
    r

    We will see subsequently that indeed there's 0xFF written to the register at 0x10001208.

    After nrfjprog --recover we will find that this UICR value is overwritten by the Nordic tool to 0x5A.

    Hence, hereby clarifying what happens.

    @Nordic. Would you mind to add an option to nrfjprog to leave this register alone? Perhaps something like nrfjprog --someoption that erases everything WITHOUT writing to this field. For example, also e.g. nrfjprog --eraseall writes this register.

Children
Related