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

Firmware update (DFU) from server or cloud.

Hello to all,

We are using nRF52840 with SDK v15.0 using SES, Our application is we have sensor devices with interface WiFi module. Sensor device will wake up as predefined time interval and send data to cloud using WiFi connectivity. 

Now we want to update this sensor devices firmware from server. Currently we are able to update firmware using secure_ble via android app. But our requirements and few questions as below:

  1. How I can download program zip file from server using WiFi and store it in flash memory? (We know how to store data array into flash using FDS but not understand how to store and read this zip file in nordic internal flash)
  2. What is best way to do as per following flow:

get zip file from sever --> store in flash --> switch application to DFU / boot-loader mode using button less --> read this file from flash --->send this file for upgrade firmware and replace with existing firmware.

For implement as per above will you please provide me sample example code and some tutorial for how to do that?

Looking forward your response..!!!

Thanks in Advanced..!!

  • Thanks for great information..!!

    Regarding your ans of my 1 point will you please provide me sample example program snippet OR useful tutorial links.

    How I can send multiple request to the server in DFU mode for that should I need to implement server connectivity program in our existing boot-loader program. Because to get Firmware image without BLE connection. 

    Thanks........

  • How you implement this will depend on the Wifi module you use and how the server is set up. I'm afraid I don't have enough information or knowledge to help you with that part. 

    vishal said:
    How I can send multiple request to the server in DFU mode for that should I need to implement server connectivity program in our existing boot-loader program. Because to get Firmware image without BLE connection. 

    The DFU is handled by the application in this case, the bootloader is only responsible for activating the new image. So the bootloader will not require support for Wifi connectivity. 

  • Hi Vidar,

    I have stored binary raw data of program zip into nRF52840 internal flash memory. Switch device into DFU mode and in DFU main.c file I have added fds.c and fds.h libraries to read this stored file from internal flash memory.

    Now I read this program zip from flash using specific file_ID and address in DFU mode. To implement next I am little bit confused and some questions:

    1. Where should i need to send this zip file buffer in dfu_request_handler?
    2. Which function need to pass this zip file buffer from main.c(secure_bootloader_uart_debug)?

    I required to update firmware without DFU controller, hence our device is act as DFU target as well as DFU controller.

    Looking forward your response..!!!

    Thanks..

  • Looking forward your response....!!

    Thanks..!!!!!

  • Hi,

    I suggest that you start with the example I made and see how the UART RX events are forwarded from nrf_dfu_serial_uart to nrf_df_serial and dfu_request handler. It should be enough to replace nrf_dfu_serial_uart.c & nrf_dfu_serial.c with your own "Wifi" transport.

    vishal said:
    Switch device into DFU mode and in DFU main.c file I have added fds.c and fds.h libraries to read this stored file from internal flash memory.

     Is this in the app or in the bootloader? The DFU should be handled by the app when you do background DFU. 

    vishal said:
    Where should i need to send this zip file buffer in dfu_request_handler

    You need to include create object, execute, etc commands in the requests. Please refer to the message sequence charts for serial DFU. 

Related