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

no RESET after DFU

Module: ilumi H52 BLE module (nRF52832)
SDK: nRF5_SDK_15.3.0_59ac345
Softdevice: 132_nrf52_6.1.1_softdevice.hex
Compiler: gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (15:7-2018-q2-4)

I could get working DFU successfully using secure bootloader example and a combined upload package (bootloader + softdevice + application). DFU is initiated by setting GPREGRET Bit 0 to 1. After performing the DFU the new firmware works without any problems.

I'm using nRF Toolbox DFU to manage the DFU. After finishing the DFU process the message "Application has been transferred successfully" appears and the device restarts in DFU mode again.

I need to hard reset the device to get the application running. But would like to start the application automatically after DFU.

I've tried to clear GPREGRET in dfu_observer function, case NRF_DFU_EVT_DFU_COMPLETED. But it seems that NRF_DFU_EVT_DFU_COMPLETED is never executed.

case NRF_DFU_EVT_DFU_COMPLETED:
{
  ret_val = sd_power_gpregret_clr(0, 0xFFFFFFFF);
  APP_ERROR_CHECK(ret_val);

  ret_val = sd_power_gpregret_clr(1, 0xFFFFFFFF);
  APP_ERROR_CHECK(ret_val);

  NRF_LOG_INFO("-------> NRF_DFU_EVT_DFU_COMPLETED");

  LED_ON(LED_GREEN_PIN);
  nrf_delay_ms(2000);

  break;
}

FYI: flto option is not activated in Makefile

What could I check to figure out why reset doen't work properly and why NRF_DFU_EVT_DFU_COMPLETED is never executed?

Parents
  • <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0002E000, len=8 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x0002E000, pending 0
    <debug> app: Copying 0x4F000 to 0x2E000, size: 0x8000
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0002E000, src=0x0004F000, len=32768 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x0002E000, pending 0
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x200080E0, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
    <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x0007E000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007E000, src=0x20008460, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x0007E000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x00036000, len=8 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x00036000, pending 0
    <debug> app: Copying 0x57000 to 0x36000, size: 0x8000
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x00036000, src=0x00057000, len=32768 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x00036000, pending 0
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, src=0x200080E0, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
    <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x0007E000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007E000, len=1 pages), queue usage: 1
    ding 0
    <info> app: Inside main
    <debug> app: In nrf_bootloader_init
    <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    <debug> nrf_dfu_settings: Using settings page.
    <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <debug> app: App is valid
    <debug> app: DFU mode requested via GPREGRET.
    <info> nrf_bootloader_wdt: WDT is not enabled
    <debug> app: in weak nrf_dfu_init_user
    <debug> app: timer_stop (0x200057C4)
    <debug> app: timer_activate (0x200057C4)
    <info> app: Entering DFU mode.
    <debug> app: Initializing transports (found: 1)
    <debug> nrf_dfu_ble: Initializing BLE DFU transport
    <debug> nrf_dfu_ble: Setting up vector table: 0x00071000
    <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: ilumi_pa_lna_assist()
    <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.
    <debug> app: Enter main loop

  • Finally I could solve the problem.
    To enter the DFU mode I used to set GPREGRET = 0x01. That was wrong.
    No I set GPREGRET = BOOTLOADER_DFU_START = 0xB1 and it works.

Reply Children
No Data
Related