# Resetting DIF to reduce interface current on nRF52

Hi, As has been mentioned many times, the DIF on both the nRF51 and nRF52 consumes quite a bit of current. In the past, on the nRF51, I've relied on power cycling both chipsets to reset the DIF, as I could get no debugger command to ever do this correctly.

I was hoping that this behavior would be corrected on the nRF52. I'm currently designing an application where the entirety of the device (battery, etc.) is fully encapsulated for a one-time-use application. Only a SWD interface (including !RESET) for reprogramming and testing in application is exposed. It's also used as a backup interface to read out some stored readings should the internal battery lose power.

Now, if the SWD interface ever accidentally gets enabled (I believe this was possible depending on noise on the nRF51), or if debug mode needs to be entered to read out stored readings, the chip will get stuck on the DIF.

Is there any known way to reset the DIF to reduce power consumption after a debug session through the interface or in software without a power cycle?

I have tried many recommendations on the forum to no avail. This includes a pin reset (both using a J-link and by manually shorting the reset pin). I've also verified that PSELRESET is configured appropriately. In fact, I can see the current consumption fall from ~3mA down to ~800uA for maybe half a second after RESET is held low, indicating that it is configured appropriately. After that, it just jumps to the normal current with DIF on.

All of the other components on the board have been accounted for - after power-on, without any DIF usage, the entirety of the board consumes 9uA, most of which comes from a separate component. The nRF52 consumes about ~1uA.

Any solutions? Perhaps there's some debugger command or internal DIF register that needs to be written? Or will I simply need to design hardware to power cycle the nRF52?

edit retag close delete

Sort by » oldest newest most voted

Hi, you can try to write to the DIF directly using JLinkExe and reset it.

Run Jlink.exe (JlinkExe in linux), do not connect to the chip, just make sure that the correct JLink is selected based on the serialnumber. Write this:

SWDSelect
SWDWriteDP 1 0x04000000
exit


That should reset the DIF, and current consumption should go down to normal.

more

THANK YOU! This works perfectly. I've been looking for this information for quite a while. I'm guessing it may work with the nRF51 as well, which would be useful for some of my other prototypes.

Perhaps this should be integrated into nrfjprog, the standard gcc makefiles, or debug configuration? I can't think of a reason for why you wouldn't want to do this all the time after you're done flashing or debugging (I have seen the high current even while only flashing the device)

( 2017-11-15 03:08:40 +0100 )editconvert to answer
1

This should be handled by the JLink automatically. Are you using read back protection? I've only been able to reproduce the issue when read back protection is activated, since you can't do a soft reset. Any info would be helpful so we can track down the cause of this. Can you please post debugger type/version, JLink dll version, JLink FW version, nrfjprog version etc.?

( 2017-11-15 08:38:19 +0100 )editconvert to answer

[hide preview]

## Recent blog posts

• ### Estudando Projetos do SDK 10 para nRF5x com Eclipse Oxygen (Portuguese)

Posted 2017-11-12 00:08:55 by Carlos Delfino
• ### Configurando o Eclipse Oxygen para Desenvolvimento com nRF5x (Portuguese)

Posted 2017-11-10 21:15:47 by Carlos Delfino
• ### How to use Git for embedded software development

Posted 2017-11-06 13:21:55 by Yaniv Nis
• ### Thingy:52 based Weather Station

Posted 2017-10-29 22:31:15 by Krzysztof Szewczyk
• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis

## Recent questions

• ### IS BLE MESH SUPPORT ARDUINO PRIMO CORE?

Posted 2017-11-20 08:07:17 by rajeshkumar
• ### Nordic Bluetooth 5 (nRF52832)

Posted 2017-11-20 07:38:32 by pavan
• ### nrf5x eclipse in linux again

Posted 2017-11-20 07:18:59 by efiLabs
• ### Central Scan Continuously and Peripheral/Beacon Broadcast

Posted 2017-11-20 07:04:41 by kian79
• ### High PER at 2Mbps

Posted 2017-11-20 06:47:23 by Michael