# GPIOs are not reset after DFU

Hi,

We had a power issue with our custom board related to DFU updates. After performing a DFU we were seeing 8mA idle current, and when we had programmed the firmware directly with the JLink Flasher, we were seeing ~500µA as expected.

This lead us to believe that some GPIOs were not being reconfigured to the default values after a successful update. To test this theory we added a loop to the beginning of our app that sets all gpios back the their defaults. The result was a success, we now see ~500µA after a DFU update.

for (int i = 0 ; i <= 31; i++)
nrf_gpio_cfg_default(i);


However, I wanted to create a question as a bug report. We expected that this would have happened at the end of a DFU update, and is not something that the app should need to worry about. We are still using SDK12.0.0 as there were a number of other bug fixes we had added in to the SDK, and we have not yet had tried to merge with SDK12.0.1.

Is this a known problem, and has it been fixed in the latest versions of the SDK?

-- Kyle

edit retag close delete

Sort by » oldest newest most voted

Hi Kyle,

this is the expected behavior since the bootloader branches to the application, i.e. does not reset into the application.

The nRF52 will always will pass execution to the bootloader if it is present, which in turn will pass execution to the application, if it is valid. The bootloader will trigger one or several soft-resets during the DFU process, depending on the image type, but the final switch from bootloader to app is a branch operation.

This means that all configurations of peripherals if you've initialized in the bootloader, e.g. the GPIO peripheral, will persist through the branch operation. So the best practice is to have to un-initalize or reset the configuration to its default values the peripherals before the branch operation.

Best regards

Bjørn

more

[hide preview]

## Recent blog posts

• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis
• ### Multiple channels in RTT

Posted 2017-09-29 11:51:52 by Krzysztof Zaraska
• ### 6 Things to Know about Bluetooth Beacons

Posted 2017-09-22 08:27:00 by Rose Martin
• ### Creating a Keil project for a Bluetooth Mesh example (Updated for 0.10.0)

Posted 2017-09-19 12:08:11 by Kristian Skordal
• ### Using millis() like in Arduino.

Posted 2017-09-18 11:58:04 by schef

## Recent questions

• ### can't program nrf52832ciaa

Posted 2017-10-17 18:34:31 by luckxiaoer
• ### nRF52840 and others " printf()"

Posted 2017-10-17 18:30:44 by ToasTer86
• ### Help with breakpoints on Eclipse with sdk14 please

Posted 2017-10-17 18:18:00 by Tony
• ### Maximum power consumption

Posted 2017-10-17 18:15:05 by Ruediger
• ### Advertising restart after a disconnect event

Posted 2017-10-17 18:14:18 by Yatekii