cancel
Showing results for 
Search instead for 
Did you mean: 

Update MCU firmware (RMII and external flash)

inigo1
Associate II

Hello,

I own a Nucleo-H723 and I would like to know how to update the MCU firmware using the ethernet port to transfer data. I want to send the bin/hex file over TCP (LwIP) and store the file in a external flash (QSPI), as I am not sure that the MCU flash is big enough. Which are the following steps?

4 REPLIES 4

The MCU memory also isn't very cooperative to concurrent execution and writing, and you probably want an entire replacement firmware on-hand before deleting the current one, so you don't brick the thing entirely.

>> Which are the following steps?

You can't figure out how to stage the file/content in the memory?

Seems a bit rote. What parts conceptually are you having difficulty with?

Break the task down, look at IAP examples, code a BSP to read, write and erase the QSPI device.

Pick a device

Pick a protocol to download or fetch the file, say HTTP or FTP

Break your code into a loader / application, such that the loader can replace the app, authenticate the current app, restart the update process if it fails.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Piranha
Chief II

FTP is pretty complex and a robust HTTP is not trivial either. In addition both need TCP, which is large and not every application needs it. Because of these reasons in embedded devices often it is preferred to use TFTP, which is trivial and runs over UDP.

> you probably want an entire replacement firmware on-hand before deleting the current one

If the bootloader/updater is completely autonomous, there is no need for that and consequently also wasting a half of the storage.

>> You can't figure out how to stage the file/content in the memory?

Yes

I have just read AN4657 (STM32 in application programming iap using the usart) and the LwIP IAP example. AN4657 document explains how IAP works but I still do not know how to write the IAP code and the main program. I guess I have to modify the linkerscript but I do not know how to do it.

0693W00000bhGjvQAE.png

Our client needs to update the device using HTTP (DLMS over TCP/IP). The firmware must be updated by connecting a computer to the device or remotely. The LwIP IAP example is very helpful, as it allows to update the firmware using TFTP and HTTP.I think I am going to adapt the example to my project.