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

How to implement DFU in NRF52 [BMD301] via BLE and UART Method simultaneously?

Hi,

  • I have used BMD301 BLE chip. I have connected one wifi chip "ESP02" with BMD301 chip via UART.
  • I am using nRF5_SDK_15.3.0_59ac345 for my ble application firmware.
  • Currently I have implemented DFU in my application firmware. I am able to update BMD301 firmware via NRF Connect app.
    It works fine. For that, I have used the below example for a bootloader.
    • Bootloader : nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_ble 
    • Main application firmware : nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_buttonless_dfu
  • Now I want to update BMD301 firmware via UART and BLE both.

As I have seen in SDK examples, There are some examples for bootloader.
nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_ble,
nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_uart

Can you guide me, How can I implement DFU in BMD301 via BLE and UART simultaneously?
What change I have to make in "sdk_config.h"? Please share all the required steps.

Thanks.

Parents
  • I'm out of time for today, but really quickly explained, you just need to add the transport .c and .h files to your bootloader project. Start with the ble bootloader project, and look for the .c/.h file that has the TRANSPORT_INIT or something function for uart in the serial bootloader project, then add these files to the ble bootloader project. Let me know if you can't find it.

    Best regards,

    Edvin

  • Thanks Edvin.

    I have checked, there are different transport files in the library. Can you guide me on which transport file I  should use?

    If possible I want to check uart bootloader first. Can you guide me for that?

    How can I test the UART bootloader? 

    How can I upload firmware BMD301 via UART?

    Which tool or software required for that? Guide me.

  • Hello,

    If you want both UART and BLE, I suggest you start with the BLE bootloader, because there is a lot more work and a lot more places to do the wrong thing when you are adding the softdevice, than when you add the UART. 

    Start with the pca10040_ble project, and add the file: nrf_dfu_serial_uart.c to your project. This contains the function:

    DFU_TRANSPORT_REGISTER(nrf_dfu_transport_t const uart_dfu_transport) =
    {
        .init_func  = uart_dfu_transport_init,
        .close_func = uart_dfu_transport_close,
    };

    Which does some magic things, so that the function nrf_dfu_transports_init() will pick it up in DFU_TRANS_SECTION_ITEM_GET(i);

    From there is pretty much plug and play.

     

    VIJAY said:
    How can I test the UART bootloader? 

     If you have never used the bootloader before, I suggest you check out this guide. Test the BLE first. Then, when you are ready for UART, test the standalone UART bootloader, and use nrfutil to generate the packet as described in the guide, and use nrfutil dfu serial ... to send the packet.

    Use the command nrfutil dfu serial --help to get some input parameter help.

    You can also check out the documentation of nrfutil, and how to use it here.

     

    VIJAY said:
    How can I upload firmware BMD301 via UART?

     You need to program the bootloader on the BMD301 with a programmer first (unless the producers of BMD have already pre-programmed a bootloader, in that case, you need to check with them). 

    When you have programmed the bootloader, you can use "nrfutil dfu ble ..." to perform a DFU.

     

    VIJAY said:
    Which tool or software required for that? Guide me.

     nrfutil. Check out the DFU getting started guide (the first link) for how to install and use it.

    Best regards,

    Edvin

Reply
  • Hello,

    If you want both UART and BLE, I suggest you start with the BLE bootloader, because there is a lot more work and a lot more places to do the wrong thing when you are adding the softdevice, than when you add the UART. 

    Start with the pca10040_ble project, and add the file: nrf_dfu_serial_uart.c to your project. This contains the function:

    DFU_TRANSPORT_REGISTER(nrf_dfu_transport_t const uart_dfu_transport) =
    {
        .init_func  = uart_dfu_transport_init,
        .close_func = uart_dfu_transport_close,
    };

    Which does some magic things, so that the function nrf_dfu_transports_init() will pick it up in DFU_TRANS_SECTION_ITEM_GET(i);

    From there is pretty much plug and play.

     

    VIJAY said:
    How can I test the UART bootloader? 

     If you have never used the bootloader before, I suggest you check out this guide. Test the BLE first. Then, when you are ready for UART, test the standalone UART bootloader, and use nrfutil to generate the packet as described in the guide, and use nrfutil dfu serial ... to send the packet.

    Use the command nrfutil dfu serial --help to get some input parameter help.

    You can also check out the documentation of nrfutil, and how to use it here.

     

    VIJAY said:
    How can I upload firmware BMD301 via UART?

     You need to program the bootloader on the BMD301 with a programmer first (unless the producers of BMD have already pre-programmed a bootloader, in that case, you need to check with them). 

    When you have programmed the bootloader, you can use "nrfutil dfu ble ..." to perform a DFU.

     

    VIJAY said:
    Which tool or software required for that? Guide me.

     nrfutil. Check out the DFU getting started guide (the first link) for how to install and use it.

    Best regards,

    Edvin

Children
No Data
Related