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!

  • can you take acess of my pc and help it is much needed as i am struck

  • I'm sorry, I can't do that right now. Here are the key steps that you need to take:

    • Build your main application
    • Build the bootloader
    • Copy the bootloader hex and the main application hex and put them in the same folder
    • Use the nrfutil to create settings file (as shown in the example below)

    nrfutil settings generate --family NRF52840 --application ble_app_cli_pca10056_s140.hex --application-version 0 --bootloader-version 0 --bl-settings-version 2 bl_setting.hex
    

    • Use the mergehex to combine settings, bootloader, application and the softdevice (it must be done in 2 steps as shown in the example following)

    mergehex --merge bl_setting.hex secure_bootloader_usb_mbr_pca10056.hex s140_softdevice.hex --output bl_set_s140.hex
    mergehex --merge bl_set_s140.hex ble_app_cli_pca10056_s140.hex --output bl_set_s140_app.hex
    

    • Use the nRF Connect programmer to flash the device with bl_set_s140_app.hex file (your app should be working now on the device, and the next step is to perform DFU)
    • Make needed changes in your main app and perform build. Use the new resulting application hex file to create .zip package with the following command:

    nrfutil pkg generate --application ble_app_cli_pca10056_s140.hex --application-version-string "2.0.0" --hw-version 52 --sd-req 0xCA --key-file C:\Users\Em\Downloads\Milestone-1\DFU-test\private.key app_v2.zip

    • Use the .zip package to perform the DFU

    (Example commands that I have provided is used for applications that are based on s140 SD)

    This all I can help you with. If this doesn't work for you, you have failed to install required software and libraries, go through the installation process again.

  • and just to be clear the answer to this problem is to move your files around so USB related DFU files (nrf_dfu_serial.c and nrf_dfu_serial_usb.c) before the ble dfu files (nrf_dfu_ble.c)  Took me hours to track down what in the world was going on.  Since this is actual problem I would definitely recommend that Nordic update the transport init to be in the required order if more than one is present.

Related