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

Update firmware from flash

Hi all,

I'm using nrf51822, sdk 6.1 and s110 v7.1.

My idea is to use the GPRS module of my board to receive the new firmware (the module works with UART), save it to the flash(if it's needed) and then update firmware to the new one. How is the best way to do this? Which example can I use? I'm very familiar with OTA firmware update but in this case I don't know how to start.

Thanks in advance,

Aida

  • How do you plan to store the firmware on flash ? the GPRS module's flash or the nRF51 flash ?

    Is there any MCU on the GPRS module beside the nRF51 ?

    If there is an MCU on GPRS module, you can think of using the serial bootloader on the nRF51 and do DFU from that MCU.

    If you don't you would need to store the new image on the NRF51 and after the new image is verified, you switch to bootloader and swap the image. You can either modify the bootloader to make this work.

  • Thanks for the answer. I've tried to use serial bootloader but it doesn't work in my board (I modified the UART pins). I debug the bootloader and it seems that is executing fine (except that the LED is not turning on), but when I execute and I try to send the hex file, I get "Transmission timeout. Ack out of sequence, or no ack returned". I made it work once but I don't know what I changed, but now it's impossible to make it work again. I will try to store the new image on the NRF51 flash, but I don't know if storing the .hex image directly to the flash is enough to the bootloader or I have to transform to anything else.

  • Hi,

    You first need to make sure UART works properly. Try to test with normal UART example first.

    You haven't answered my question, do you have extra MCU on the GPRS module or it's simply an ASIC?

    Note that the hex file is not the binary image. You need to generate the binary image from the hex file and send it to the chip. You can re-use the bootloader to swap image, but I would suggest to write your own code to do swapping in the bootloader.

  • Hi,

    Yes, the UART works properly, I use it with an application and there' s no problem. In the code of serial bootloader I've created a custom_board.h with the board pins in order to use the led and UART but it seems that there's any problem because the led never turns on. Are there anything that is needed to do for a correct compilation or a correct programming of the hci bootloader? With BLE bootloader I've never had any problem.

    Answering your question: I don't have an extra MCU on the GPRS module.

    If I send directly the binary image, is it possible to verify the integrity of the image? the CRCs are included in the binary? Where can I find some kind of example? I know the process of swapping: first check application in bank1, then erase bank0 and copy the application of bank1 to bank0, but when I want to search the functions in bootloader to do this, I get a little bit lost.

  • I would suggest to debug the serial bootloader. You can turn on log to see where it stop. You can also run the bootloader in debug mode to check (you need to turn off optimization )

    Please note that you are using a very old SDK, must be 3 years old. The current SDK is v14.1, the last version of SDK support nRF51 was SDK v12.

    If you are using nrfutil to do DFU, the current nrfutil may not be compatible with older bootloader. You need to use nrfutil v0.3.0.

    If you send the binary image, the CRC need to be separately. In our DFU we send it in the init packet. After you receive the image, you calculate the CRC based on the image and then compare them.

    The bootloader project is quite complex. We need to make sure which bootloader you going to use before go deeper.

Related