This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU bootloader resets

I use SDK15 and S132. I have examples\dfu\secure_bootloader\pca10040_ble loaded in my board. I can see it advertising when there is not valid app loaded.

Also, my app with ble butonless dfu service, when it it loaded together with settings file using nrfjprog -f NRF52 --program settings.hex --sectorerase previously generated by nrfutil, works.

The bootloader settings of my app looks like:

Bootloader DFU Settings:
* File: settings.hex
* Family: nRF52
* Start Address: 0x0007F000
* CRC: 0x83842E94
* Settings Version: 0x00000001 (1)
* App Version: 0x00000001 (1)
* Bootloader Version: 0x00000001 (1)
* Bank Layout: 0x00000000
* Current Bank: 0x00000000
* Application Size: 0x00029930 (170288 bytes)
* Application CRC: 0xFE9E2E33
* Bank0 Bank Code: 0x00000001
* Softdevice Size: 0x00000000 (0 bytes)
* Boot Validation CRC: 0x00000000
* SD Boot Validation Type: 0x00000000 (0)
* App Boot Validation Type: 0x00000000 (0)

I then create update package using nrfutil pkg generate --hw-version 52 --sd-req 0xA8,0xAF,0xB7 --application-version 2 --application nrf5.hex --key-file priv.pem app_dfu_package.zip:

DFU Package: <app_dfu_package.zip>:
|
|- Image count: 1
|
|- Image #0:
|- Type: application
|- Image file: nrf5.bin
|- Init packet file: nrf5.dat
|
|- op_code: INIT
|- signature_type: ECDSA_P256_SHA256
|- signature (little-endian): e2e2bbfc7cfb8e2e7039e8482424e6a1359c40f8f869b36b60ce72735cee14353ac691f0782172248f7da3732159570b4d3363cd3d385fb4e49c2140210613aa
|
|- fw_version: 0x00000002 (2)
|- hw_version 0x00000034 (52)
|- sd_req: 0xA8, 0xB7, 0xAF
|- type: APPLICATION
|- sd_size: 0
|- bl_size: 0
|- app_size: 170208
|
|- hash_type: SHA256
|- hash (little-endian): 67e65daaafc9c59a38e2044c52459ab5f71bdb9298268d43c96df5311d6b55dc
|
|- boot_validation_type: ['VALIDATE_GENERATED_CRC']
|- boot_validation_signature (little-endian): ['']
|
|- is_debug: False

I use nrf Connect v2.6.1 on Windows 10 to run DFU update. It connects to my device with buttonless dfu service and I can initiate dfu update. After a while the update ends with error: ERROR DFU failed with error: When writing 'EXECUTE' command to Control Point Characteristic of DFU Target: Timed out while waiting for response to operation code 4 (EXECUTE).

I can see my device restarts with old app running several seconds before the error is displayed.

This is log from nrf connect: http://mysharegadget.com/744176722 

Parents Reply
  • I discovered the problem. I migrated your original GCC makefile to VisualGDB project and it seems some ASMFLAGS or CFLAGS or LDFLAGS were missing (even though bootloader's project basis is my app project which runs without any issue). Because I copied all these from your original makefile to my VisualGDB's makefile and it works now. I will now try figure out the specific flag that caused the problem. Thanks you.

Children
No Data
Related