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
  • Hi JK,

    Yes, you can have multippel transports at the same time in the nRF5 SDK bootloader. In principle you just need to add the USB transport implementation to the secure BLE project, but that also means that you must add any dependencies and configurations needed for USB (lock at the open USB bootloader to see which), and you need to adjust the start address and size of the bootloader to fit both. You should also make sure to handle the 32 kHz clock properly.

    Einar

  • Hi,

    I need help with that please.

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

    or how to add the init function for the USB.

    Best Regards

    JK

  • 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

Reply
  • 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

Children
Related