Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52840 wouldn't reset automatically after DFU update

Hello,

I'm using nRF52840 custom board with nRF5 SDK v16.0 and Softdevice v7.0.1. 

I can successfully DFU/OTA the device using nRFConnect app. But after DFU is complete, the device remains in DFU mode and device name keeps displayed as DfuTarg. Ideally the device should reset itself (or without reset) and start the user application. But I have to manually power cycle the board to achieve this. This give a very annoying user experience to the customer. 

I have read forums where they have discussed the gcc version and LTO enabled in the make file ("flto" option) with which the bootloader is compiled.

Link: https://devzone.nordicsemi.com/f/nordic-q-a/34224/device-does-not-reset-after-dfu

However, I have checked Makefile at "..\nRF Software\nRF5_SDK_16.0.0_98a08e2\external\micro-ecc\nrf52hf_armgcc\armgcc", the "-flto" option is already disabled.

# Optimization flags
OPT = -Os -g3
# Uncomment the line below to enable link time optimization
#OPT += -flto

I have made a few changes to dfu at "...\nRF5_SDK_16.0.0_98a08e2\examples\dfu\secure_bootloader\pca10056_s140_ble\ses" regarding dfu button but not much.

I have checked my gcc version which is here:

C:\Users\Universal>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/8.2.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-8.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-8.2.0-3' --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-isl=/mingw --enable-libgomp --disable-libvtv --enable-nls --disable-build-format-warnings
Thread model: win32
gcc version 8.2.0 (MinGW.org GCC-8.2.0-3)

I am not sure what to do. If I need to change the gcc version how to do that, exactly which version to use with SDK16? The https://sourceforge.net/projects/mingw/ only gives latest version for download. BTW after making changes to bootloader code I had compiled the code in Segger Embedded Studio, does that make any difference?

Regards.

Related