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
  • Update:
    I was able to solve the problem regarding the USB DFU. Turns out, the project I was working on was modified in the past, and it was broken. I used clean SDK USB bootloader example, along with some logic in my main app to trigger USB DFU, write to GPREGRET and perform system restart, after which I'm able to perform USB DFU. 

    After I successfully implemented USB DFU I tried combining BLE and USB bootloaders.

    As I said, I'm using BLE bootloader as a starting point, and I'm including files from the USB bootloader example, along with sdk_config.h defines. (I couldn't include following files: nrf_soc.c and nrf_nvic.c along with include path /components/drivers/nrf/nrf_soc_nosd. Also I had to set the following config in sdk_config.h:

    NRF_DRV_PROTOCOL_REDUCED 0 )

    I modified Section placement macros to: FLASH_START = 0xf0000 and FLASH_SIZE = 0xf000 and I was able to build the solution..

    Everything else is the same as in the secure_bootloader/pca10056_s140_ble example.

    When I merge bootloader, settings file, softdevice and the app .hex files and when I flash the merged file onto the nRF52840 application starts as it should, everything works fine. However I can't enter DFU mode from the bootloader, I've tried entering through:

    • BLE DFU via nRF Connect mobile app
    • USB DFU via nrfutil in terminal
    • Also I've tried pressing BUTTON4 while performing reset (BUTTON entry method is enabled in the bootloader and the BUTTON4 is selected), but it won't enter DFU mode, it goes straight to the application. (If I'm holding the reset button with Button4 LED0 and LED1 are blinking as long as I keep holding the buttons)

    Also, I've tried with clean BLE bootloader from SDK, and BLE DFU works fine (even with NRF_DRV_PROTOCOL_REDUCED set to 0)

    Could you please guide me on how to combine these bootloaders?

Reply
  • Update:
    I was able to solve the problem regarding the USB DFU. Turns out, the project I was working on was modified in the past, and it was broken. I used clean SDK USB bootloader example, along with some logic in my main app to trigger USB DFU, write to GPREGRET and perform system restart, after which I'm able to perform USB DFU. 

    After I successfully implemented USB DFU I tried combining BLE and USB bootloaders.

    As I said, I'm using BLE bootloader as a starting point, and I'm including files from the USB bootloader example, along with sdk_config.h defines. (I couldn't include following files: nrf_soc.c and nrf_nvic.c along with include path /components/drivers/nrf/nrf_soc_nosd. Also I had to set the following config in sdk_config.h:

    NRF_DRV_PROTOCOL_REDUCED 0 )

    I modified Section placement macros to: FLASH_START = 0xf0000 and FLASH_SIZE = 0xf000 and I was able to build the solution..

    Everything else is the same as in the secure_bootloader/pca10056_s140_ble example.

    When I merge bootloader, settings file, softdevice and the app .hex files and when I flash the merged file onto the nRF52840 application starts as it should, everything works fine. However I can't enter DFU mode from the bootloader, I've tried entering through:

    • BLE DFU via nRF Connect mobile app
    • USB DFU via nrfutil in terminal
    • Also I've tried pressing BUTTON4 while performing reset (BUTTON entry method is enabled in the bootloader and the BUTTON4 is selected), but it won't enter DFU mode, it goes straight to the application. (If I'm holding the reset button with Button4 LED0 and LED1 are blinking as long as I keep holding the buttons)

    Also, I've tried with clean BLE bootloader from SDK, and BLE DFU works fine (even with NRF_DRV_PROTOCOL_REDUCED set to 0)

    Could you please guide me on how to combine these bootloaders?

Children
No Data
Related