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

DFU Implementation Issues

I am attempting to implement buttonless DFU with my application.

Using SDK v12.2.0 on a Rigado BMD-300 module (nRF52832)

Starting one step at a time, using nRFgo Studio v1.21.2.10, I can completely erase the flash and program the secure_dfu_secure_dfu_ble_s132_pca10040_debug.hex softdevice/bootloader/application combo from \examples\dfu\bootloader_secure\pca10040_debug\hex.

I can even compile the \examples\dfu\bootloader_secure\pca10040_debug example with Keil uVision v5.23.0.0, then flash the 3.0.0 S132 softdevice with nRFgo Studio, then flash the bootloader/secure debug application that I compiled through the Keil J-Link interface.

Heck, I can even generate my own key pair with nrfutil and compile and flash the non-debug example.

The board fires up and I can see DfuTarg in nRF Toolbox as expected.

After this, I can successfully complete a DFU using the dfu_test_app_hrm_s132.zip archive from \examples\dfu\ble_dfu_send_hex\test_images_update_nrf52 (as I understand these examples are signed with the same private key used in the pca10040_debug project) which then works as expected with the nRF Toolbox HRM application.

My next step is to attempt to implement the experimental_ble_app_buttonless_dfu functionality.

As per the links from this recent question, regarding the char_md.char_props.write issue, I have ensured that char_md.char_props.write = 1 is present in the dfu_ctrl_pt_add() function in nrf_ble_dfu.c

Next, from Bjørn's advice at the other link I believe I need to adjust my target settings but we'll get back to those momentarily.

(SDK 13.0.0-1.alpha seems to have resolved these issues for the most part by the way)

Now, if I erase the flash, program the 3.0.0 S132 SD, then flash the compiled buttonless DFU application (no bootloader), everything goes as expected.

nRF Connect shows a device named Nordic_Template with a an unknown custom service with a single writable characteristic.

I have even been able to successfully implement the same service and characteristic alongside my own application code.

After this, everything goes South faster than a knife fight in a phone booth.

All I'd really like to do at this point is get these two puzzle pieces working in tandem, and for the life of me, I can't figure out how to do it...

With the bootloader and softdevice falshed I've tried flashing the buttonless dfu application code to the application space of the nRF52 (taking care to adjust the IROM target settings not to overwrite the SD or bootloader, which I can see is not the case with nRFgo Studio after flashing.) No dice.

I've also tried signing the buttonless DFU hex file with

nrfutil pkg generate --debug-mode --application nrf52832_xxaa.hex --key-file [path to private key]/private.pem buttonless_dfu_package.zip

nrfutil spits out a nice big warning telling me this will only work with a debug bootloader (which is what I'm using for now.)

Trying to DFU this image with nRF Toolbox (just like I successfully did with the dfu_test_app_hrm_s132.zip example file) simply aborts without the nice little uploading progress bar or anything. Again, no dice.

I have also tried all of this using the 3.1.0 S132 softdevice and have tried changing my Utilities settings to "Use External Tool for Flash Programming" with Command: nrfjprog.exe and Arguments: --reset --program "#H" --family NRF52 when flashing the bootloader to no avail.

Though I don't think that either of those is my problem.

I've read though all of the forum posts and documentation I can find on the subject and even reached out to some extremely helpful Rigado and Nordic field engineers with no luck.

Any assistance that anyone can offer would be greatly appreciated.

Related