Skip to main content
Taxara
Associate III
January 16, 2020
Solved

Does STM32WB support dual bank firmware update?

  • January 16, 2020
  • 2 replies
  • 1343 views

Hi,

Ive read the application note AN5247 "Over-the-air application and wireless firmware update for STM32WB Series microcontrollers" and noticed that the firmware will be deleted before storing the update. Therefor if the update fails (for example ble device gets out of range) the device will be without any firmware!?

Does the STM32WB support any dual bank firmware update or do you guys have another solution to not lose the running firmware before new firmware is stored? An application note or example will be appreciated.

Greetings,

Taxara

This topic has been closed for replies.
Best answer by JNewe.1

You basically have to do this yourself.

You will need to allocate a section of flash for your second image, create a boot-loader to download the image to the second bank and then reboot and run the second image or copy the image over after successful download.

The issue is when your user code and wireless code becomes to large ( ie the current WB+Thread stack is just under 500k) and the maximum flash is 1MB. So you really need to remove the user code to free up enough space for the downloaded image before updating the wireless stack.

This will mean the device could be not doing its normal tasks for a period of time

Obviously you may only want to update your user code, so then you could manage that and have minimal downtime but i personally would not sell a product where i could not remotely update the wireless stack.

2 replies

Remi QUINTIN
Technical Moderator
January 16, 2020

​The OTA firmware managing the update over the air is never erased. So you can always recover from a previous incomplete update when reconnecting.

There is no double buffering implemented as some RF stacks are quite big and in some cases the size for a double buffer would exceed the size of the remaining free Flash memory.

Taxara
TaxaraAuthor
Associate III
January 16, 2020

Thanks for your fast response,

Yes i like the choice of having the maximum flash free and i noticed that its able to reconnect and continue after an incomplete update.

However our product cannot be offline for a longer period. Being offline for a minute to do a firmware update is acceptable, but when it takes longer (because it failed) it will become unacceptable. Therefor OTA firmware update is not an option for me.

I've found the solution for other STM devices for example "Application note AN4767 On-the-fly firmware update for dual bank STM32 microcontrollers" Is this way of updating firmware already done for the STM32WB (using ble), as far as you know?

Thanks in advance,

Taxara

JNewe.1
JNewe.1Answer
Visitor II
January 21, 2020

You basically have to do this yourself.

You will need to allocate a section of flash for your second image, create a boot-loader to download the image to the second bank and then reboot and run the second image or copy the image over after successful download.

The issue is when your user code and wireless code becomes to large ( ie the current WB+Thread stack is just under 500k) and the maximum flash is 1MB. So you really need to remove the user code to free up enough space for the downloaded image before updating the wireless stack.

This will mean the device could be not doing its normal tasks for a period of time

Obviously you may only want to update your user code, so then you could manage that and have minimal downtime but i personally would not sell a product where i could not remotely update the wireless stack.

Taxara
TaxaraAuthor
Associate III
January 22, 2020

Thank you for your reply, that clearifies it all.