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 Secure DFU bootloader for BLE. I have created a private key and generated bootloader.hex file. I have created app.hex by merging bootloader, setting, soft device and main application code. Its work fine, I am able to DFU via NRF Connect app.

    Now I have seen same main.c for following project in my SDK.

    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_ble,
    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_uart

    To test BLE DFU, I have merged below project hex file.

    nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_buttonless_dfu

    Now, I am able to compile above both project successfully. I haven't seen any differences in main.c for the above two project.

    So for uart dfu bootloader, Can I use "pca10040_uart" hex file?

    Will it make my solution if I only want to check uart bootloader?

    Which application project I should merge with uart bootloader to check DFU for UART? 

    this one?

    UART DFU Master code: DFUMaster_UART.zip

    https://devzone.nordicsemi.com/cfs-file/__key/communityserver-blogs-components-weblogfiles/00-00-00-00-14/DFUMaster_5F00_UART.zip

    Guide me.

    Thanks for your support.

  • VIJAY said:
    Guide me.

     I'll try Slight smile

     

    VIJAY said:

    Now I have seen same main.c for following project in my SDK.

    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_ble,
    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_uart

     Yes. The main.c file for all the bootloaders is the same, which is good when you want to merge bootloaders. The only thing you need to do is to add the .c file that sets the DFU transport. 

    In fact, they use the very same main.c file, located in SDK\examples\dfu\secure_bootloader\main.c. You will see that if you change something in the main.c file in one of the projects, that change is applied to all the other bootloaders as well. 

    To test the UART bootloader, you can use the pca10040_uart project, yes. Remember that you may need to change the board file, as you would with any project using the BMD module. 

    On the Nordic nRF52832 DK, the UART pins P0.08 and P0.06 are routed through the debugger, and translated to UART over USB. Is it the same on your DK? You can test this by testing some of the UART examples from SDK\examples\peripheral. Alternatively, if you see UART logging in e.g. the SDK\examples\ble_peripheral\ble_app_hrs example, this is through the UART. 

    So you need to check that that is the same on your development board. I am not familiar with it. It needs a debugger that routes UART traffic to the DK in order to use the UART bootloader.

    BR,

    Edvin

Reply
  • VIJAY said:
    Guide me.

     I'll try Slight smile

     

    VIJAY said:

    Now I have seen same main.c for following project in my SDK.

    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_ble,
    nRF5_SDK_15.3.0_59ac345\examples\dfu\secure_bootloader\pca10040_uart

     Yes. The main.c file for all the bootloaders is the same, which is good when you want to merge bootloaders. The only thing you need to do is to add the .c file that sets the DFU transport. 

    In fact, they use the very same main.c file, located in SDK\examples\dfu\secure_bootloader\main.c. You will see that if you change something in the main.c file in one of the projects, that change is applied to all the other bootloaders as well. 

    To test the UART bootloader, you can use the pca10040_uart project, yes. Remember that you may need to change the board file, as you would with any project using the BMD module. 

    On the Nordic nRF52832 DK, the UART pins P0.08 and P0.06 are routed through the debugger, and translated to UART over USB. Is it the same on your DK? You can test this by testing some of the UART examples from SDK\examples\peripheral. Alternatively, if you see UART logging in e.g. the SDK\examples\ble_peripheral\ble_app_hrs example, this is through the UART. 

    So you need to check that that is the same on your development board. I am not familiar with it. It needs a debugger that routes UART traffic to the DK in order to use the UART bootloader.

    BR,

    Edvin

Children
No Data
Related