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

NRF52832 Firmware Upgrade using Esp8266

Hi Team

I am trying to implement the firmware upgrade for master controller nrf52832 on chip using esp8266 over uart and I am very new with this boot-loader part.

I had gone through many examples and trying to understand the flow from where to start. Code had already implementation of DFU using nrf connect application and working, but now I need to do this using esp8266.

My flow is I will download the hex file from the server and then upgrade the hex file form esp8266 over uart.

I had seen the examples - secure_bootloader_dfu and iot example but still not able to understand the example.

Any help or suggestion in this.

Parents
  • Sounds like your Esp8266 plays the role of DFU controller. I've not touched DFU lately but I do find the DFU documentation back in SDKv11 very detailed and readable. There's also an DFU example using uart instead of ble for transferring the new firmware image. Checkout SDKv11 to see if that example helps with what you plan to do: Software Development Kit > Previous versions of nRF5 SDK > nRF5 SDK v11.0.0 > Examples > DFU bootloader examples > BLE & HCI/UART Bootloader/DFU > Architecture

  • Hi can you suggest me the settings that I should do in bootloader file to enable the serial dfu.

  • Hi Vaibhav, 

    I'm taking over the case from Marjeris.

    Please clarify what exactly you planning to do. Earlier you mentioned that you have old application that running on softdevice v5.0. Which SDK version was that application built on ? What do you plan to do with the application, are you planning to upgrade firmware on this old application ? 

    Are you planning to upgrade to SDK v16 ? 

    You are planning to do a complex task (writing DFU host on ESP8266) so my suggestion for you is:

    1 - Test UART DFU using our bootloader in SDK v16 (no modification) and nrfutil serial. This is described in the documentation and partly in my blog post

    2 - Try to do the DFU with a very small image, and capture a UART trace using a logic analyzer. You can use this as the golden sample to compare to your application.

    3 - Try to understand how the bootloader works, print out log.

    4 - Try to test my DFU host on nRF52832 code here. This will do DFU from a nRF52 to a NRF52. Try to capture a UART trace and compare to #2

    After these 4 steps, you can continue the development on the ESP8266

  • Hi Hung

    I will work on this will let you know the results.

    SDK verison of my application is 14.2.

    I am planning to upgrade my device firmware on same version. I had devices deployed in the field with some features that has connectivity over BLE and Wifi. As for firmware upgrade BLE instance and user is not available , and device will work automatically over Wifi only. 

    So I want to upgrade the device firmware over Wifi.

  • Hi

    I am trying to implement you code UART DFU Master example, but not able to compile it. So what I did to compare the code with my DFU controller code that I had written in esp8266.

    Both the codes are same. 

    I also traced the uart lines using logic analyzer and data tx rx is also good and expected values.

    Still when I send the execution command I am not able to receive any response from the device.

    I am sending the .dat file, renamed as init_1.bin file in our server and also compare the data for any type of data corruption. Data is also correct.

    Is possible can we have a code review session on this?  

  • I have the list of steps, please let me know if you have performed all the steps. 

    We can't review the code just based on "it doesn't work". 

    You need to debug the bootloader to find the reason. 

    What was the issue with the UART DFU master example ? Which error do you have ? 

  • I downloaded the example DFUMaster_Uart example

    1. Open the project file and try to build the code.

    2. I get nrf_log_backend_serial.c - no such file or directory.

Reply Children
  • Have you put the project into SDK v14.2 \example\peripheral folder ? 

    nrf_log_backend_serial.c is located at \components\libraries\experimental_log\src

    I have only modified the KEIL project, not the SES or IAR or GCC. 

  • Hi

    It is in \example\ble_peripherals.

    I am using SES for testing purpose first, then I will move to GCC for my project.

    Still getting the error.

  • I am able to resolve that now I am issue with slip.h, no such file or directory

  • Slip.h is located in \components\libraries\slip you need to add that path into the project's include folder. 

    I would strongly suggest you to install Keil v5. It's free to use if the compiled file <32kB which is the case of the example. 

    From that it's easier to port to your SES project. 

  • Hi,

    In SES only after providing the path to the library I am able to compile the code but It is saying slip_encode is not defined even I am able to see that in slip.c library, also I had removed that #ifdef in Slip.c