Skip to main content
Saredo
Associate III
Dec 22, 2020 2:23 PM UTC
Solved

Is STM32F412VET6 on-the fly firmware update possible?

Hello,

I'm working with a STM32F412. In my process, the STM32 will receive a firmware. The idea is to flash this firmware (that is in RAM) to the STM32 for it to execute after a reset. I don't know if it is possible.

If it is not, what are the properties I should look for to be able to do so with a STM32 (if I have to change microcontroller)?

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Dec 23, 2020 12:02 PM UTC

Doing IAP (In App Programming) is NOT predicated on having dual bank flash or a place to stage the new image, it just makes it easier and safer.

You can write your own loader / updater that can remain in the first 16KB flash section and manage the rest of the process from there.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

8 replies

Bowman32
ST Employee
Dec 23, 2020 10:59 AM UTC

Hello @Saredo​ 

You can update the STM32 firmware on-the fly using FOTA (Firmware over the air) technique.

You can also refer to AN4767 application note "On-the-fly firmware update for dual bank STM32 microcontrollers"

Bouraoui

Saredo
SaredoAuthor
Associate III
Dec 23, 2020 11:45 AM UTC

Thank you for answer. I have seen this application note. But the STM32F412VET6 does not seem to have a dual bank.

I would like to confirm that it is only possible to do an update of the firmware using FOTA with an MCU which has a dual bank memory.

Thank in advance

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
Dec 23, 2020 12:02 PM UTC

Doing IAP (In App Programming) is NOT predicated on having dual bank flash or a place to stage the new image, it just makes it easier and safer.

You can write your own loader / updater that can remain in the first 16KB flash section and manage the rest of the process from there.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Saredo
SaredoAuthor
Associate III
Dec 23, 2020 1:54 PM UTC

Thanks @Community member​ i will search how to that.

But just to be sure I understood well: you mean that I can jump from my main code to this loader code, then in this loader write in flash a new main programm (that is in my RAM) and restart?

Tesla DeLorean
Guru
Dec 23, 2020 2:03 PM UTC

The MCU does what you instruct it to do. You can stage updates and code in SRAM if you want or do it differently.

​

I'd always keep a minimal boot loader in place to permit validation and recovery to occur. How large that needs to be depends on how complex the recovery process needs to be.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Bowman32
ST Employee
Dec 23, 2020 3:48 PM UTC

Hi @Saredo​ 

I would like to clarify that is always possible to do an update of the firmware using FOTA with all STM32 (MCU which has single or dual bank memory). You can implement FOTA technique based on application note AN3965 "STM32F40x/STM32F41x in-application programming using the USART" just by adding USART to wireless module. Indeed, as said by @Community member​  in your case (single bank) "You can write your own loader / updater that can remain in the first 16KB flash section and manage the rest of the process from there".

Bouraoui

Saredo
SaredoAuthor
Associate III
Dec 30, 2020 3:04 PM UTC

Thank you for your answers @Community member​  @Bouraoui Chemli​ 

ST Technical Moderator
Jan 4, 2021 12:14 PM UTC

Hi @Saredo​ ,

Please mark the answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks