Hi,
I have code made of two sections: a bootloader (my own) and an application, both of which currently run from flash.
The bootloader allows connecting over USB through some protocol and erase / replace the application - all this works fine.
However I would like the bootloader to be able to replace itself.
For safety / architecture reasons the application must run from flash and cannot have code that could modify the flash.
Therefore I would like to have most of the bootloader running from (internal) RAM, so that I can erase and rewrite itself while running.
So here are my questions:
- How do I set up my .cmd file to allow for code loaded in RAM?
- How do I specify that specific functions run from RAM?
- How can I specify that whole modules run from RAM?
- Can I make the modules run from RAM by default?
Note: I reuse some modules from the application that has to run from flash, therefore I need the source files to be compatible with both - ideal would be specifying which is loaded where from the project file.
In advance thank you for your time and effort.