2024-03-27 09:42 AM
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?
2024-03-27 09:53 AM
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.
2024-03-27 11:54 AM
Thanks - will do. I was particularly surprised to see that the `IN_RAM()` macro is a no-op for the COSMIC compiler.
2024-03-27 12:41 PM