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

Parents
  • Hi, 

    What SDK version are you using?

    What is the SD version on the device?

    What is the command you used to generate the package? Please post the completed command. 

    Could you provide the log from the device? You can use the bootloader debug version to get the log. 

    Regards,
    Amanda

  • Hi Amanda,

    1. I use SDK version 17.1.0
    2. I use the softdevice S140 7.2.0
    3. nrfutil pkg generate --hw-version 52 --sd-req 0x100 --application-version 1 --application app.hex --key-file key.pem app_dfu_package.zip
    4. I have tried to get the log to run, but the required libraries do not fit in the flash memory (when I try, I get the error message: "region `FLASH' overflowed by 6504 bytes")

    I have attached the linker script I used.

    BR,

    Louis

    4628.secure_bootloader_gcc_nrf52.ld

     
  • Hi, 

    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.

    Seems your device doesn't get into DFU mode. In our serial bootloader examples, DFU mode is indicated by LED 3 being lit. If a valid application is installed on the device, hold Button 4 during startup to prevent the bootloader from starting the application and force it to enter DFU mode instead.

    See DFU mode:

    Make sure that the device enters DFU mode, then starts to update with the package. 

    -Amanda

  • 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

Reply Children
Related