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

DFU throw BLE and USB

Hi,

My project already has the ability to DFU throw BLE.

How can I add to it the Serial DFU throw USB ?

Is it possible to have one boot-loader that can handle both!?

If yes what parts I need to add from the USB_DFU_bootloade_example to my boot-loader?

Best Regards

JK

Parents Reply Children
  • Hi JK,

    jawadk said:
    I have no idea how to let the macro NRF_SECTION_ITEM_COUNT(dfu_trans, nrf_dfu_transport_t) return the number 2

    That is done automatically by the linker when you add nrf_dfu_serial_usb.c to your project (as the file contains DFU_TRANSPORT_REGISTER). You do not need to do anything else in that regard.

    jawadk said:
    or how to add the init function for the USB.

    That is also handled automatically. As long as you have all the required files in place and proper configuration in sdk_config.h (just refer to example USB bootloader for both, and adjust the bootloader start address to make everything fit, this should work by itself. The reason is that as long as the USB backend is registered (which happens automatically as described), the init function will be called automatically. There is literally no code changes required in the example bootloader at al, just a need to do what I have described.

    Einar

  • Hi,

    my application already handles the buttonless DFU throw BLE, what do I need to add to my application to handle it throw USB also !?

    Thanks for your help.

    Best Regards

    JK

  • Hi JK,

    You can support buttonless DFU over USB by adding the DFU Trigger Library in your application and calling nrf_dfu_trigger_usb_init() after initializing USB. See examples\connectivity\ble_connectivity\main.c for an example where that is done.

    Einar

Related