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

nRF52810 buttonless DFU issues

Hello ...

I'm adding buttonless DFU support to my nRF52810 application using the instructions here. I'm using SDK 15.3.0, SD 112 6.1.1.

First question: These instructions state that use of Peer Manager is a prerequisite. If my application does not use bonding, is Peer Manager still a prerequisite?

I was successful in adding buttonless DFU support to the ble_app_blinky example application. Generally, I followed these steps:

1. Generated private/public key pair.

2. Replaced dfu_public_key.c for the example secure bootloader project at: <nRF5 SDK Folder>/examples/dfu/

3. Built application <nRF5 SDK Folder>/examples/dfu/secure_bootloader/pca10040e_ble/ses/secure_bootloader_ble_s112_pca10040e.emProject

4. Updated the ble_app_blinky example app according to Nordic instructions (added dfu .c files to project, added preprocessor definitions, added include directories, made changes to sdk_config.h, added includes and source additions to main.c).

5. Built ble_app_blinky with added buttonless DFU support.

6. Generated the bootloader settings file using nrfutil for the application ble_app_blinky_pca10040e_s112.hex

7. Using mergehex, merged the bootloader settings, bootloader and softdevice together.

8. Merged the output of 7 with the application.

9. Used nrfjprog to erase, program and reset the nRF52 dev kit.

10. Using nRF Connect (mobile for iOS v2.1.1) I verified that the secure DFU service is available.

11. Then I created a version 2 of the ble_app_blinky application (I just changed which LED is turned on when connected via BLE).

12. Created a DFU package for the new application (--application-version 2 --hw-version 52 --sd-req 0xB8).

13. I transferred the package from 12 to my iOS device, then used nRF Connect (mobile) to connect to the nRF52 dev kit and perform a DFU using the package from 12. All worked well.

Then ... I proceeded to follow the same steps to add buttonless DFU support to my own BLE application. My BLE application is the ble_app_uart example app with uart stripped out and TWIM added. The hex file for the built application is 158K.

After programming the dev kit with the bootloader settings + bootloader + v1 of application, I created version 2 of the application, created the DFU package, transferred to my iOS device and tried to DFU to the dev kit. I get timeout error for Data object 2/14. I've attached the nRF Connect mobile log. I tried the same using nRF Connect desktop (macOS, Bluetooth Low Energy v2.3.2). I've attached log for that as well.

This is new learning for me. Appreciate any guidance.

Thanks,

Tim

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
00:16:30.942 Application data folder: /Users/timsenger/Library/Application Support/nrfconnect/pc-nrfconnect-ble
00:16:36.099 Validating connectivity firmware for device with serial number 000682909244...
00:16:44.487 Connectivity firmware is valid.
00:16:44.488 Note: Adapters with Segger JLink debug probe requires MSD to be disabled to function properly on MacOS and Linux. Please visit www.nordicsemi.com/nRFConnectOSXfix for further instructions.
00:16:44.488 Getting information from J-Link debugger...
00:16:45.011 Found device type: unknown. J-Link firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 7 2019 14:07:15.
00:16:45.011 Connectivity firmware version: 4.1.1. SoftDevice API version: 3. Baud rate: 1000000.
00:16:45.012 Opening adapter connected to /dev/tty.usbmodem1421
00:16:45.939 Successfully opened /dev/tty.usbmodem1421. Baud rate: 1000000. Flow control: none. Parity: none.
00:16:45.940 Reset performed on adapter /dev/tty.usbmodem1421
00:16:47.011 Adapter connected to /dev/tty.usbmodem1421 opened
00:16:52.685 Scan started
00:16:55.268 Connecting to device
00:16:55.492 Connected to device F8:19:52:5B:2D:9E
00:16:55.509 ATT MTU changed, new value is 247
00:16:55.715 Attribute value read, handle: 0x03, value (0x): 62-65-61-6D-20-38
00:17:35.160 Disconnected from device F8:19:52:5B:2D:9E, reason: undefined
00:17:35.162 Performing DFU with file: /Users/timsenger/Documents/my_buttonless_dfu/my_app_v2.zip
00:17:35.549 Attribute value changed, handle: 0x17, value (0x): 02-00
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
File Name: my_app_v2.zip
Parts: 1
Application Size: 56 KB
Soft Device Size: Zero KB
Bootloader Size: Zero KB
[Callback] Central Manager did update state to: Powered ON
Connecting to device 8...
centralManager.connect(peripheral, options: nil)
[Callback] Central Manager did connect peripheral
Connected to device 8
Discovering services...
peripheral.discoverServices(nil)
Services discovered
Starting Secure DFU...
Connected to device 8
Services discovered
Secure DFU Service found
Discovering characteristics in DFU Service...
peripheral.discoverCharacteristics(nil, for: FE59)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX