Is it possible to run code on the ARM Cortex M architecture from locations other than the onboard flash memory (such as another flash chip, SD card)?
If so, how?
If not, what microcontroller architecture does permit this?
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
ARM Cortex M allows code execution from Flash, internal and external RAM. External RAM (if available) needs to be set up before it can be used.
You may need to change the linker script and/or startup code, but that depends on the compiler you use.
The CCC r0ket for example loads external code into RAM and executes it.
The Cortex-M architecture doesn't put any restriction on the memories, it depends on the memory interfaces that are available on a specific controller.
For example, the LPC43xx allows to execute code from internal flash and RAM, external static RAM, NOR flash and serial flash (SPIFI). I'm not sure about code execution in dynamic RAM as it is in an address range not normally used for code, but probably it is possible, too.
Note that external memories will generally be slower than internal ones. The fastest is internal RAM.