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 Reply
  • From document DFU_SPI_readme.docx in the "Getting started with Nordic's Secure DFU bootloader, a step by step guide" blogpost:

    How to test

    The host application itself can be programmed as any other application.

    • Compile the bootloader with the public key you generated. Flash the target board with softdevice and the bootloader. Flash the DFU master application on the master board.
    • Generate the DFU .zip package file as you do on normal DFU (make sure you use private key as used to generate the public key)
    • Open the .zip file and unzip the init .dat file and the binary image .bin of the application or the softdevice/bootloader.
    • Rename the init .dat file to a .bin file (make sure you don’t overwrite the image .bin file) e.g init_packet.bin
    • Use J-Link commander to flash the binary file to the right part of the flash in the host
      1. Run the command line in the folder where you have your binary files
      2. From the command line, start J-Link commander by running jlink (this requires the C:\Program Files (x86)\SEGGER\JLink_VXXX folder to be in your PATH environment settings in Windows)
      3. In J-Link commander, type the following commands, this is for writing application, the similar applied for softdevice/bootloader just choose the right location:
        1. connect
        2. <Select nRF52832 and select SWD interface>
    • loadbin init_packet.bin 0x9000
    1. loadbin app_image.bin 0x10000
    2. r
    3. g
    • When the DFU Master started it will send a SPI ping command. After that you can choose to update application or softdevice/bootloader by pressing Button 1 or button 2 on the DFU master board.
    • LED 1 will lid when the image is being transferred
Children
  • Hi 

    Thanks for your reply. I will try and let you know the results

  • Hi 

    I got no response after I sent the .dat file to the nrf in bootloader mode.

    What I had checked:

    1. Checked the object data - it is as per the file

    2. Check the receive CRC and offsets, they are also correct.

    3. Then send the Execute command but no response coming from the NRF.

    Steps I had followed:

    1. Set PRN Number = 

    2. Get MTU

    3. Create Object - 

    4. After that sent .dat file data 

    5. Then Command for Calculate CRC

    6. Then Send Execute command.

    I got success in all but failing in execute command, not getting any response after that.

    Can you guide me in this for the possible reason for no response.

  • Hi,

    Is this happening when you test the DFU master example with two DKs or are you now trying to use the  ESP?

    Did you manage to test the example with no modification on two DKs? If you have a logic analyzer you can capture the SPI transaction form a DK to a DK and then compare it with the ESP transaction.

    You should also check the logging on the bootloader. If it doesn't print out so much informatin you can also add some logs yourself.

    BR,

    Marjeris

  • Hi

    1. I am testing this all in our application PCB containing NRF52832 as a chip.

    2. Communication is Done between nrf52832 and esp8266 chip over uart.

    3. Data from esp to nrf is going in correct format. I checked in logs.

    4. All the commands are providing correct response but no response from execute commands. 

    5. From no response I means neither success nor fail.

    6. I tried to implement same with nrfutil but also getting same results " no response from device".

    7. SDK version I using is 5.0.0

  • 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

Related