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

USB DFU combined with Buttonless BLE DFU

Hi

I am working with nRF52840 DK  v2.0.1, in SDK 17.0.2., trying to implement combined BLE+USB DFU in my application.

First I tried combining bootloaders from SDK (secure_bootloader/pca10056_s140_ble and secure_bootloader/pca10056_usb), and I used pca10056_s140_ble  as starting point.

I imported all files that are in the pca10056_usb bootloader, along with all skd_config.h definitions and include paths. Also, I changed flash start and flash size, to fit new bootloader into the flash memory.

In my main application, I tried using USB DFU trigger library, to trigger USB DFU (BLE DFU was already implemented before but now it doesn't work)

I connected P0.05 to P.018, as required by the library, and I've enabled PINRESET entry mode in the bootloader sdk_config.h.

Can anyone tell me what am I missing here? The application works fine, I'm using BLE, UART and USB CLI, It's just won't go into DFU mode.

I would appreciate if someone could tell me steps required to combine two bootloaders, and including these bootloaders into the main application?

Thanks!

Parents
  • Another update:

    I tried the same approach in secure_bootloader/pca10056_s140_ble_debug and secure_bootloader/pca10056_s140_usb_debug examples, to see what is really going on. Here is the log in terminal:

    <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.
    <warning> nrf_dfu_settings: Resetting bootloader settings since neither the settings page nor the backup are valid (CRC error).
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x000FF000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FF000, len=1 pages), queue usage: 0
    <debug> nrf_dfu_flash: Flash erase success: addr=0x000FF000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FF000, src=0x2000A730, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x000FF000, pending 0
    <info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x000FE000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FE000, len=1 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x000FE000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FE000, src=0x2000AAB0, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x000FE000, pending 0
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <info> app: Boot validation failed. No valid app to boot.
    <debug> app: DFU mode because app is not valid.
    <info> nrf_bootloader_wdt: WDT is not enabled
    <debug> app: in weak nrf_dfu_init_user
    <debug> app: timer_stop (0x2000599C)
    <debug> app: timer_activate (0x2000599C)
    <info> app: Entering DFU mode.
    <debug> app: Initializing transports (found: 2)
    <debug> nrf_dfu_ble: Initializing BLE DFU transport
    <debug> nrf_dfu_ble: Setting up vector table: 0x000E0000
    <debug> nrf_dfu_ble: Enabling SoftDevice.
    <error> app: Received a fault! id: 0x00004002, pc: 0x00000000, info: 0x2003FF30

    Seams like the Softdevice is not being enabled. I don't know what is the problem, though. 

Reply
  • Another update:

    I tried the same approach in secure_bootloader/pca10056_s140_ble_debug and secure_bootloader/pca10056_s140_usb_debug examples, to see what is really going on. Here is the log in terminal:

    <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.
    <warning> nrf_dfu_settings: Resetting bootloader settings since neither the settings page nor the backup are valid (CRC error).
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x000FF000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FF000, len=1 pages), queue usage: 0
    <debug> nrf_dfu_flash: Flash erase success: addr=0x000FF000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FF000, src=0x2000A730, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x000FF000, pending 0
    <info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
    <debug> nrf_dfu_settings: Writing settings...
    <debug> nrf_dfu_settings: Erasing old settings at: 0x000FE000
    <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x000FE000, len=1 pages), queue usage: 1
    <debug> nrf_dfu_flash: Flash erase success: addr=0x000FE000, pending 0
    <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x000FE000, src=0x2000AAB0, len=896 bytes), queue usage: 1
    <debug> nrf_dfu_flash: Flash write success: addr=0x000FE000, pending 0
    <debug> app: Enter nrf_bootloader_fw_activate
    <info> app: No firmware to activate.
    <info> app: Boot validation failed. No valid app to boot.
    <debug> app: DFU mode because app is not valid.
    <info> nrf_bootloader_wdt: WDT is not enabled
    <debug> app: in weak nrf_dfu_init_user
    <debug> app: timer_stop (0x2000599C)
    <debug> app: timer_activate (0x2000599C)
    <info> app: Entering DFU mode.
    <debug> app: Initializing transports (found: 2)
    <debug> nrf_dfu_ble: Initializing BLE DFU transport
    <debug> nrf_dfu_ble: Setting up vector table: 0x000E0000
    <debug> nrf_dfu_ble: Enabling SoftDevice.
    <error> app: Received a fault! id: 0x00004002, pc: 0x00000000, info: 0x2003FF30

    Seams like the Softdevice is not being enabled. I don't know what is the problem, though. 

Children
No Data
Related