cancel
Showing results for 
Search instead for 
Did you mean: 

Update Code Without Flashing?

The BOOM
Associate III

Is it possible to update executable code without reflashing the entire device, and without overwriting the entire codebase?

Ie,multiple applications, such that individual applications can be separately installed, updated, and uninstalled?

We don’t want to load “all�? the apps at once. Just one (or two). And we don’t want the available execution resources to get reduced the more (non--running) applications there are.

We want to update individual apps independently. something like apps on a smartphone.

STM32F411

6 REPLIES 6
KnarfB
Principal III

This is clearly possible by logically partitioning the flash for the individual apps and writing a boot loader which starts an app from its non-default offset in flash memory.

hth

KnarfB

TDK
Guru

You're going to be limited by the number and size of available sectors, but if each application lives in different sectors, no reason why this can't work. CubeIDE will only erase the sectors it uses by default.

If you feel a post has answered your question, please click "Accept as Solution".
The BOOM
Associate III

Would it be necessary to create all the empty partitions you’d ever need and burn them to the device?

Or can partitions be added/removed on the fly without re-burning? In that case, would it be necessary to restart the uC after creating/removing a partition?

Thx!

The flash is divided into sectors, see the reference manual for the sizes of these. You can't change or resize these in any way. The fundamental limitation here is that you can erase each sector independently, but you cannot erase only part of a sector. You need to choose which sectors each application will live at and build each app to live within that sector. Updating the app would then be erasing the sector, and programming the new app in its place. You won't be able to move apps between sectors at will.

The flash doesn't work like a hard disk where you can create/resize partitions at will.

If you feel a post has answered your question, please click "Accept as Solution".

Yes, that's a limitation. And, you have to develop your own strategy, there is not much avail off-the-shelf. You can set aside the last page/sector for management data. A directory table containing the starting offsets and maybe lengths, checksums, version info and even names of individual apps. Alternatively, you may keep that info in the last sector of each app, building a linked list.

hth

KnarfB

The BOOM
Associate III