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

Official BLE and UART Combined DFU bootloader?

Hello,

I see a number of threads on the Nordic devzone where people are asking about official support for a DFU bootloader that combines BLE and UART for transports. Most of these posts lead to long discussions of debugging issues with manually combining the BLE and UART DFU examples.

Question 1: Has Nordic since created an official bootloader example that combines BLE and UART?

For the project I am working on, I am creating two bootloaders based on SDK 15.3:

  • BLE + UART
  • BLE + USB UART (COM port)

Question 2: I have read that for the traditional Nordic UART DFU examples, hardware flow control is required. Is this true? Our custom boards don't use hardware flow control nor have pins to support it.

Any help to jumpstart my development is greatly appreciated!

Thanks,

Derek

Parents
  • Hi Derek, 

    1. No, we don't have official bootloader example that combined the 2 transports. But the modification needed is minimal, you just need to include the transport .c and .h file and it should work. 

    2. Yes HWFC is needed, unless you use a very low baudrate, such as 9600bps. The reason is that the potential overflow when the CPU is halted when doing flash write and flash erase. 

  • Hey Hung,

    After hours of debugging, I am able to confirm that I successfully combined the BLE and UART DFU examples from SDK 15.3 and tested UART DFU of a 75KB application at 9600 baud. There were a few major things I needed to do in order to get it to work which are summarized below for anyone else who comes across this post:

    1. Allocate more flash space for the bootloader by moving the start address up.

    2. Set NRF_DFU_PROTOCOL_REDUCED to 0 in sdk_config.h   (Otherwise the DFU transfer will fail on UART)

    See this thread for details on #2: https://devzone.nordicsemi.com/f/nordic-q-a/60124/how-to-add-buttonless_dfu-and-serial_dfu-functions-at-the-same-time/245977

    3. If not using hardware flow control, set NRF_DFU_SERIAL_UART_USES_HWFC to 0 in sdk_config.h and reduce the baud rate of the UART to 9600.

    4. Don't use nRF Command Line Tools version 10.12.1 (Latest release as of 3/3/21) because mergehex.exe in this release is broken. Details: devzone.nordicsemi.com/.../latest-mergehex-output-fails-to-be-programmed-mergehex-9-8-1-produces-different-hex-than-10-12-1

    While I am at it, if anyone is looking to debug the SDK 15.3 bootloader using Keil uVision refer to this thread: https://devzone.nordicsemi.com/f/nordic-q-a/45910/debugging-serial-uart-bootloader-sdk-15-3

    My next step is to integrate the USB transport. Hopefully this will be much easier now that I have overcome the above hurdles.

    Thanks for your help!

    Edit:

    For those looking to merge the USB CDC ACM transport with the BLE transport, make sure the USB DFU file is compiled before the BLE DFU file, otherwise the USB transport will fail to initialize because the power module was previously initialized by the SoftDevice. This ensures that the USB transport module registers before the BLE module transport.

    To do this in Keil, make sure the files in your project list are in this order:

    Project Window Top

    nrf_dfu_serial_usb.c: common\components\libraries\bootloader\serial_dfu\nrf_dfu_serial_usb.c

    nrf_dfu_ble.c: common\components\libraries\bootloader\ble_dfu\nrf_dfu_ble.c

    To better demonstrate:

Reply
  • Hey Hung,

    After hours of debugging, I am able to confirm that I successfully combined the BLE and UART DFU examples from SDK 15.3 and tested UART DFU of a 75KB application at 9600 baud. There were a few major things I needed to do in order to get it to work which are summarized below for anyone else who comes across this post:

    1. Allocate more flash space for the bootloader by moving the start address up.

    2. Set NRF_DFU_PROTOCOL_REDUCED to 0 in sdk_config.h   (Otherwise the DFU transfer will fail on UART)

    See this thread for details on #2: https://devzone.nordicsemi.com/f/nordic-q-a/60124/how-to-add-buttonless_dfu-and-serial_dfu-functions-at-the-same-time/245977

    3. If not using hardware flow control, set NRF_DFU_SERIAL_UART_USES_HWFC to 0 in sdk_config.h and reduce the baud rate of the UART to 9600.

    4. Don't use nRF Command Line Tools version 10.12.1 (Latest release as of 3/3/21) because mergehex.exe in this release is broken. Details: devzone.nordicsemi.com/.../latest-mergehex-output-fails-to-be-programmed-mergehex-9-8-1-produces-different-hex-than-10-12-1

    While I am at it, if anyone is looking to debug the SDK 15.3 bootloader using Keil uVision refer to this thread: https://devzone.nordicsemi.com/f/nordic-q-a/45910/debugging-serial-uart-bootloader-sdk-15-3

    My next step is to integrate the USB transport. Hopefully this will be much easier now that I have overcome the above hurdles.

    Thanks for your help!

    Edit:

    For those looking to merge the USB CDC ACM transport with the BLE transport, make sure the USB DFU file is compiled before the BLE DFU file, otherwise the USB transport will fail to initialize because the power module was previously initialized by the SoftDevice. This ensures that the USB transport module registers before the BLE module transport.

    To do this in Keil, make sure the files in your project list are in this order:

    Project Window Top

    nrf_dfu_serial_usb.c: common\components\libraries\bootloader\serial_dfu\nrf_dfu_serial_usb.c

    nrf_dfu_ble.c: common\components\libraries\bootloader\ble_dfu\nrf_dfu_ble.c

    To better demonstrate:

Children
Related