nRF52 DFU does not start

Hi everyone,

I am in the process of programming a DFU via UART. I currently have in memory only the softdevice including the MBR and the bootloader.
If I enter in nrfutil


nrfutil dfu serial -pkg app_dfu_package_blinky.zip -p COM5 -b 57600


I get the following all the time:


  [------------------------------------] 0%


So it seems that the update does not start. The application alone (i.e. without bootloader) runs without problems. When I flash the application and bootloader together, the application is also called directly by the bootloader. Only the firmware update does not seem to work. How can I solve the problem?

BR

Louis

  • Hi Amanda,

    I only have the softdevice and the bootloader in the flash memory, so the device should be in DFU mode anyway, right? I have also added the following code at the beginning of the main:

    nrf_power_gpregret_set(BOOTLOADER_DFU_START);


    But that didn't help either.
    I have attached a logic analyzer to the RX pin of the nRF and I noticed that when I start the DFU from the PC, nothing arrives at the PX pin.
    But if I send bytes to the nRF via a tool like Realterm, then I can see these bytes via the logic analyzer. The problem seems very strange to me.

    BR

    Louis

  • Hi, 

    Louis_263 said:
    I only have the softdevice and the bootloader in the flash memory, so the device should be in DFU mode anyway, right?

    Yes, it is supposed to.

    Is your uart bootloader able to update the other application without SD like the peripheral\blinky? Without the debug log, how do you know it can work or not? Did you try to adjust the flash start address of the bootloader to fix the FLASH overflowed?

    -Amanda

  • Hi,

    I changed the flash settings so the log could fit into the memory. This is the output of the log:

    00> <info> Inside main
    00> <debug> app: In nrf_bootloader_init
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> <warning> nrf_dfu_settings: Resetting bootloader settings since neither the settings page nor the backup are valid (CRC error).
    00> <debug> nrf_dfu_settings: Writing settings...
    00> <debug> nrf_dfu_settings: Erasing old settings at: 0x0003F000
    00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0003F000, len=1 pages), queue usage: 0
    00> <debug> nrf_dfu_flash: Flash erase success: addr=0x0003F000, pending 0
    00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0003F000, src=0x20004744, len=896 bytes), queue usage: 1
    00> <debug> nrf_dfu_flash: Flash write success: addr=0x0003F000, pending 0
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x3E000.
    00> <debug> nrf_dfu_settings: Writing settings...
    00> <debug> nrf_dfu_settings: Erasing old settings at: 0x0003E000
    00> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0003E000, len=1 pages), queue usage: 1
    00> <debug> nrf_dfu_flash: Flash erase success: addr=0x0003E000, pending 0
    00> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0003E000, src=0x200043C4, len=896 bytes), queue usage: 1
    00> <debug> nrf_dfu_flash: Flash write success: addr=0x0003E000, pending 0
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00> <info> app: No firmware to activate.
    00> <info> app: Boot validation failed. No valid app to boot.
    00> <debug> app: DFU mode because app is not valid.
    00> <info> nrf_bootloader_wdt: WDT is not enabled
    00> <debug> app: in weak nrf_dfu_init_user
    00> <debug> app: timer_stop (0x20002A58)
    00> <debug> app: timer_activate (0x20002A58)
    00> <info> app: Entering DFU mode.
    00> <debug> app: Initializing transports (found: 1)
    00> <debug> nrf_dfu_serial_uart: serial_dfu_transport_init()
    00> <debug> nrf_dfu_serial_uart: serial_dfu_transport_init() completed
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00> <debug> app: Enter main loop

    BR
    Louis

  • Hi,

    I figured out the problem. The problem was not with the firmware, but with the command of nrfutil. As soon as I add

    -prn 1

    as argument, the DFU works.
    Thanks anyway for your help :-)

    BR

    Louis

Related