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

nrf52 disable debug by reset with eeprom locked

Hello,

I have a PCB with a NRF52 powered by batteries. We need to be able to plug the batteries, then program the device and never remove the batteries. We noticed, that currently, we have a consumption of about 1.3mA more than expected, because the debug is still enabled. We are programming using nrfjprog, here is the sequence we send:

nrfjprog --recover
nrfjprog --program OURHEXFILE
nrfjprog --memwr 0x10001200 --val 21 #enable reset pin
nrfjprog --memwr 0x10001204 --val 21 #enable reset pin
nrfjprog --reset
nrfjprog --pinreset
nrfjprog --rbp ALL #locking eeprom read
nrfjprog --pinreset

After reading this question I expected the final pinreset to disable debug and to get the normal power consumption, but it is not the case.

We only managed to do it by removing eeprom lock, this way we could send "normal" reset with nrfjprog -r which actually behave as expected. All other reset (--debugreset, --pinreset and physical pin reset) are not helping with the power consumption. Actually, --debugreset put our device in a weird state that force us to send some command to it to do something and therefore consume the 1.3mA.

But, we need to lock the eeprom and therefore can't do nrfjprog -r.

How can we disable debug to reduce power consumption?

EDIT: Here a summary of test done with associated power consumption:

  1. Programmed NRF52, physically trigger a reset by removing power and reapply it, device working as expected, power consumption as expected 0.3mA.

  2. Programmed NRF52, keep power plugged, send nrfjprog --pinreset, device working as expected, power consumption is 1.6mA. I.e JTAG debug still enable a draw power.

  3. Programmed NRF52, keep power plugged, send nrfjprog --reset, device working as expected, power consumption as expected 0.3mA. Solution not viable because no applicable with eeprom read lock.

  4. Programmed NRF52, keep power plugged, send nrfjprog --debugreset, device not working as expected, power consumption is 0.5mA. Device frozen.

  5. Programmed NRF52, keep power plugged, unplugged JLink cable, resetting by connecting RESETn to GND, device actually reset, device working as expected, power consumption is 1.6mA

Related