Cortex-M3: SystemInit for code execution in external memory
To enable code execution in external memory (e.g. debugging in RAM or multi-boot architectures using external flash), you should provide a way to ensure that SystemInit () does not switch off the power to the on-chip EMC. Otherwise, execution ends here abruptly :(
For example, on the LPC1778, the file system_LPC177x_8x.c could contain something like this:
#if defined (EMC_INIT)
#define PCONP_Val 0x04288FDE // the flag 0x00000800 is the EMC power switch
#else
#define PCONP_Val 0x042887DE
#endif
I have also thought about declaring all SystemInit and EMCInit stuff as __attribute__ ((section(".init"))) and demanding that .init lay somewhere in internal memory, but I think this condition cannot be held in practical cases, so I put it down again.
If anyone has another approach, please let us know.
Regards,
Achim
Please sign in to leave a comment.
Comments
0 comments