AnsweredAssumed Answered

[STM32F2xx] Running code from ram.

Question asked by Legrand.Thomas.001 on Aug 2, 2011
Latest reply on Dec 11, 2013 by Clive One
Hello,

I'm using tasking which allows easily to tag methods to be copied in ram at startup and then run them from ram.

But I'm wondering at which extend it is a good idea ...

On the one hand, run from ram means zero wait state, so "performance increase", but it's not just linear performance increase, it depends on the code itself, and the ART (I'm using an STM32F205) should do a pretty good job at absorbing the 2 wait state of flash.

On the other hand, code and data access would share the same bus, so no parallel read / writes.

Having vector table in ram seems not to be a good option, as the vector fetch happens on another bus while the core stacks the registers, and that's at least 12 clock cycles, so flash wait is not the limiting factor.

I have some small interrupt handlers (like an exti interrupt where I just set an output with reverse polarity) that need low latency (but it seems on this one I'm running a buffered write "bug" where the interrupt execute twice - or more - because the interrupt handler ends before the - buffered - bit clear of the interrupt register is done). Would these benefit from being run from RAM?

Regards,
Thomas.

Outcomes