Update Code Without Flashing?

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

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

Target device: STM32F411

Look at the approach I explained here - Binary partitioning - #3 by aggarg

Would it work for you?


1 Like

Thx for that! But not sure.

You wrote “The loader is the first image that boots up and then loads all the components. The way you enable communication between components is by adding one indirection.”

But we don’t want to load “all” the components at once. Just one. And so we don’t need communication between the components. And we don’t want the available execution memory to get reduced the more applications there are.

It’s unclear from your post if individual components can be updated independently.

We want something like apps on a smartphone.


The difference between a traditional OS and RTOS is that there is no loader and you do not usually load applications at runtime. Can you explain your use case and what are you trying to solve?

Another way to explain is that FreeRTOS is not a ‘system executive’ that lets you load and run programs, like Dos/Windows/Linux, but is a support library that runs INSIDE a ‘bare-metal’ application.

If you want some sort of ‘component’ system that can load different chunks of code at different times, that needs to be done OUTSIDE of the FreeRTOS kernel, as that isn’t what it does.

Note that for the most part chips like the STM32F4 series, the ‘Flash’ is used as ‘execute in place’ and the code is just run from the flash, so there is no ‘loading’ operation. You will need to do something to manage the RAM usage of the code if all the parts put together need more RAM than the chip available.

Or add a custom boot loader application managing 2 or more parts of the remaining flash where you can store and launch your real applications built and linked to their respective target flash partition. Boot loader is fixed to partition 0.

Thx for all the replies. In solutions suggested, 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?

I thought i had. What more info would help?


The flash partitioning and management would be completely up to.you and how smart your boot loader application is and also how the flash is organized (how much sectors of which size).
However, usually you’d reserve fixed partitions to avoid conflicts overwriting existing/installed applications and to make your life a lot easier :wink:
On the other hand that’s a certain hard limitation and requires an educated guess about the max. size of the user applications.
But you could submit a new ‘partition table’ to the boot loader in case of future incompatible changes of the flash layout as part of the user application (are-)installation procedure…