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.

  • Hi Edvin,

    For testing I am using below development board which has the UART pins P0.08 and P0.06 

    https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide?view=all

    So you know  I want to test UART bootloder,

    I have compiled below example

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

    and take its hex file as bootloader.hex.

    Currently, I have merged bootloader.hex, softdevice, settings, and blinky_app.hex

    and just uploaded firmware using Segger Jlink EDU.

    It work fine and adverising as Nordic_blinky.

    I have generated zip file with softdevice or without soft device. then I have tried below command but thats not works.

    nrfutil dfu serial -pkg FW.zip -p COM3 -b 115200

    Can you guide me?

    Thanks.

     

  • VIJAY said:

    I have generated zip file with softdevice or without soft device. then I have tried below command but thats not works.

    nrfutil dfu serial -pkg FW.zip -p COM3 -b 115200

     What application are you trying to create the DFU image from, and what is the command that you use? You should use an example that uses the softdevice, and you don't need to include the softdevice in the DFU image. 

    So, what command did you use to generate the image, and what do you mean by "that not works"? What does it say when it doesn't work?

  • Hi Edvin,

    I am describing what I have done. See the below steps.

    I have attached zip file where I have list all scripts..

    Here added bootloader is

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

    I have run first 06_copy_buttonless_create_settings_merge_flash - FULL RESET WITH SD+BL.bat file first.

    I think after running this script, I could be able to update firmware via uart pins.

    Am I Right?

    I have two scripts to create a zip file of the firmware.

    03_create_fw_zip_package.bat,

    03b_create_fw_zip_package_noSD.bat 

    Above both scripts generare FW.zip file.

    at the end of above both scripts I have added one line to upload the same firmware via uart.

    nrfutil dfu serial -pkg FW.zip -p COM3 -b 115200

    I have connected this module via usb cable which port is COM3 in my case.

    https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide?view=all

    File created but not uploading.

    Let me know, Should I add any specific function or code to start uart boot loader mode in my main application. in current scenario, its below example I have used.

    Currently, I haven't added anything extra in below code.

    nRF5_SDK_15.3.0_59ac345\examples\ble_peripheral\ble_app_blinky

    PFA.

    nrf-upload-commands.zip

  • Ok, so let us focus on the noSD .bat script. To simplify, you are using the command:

    nrfutil pkg generate --application app.hex --application-version 1 --application-version-string "1.0.0" --hw-version 52 --sd-req 0xB7 --key-file private.pem FW.zip

    Right?

    Try removing the --application-version-string argument. 

    And I will ask one more time:

     

    Edvin said:
    what do you mean by "that not works"? What does it say when it doesn't work?

     Does nrfutil say anything? Or does it say: "sorry. It didn't work"?. Perhaps you can share a screenshot.

  • Hi Edvin,

    See the screenshot

    nrfutil dfu serial -pkg FW.zip -p COM3 -b 115200

    what do you mean by "that not works"? What does it say when it doesn't work?

    using above command , not be able to upload firmware via uart.

Related