cancel
Showing results for 
Search instead for 
Did you mean: 

Ensure code running in RAM

papadeltasierra
Associate III

Ref: stm8s flash entire new program - how? - STMicroelectronics Community

How do I ensure that an entire routine, and anything that it might call, is running in RAM?  I think there is a RAM() macro around, for example, the flash write methods so can I place this around my own routine and will this "filter down" to all called routines or do these also have to be similarly flagged?

3 REPLIES 3
PHolt.1
Senior III

This is highly nontrivial. You need to learn the linkfile syntax and arrange for the RAM-based code to be linked to execute in RAM. Then you need to copy it there. I suggest searching eevblog.com for threads talking about RAM based loaders; I posted a load of sources there.

papadeltasierra
Associate III

Thanks - will do.  I was particularly surprised to see that the `IN_RAM()` macro is a no-op for the COSMIC compiler.