DFU reconnect problem

sejlau gravatar image

asked 2017-04-21 12:13:05 +0100


I am having trouble with DFU. When I try to send new application via NrfConnect, device goes to bootloader, but file transfer is not starting. Only when I reconnect and try again, while device is in bootloader, transfer goes through. DFU code for bootloader and main application is taken from ble_app_hrs.

I have seen similar errors on forums all around, but it was not helpful.

Processor is nrf51822QFAA Softdevice: s130 v2.0.1 nrfConnect: v4.11.0 for Android Phone/Android: Nexus 6p, 7.1.2

This is log file of nrfConnect before entering bootloader: before_bootloader.txt

And this is log file of nrfConnect after reconnecting while device is in bootloader: while_in_bootloader.txt

I will appreciate any suggestion. Thank you in advance.

Best regards

edit retag flag offensive close delete report spam


Which SDK version are you using?

Bjørn Spockeli ( 2017-04-21 13:48:59 +0100 )editconvert to answer

I am using SDK 12.2.0. Programming in Keil v5

Sejl ( 2017-04-21 13:50:59 +0100 )editconvert to answer

You're using the DFU button in the upper right corner to perform DFU right? You not writing to the control point characteristic manually. Furthermore, since you're using the nRF51822 QFAA, have you adjusted the IRAM settings so that they correspond to 16kB of RAM and not 32kB? (The SDK examples are designed for the QFAC variant).

Bjørn Spockeli ( 2017-04-21 14:14:15 +0100 )editconvert to answer

Yes, I am using DFU button. IRAM/IROM settings are as follows:

Application: IROM1: 0x1B000/0x24000 IRAM1: 0x20002800/0x1800 (noinit deselected)

Bootloader: IROM1: 0x3C000/0X4000 IRAM1: 0x20002800/0x1780 (noinit deselected) IRAM2: 0x20003F80/0x80 (noinit selected)

Sejl ( 2017-04-21 14:20:27 +0100 )editconvert to answer

Are you sure that you're using the bootloader from SDK v12.2.0? The Secure bootloader does not have any IRAM2 section. I have attached a screenshot of the correct settings below image description

Bjørn Spockeli ( 2017-04-21 14:34:31 +0100 )editconvert to answer

Well, I am using softdevice s130 v2.0.1 from SDK v12.2.0, everything else is from SDK v11.0.0. Of course, I have updated softdevice headers and source files. I will try to go back to S130 from SDK v11 just to test if it is working with older version.

Sejl ( 2017-04-21 15:36:52 +0100 )editconvert to answer

I have tried with SDK 11.0.0 and S130 v2.0.0. Same thing. Can we try to debug this using SDK 11? I don't need secure DFU, and all code is already written for S130 v2.0.0.

Btw, thank you for helping me :)

Sejl ( 2017-04-21 15:51:13 +0100 )editconvert to answer

Sure, if you're using SDK v11.0.0, then you'll have to set the following memory settingsimage description

Bjørn Spockeli ( 2017-04-21 16:54:21 +0100 )editconvert to answer

Ok, just to confirm memory settings:

IROM1: 0x3C000/0x3C00
IRAM1: 0x20002C00/0x1380
IRAM2: 0x20003F80/0x80 (noinit)

IRAM1: 0x1B000/0x21000
IROM1: 0x20002800/0x1800

Is this correct?

Sejl ( 2017-04-21 17:13:21 +0100 )editconvert to answer

Yes, those values look correct.

Bjørn Spockeli ( 2017-04-21 17:53:30 +0100 )editconvert to answer

Ok. I have tried, but with no success. I guess problem is somewhere in code.

I am using UICR_ADDR_0x84 and 0x88 for holding info about device serial number; do you thing this could mess things with DFU?

Another thing is - DFU procedure correctly starts bootloader, and bootloader correctly carries on DFU update. Only thing missing is detection of active bootloader from the nrfConnect side. Somwhere I have read that this is maybe due to different address of bluetooth device while in bootloader. How can I send info to DFU to expect different device address?

Sejl ( 2017-04-21 18:19:12 +0100 )editconvert to answer

1 answer

Sort by » oldest newest most voted
sejlau gravatar image

answered 2017-04-22 10:51:06 +0100

I found it. Problem was in bootloader. File dfu_ble_svc.c has to be configured in Keil in following manner: Right click on file, select "options for dfu_ble_svc.c" and set IRAM2 for Zero Initialized Data.

Hopefully, someone will find this helpful :)

Bjorn, thank you again for patience! Have a beautiful weekend!

Best regards, Sejl

edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

Question Tools

1 follower


Asked: 2017-04-21 12:13:05 +0100

Seen: 57 times

Last updated: april 22