This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Buttonless DFU only works once with gcc compiled app

I am trying to get buttonless DFU via BLE to work with gcc compiled apps, but it only works on the first DFU attempt. Every repeated attempt after that is timed out after bootloader has started. Master Control Panel on Android states "Starting DFU", but the transfer is never started.

The strange thing is that this only happens with gcc compiled apps. Apps compiled in Keil works every time.

A bit more details: HW: nRF51822-QFAA-G0 SDK: 6.1 Bootloader built in Keil (standard SDK example). HRS app with DFU built with gcc (hereafter called HRS_gcc).

Eraseall -> Program softdevice 7.0 -> Program bootloader -> Reset. DFUTarg is now running and shows up in MCP. Connect -> press DFU button -> select HRS_gcc app -> Upload. Upload works perfectly. Now the HRS_gcc app is connected -> press DFU button -> select HRS_gcc app again (also tried with other apps) -> Upload -> bootloader restarts as it should -> connecting -> "Starting DFU" -> Nothing happens for a while -> disconnect (different error messages in logg, like GATT_ERROR) -> now the device hangs.

But when I run the same thing with the same app built in Keil it works every time.

I have tried to debug what happens in the bootloader, but without success so far. I have tried with different versions of gcc, the sdk, the softdevice, ... I am pretty sure I am doing something stupid as there seems to be people that has gotten this to work (by reading posts), but I can not find out what.

Anybody seen something similar?

Related