This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Running code from RAM on TIVA (TM4C123GH6PZ)

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:

  1. How do I set up my .cmd file to allow for code loaded in RAM?
  2. How do I specify that specific functions run from RAM?
  3. How can I specify that whole modules run from RAM?
  4. 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.