How do I execute a function from RAM on a Cortex-M3 (STM32)?
问题 I'm trying to execute a function from RAM on a Cortex-M3 processor (STM32). The function erases the and rewrites the internal flash, so i definitely needs to be in RAM but how do I do that? What I have tried is this: Copy the function to a byte array in RAM using memcpy (checking that it gets aligned correctly), setting a function pointer to point to the byte array an then calling the the function(pointer). This works fine for maybe 10 instructions (I can follow the execution with the