GPIOs are not reset after DFU

kykrueger gravatar image

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


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++)

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 flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
bjorn-spockeli gravatar image

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

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


edit flag offensive delete publish link more

Your Answer

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

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower


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

Seen: 56 times

Last updated: april 21