# GPIOs are not reset after DFU

asked 2017-04-21 13:29:31 +0200

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

answered 2017-04-21 13:47:58 +0200

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

Please start posting anonymously - your entry will be published after you log in or create a new account.

[hide preview]

## Recent blog posts

• ### ble_app_hrs_freertos running in Atollic TrueSTUDIO

Posted 2017-08-14 02:55:30 by jmag999
• ### OLED display support for nRF52832 (SSD1306, Adafruit GFX)

Posted 2017-08-11 08:21:31 by Mahesh Venkitachalam
• ### I tried 5 different debugger IDEs for nRF52 and STM32. Here are my results.

Posted 2017-08-09 10:56:19 by Jonathan
• ### Things you should know about Bluetooth mesh

Posted 2017-08-07 12:37:22 by Eirik Midttun
• ### Support pairing on NUS profile for Central and Peripheral

Posted 2017-08-01 08:42:41 by Eugene Yu

## Recent questions

• ### Unusual behaviour with specific model host (SM-T580) with nRF52

Posted 2017-08-18 01:10:50 by Musa
• ### buttonless DFU SDK v14.0 problems

Posted 2017-08-18 01:08:35 by ajc
• ### SDK 14: issue with secure buttonless DFU

Posted 2017-08-18 00:38:25 by Rbai
• ### Cannot program WT51822-S4AT

Posted 2017-08-17 22:30:09 by zolotiyeruki
• ### advertising manufacturing specific data without company id?

Posted 2017-08-17 22:17:47 by gorazd

## Stats

Asked: 2017-04-21 13:29:31 +0200

Seen: 41 times

Last updated: Apr 21