Hard Fault in ble_dfu_unbounded.c from SDK 17.1.0 (secure bootloader)

Hi!

I'm using some common bootloader code for different devices. 
One of my devices is a bit different, with an LED library that caused me to increase the BL size in the linker. 
This is not happening on my other devices, which is why I mentioned the different linker.
2 of them also have a modified linker for a small LCD driver. Those work great!

When I debug the application jumping to bootloader with NRF DFU IOS app, 
I get a hard fault in nrf_dfu_set_adv_name(). Name should be "DfuTarg", from my bootloader make file

CFLAGS += -DDEVICE_NAME=\"DfuTarg\" -DNRF_DFU_BLE_ADV_NAME=\"DfuTarg\"
CFLAGS += -DNRF_DFU_DEBUG_VERSION
CFLAGS += -DNRF_DFU_SETTINGS_VERSION=2
CFLAGS += -DNRF_DFU_SVCI_ENABLED
In my application makefile 
CFLAGS += -DNRF_DFU_SVCI_ENABLED -DNRF_DFU_TRANSPORT_BLE=1
CFLAGS += -DNRF_DFU_SETTINGS_VERSION=2

As you can see here, Dfu31280 is showing up instead of DfuTarg, 

Here is the call stack, HardFault is where the PC indicates inside NMI_Handler

  • Interesting. Is there any delay between when the bootloader starts and when advertising begins in your version? The app will time out if advertising does not start within 10 seconds. 

    It is also possible to test DFU without the adv. name change by disabling this configuration here: 


  • No delay. I see the blootloader RTT console immediately advertising.
    I tried turning off the alternative advertising mode - DfuTarg is showing up after the failure and I can connect to it. 

    <debug> nrf_dfu_ble: Initializing BLE DFU transport
    <debug> nrf_dfu_ble: Setting up vector table: 0x000F0000
    <debug> nrf_dfu_ble: Enabling SoftDevice.
    <debug> nrf_dfu_ble: Configuring BLE stack.
    <debug> nrf_dfu_ble: Enabling the BLE stack.
    <debug> nrf_dfu_ble: No advertising name found
    <debug> nrf_dfu_ble: Using default advertising name
    <debug> nrf_dfu_ble: Advertising...
    <debug> nrf_dfu_ble: BLE DFU transport initialized.
    <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.

    nRF console log

    [10:42:11.9130] Normal: Services discovered
    [10:42:11.9130] Normal: Secure DFU Service found
    [10:42:11.9130] Normal: Discovering characteristics in DFU Service...
    [10:42:11.9130] Normal: DFU characteristics discovered
    [10:42:11.9130] Normal: Enabling indications for 8EC90003-F315-4F60-9FB8-838830DAEA50...
    [10:42:11.9550] Normal: Indications enabled for 8EC90003-F315-4F60-9FB8-838830DAEA50
    [10:42:11.9550] Normal: Buttonless DFU indications enabled
    [10:42:11.9550] Warning: Application with buttonless update found
    [10:42:11.9550] Normal: Writing to characteristic 8EC90003-F315-4F60-9FB8-838830DAEA50...
    [10:42:12.1060] Normal: Data written to 8EC90003-F315-4F60-9FB8-838830DAEA50
    [10:42:12.1070] Normal: Indication received from 8EC90003-F315-4F60-9FB8-838830DAEA50, value (0x):200101
    [10:42:12.1070] Normal: Response (Op Code = Enter Bootloader, Status = Success) received
    [10:42:12.8750] Normal: Disconnected.
    [10:42:12.8750] Normal: Disconnected by the remote device
    [10:42:12.8750] Normal: Scanning for the DFU Bootloader...
    [10:42:22.8760] Warning: Scanning timed out returning no matching peripherals!
    [10:42:22.8770] Error: DFU Failed with Error: No DFU device found.

  • I'm going to restart with a fresh bootloader. 

Related