I thought I would create a new thread for this rather than cluttering up the main firmware thread.
I have been looking into having firmwares that are larger than the 64k of flash we have on the processor.
The STMF7 can memory map external flash as long as it is connected by the hardware QSPI, so we are out of luck here.
The other STM recommended solution is to have a second stage boot loader type thing running in the 64k flash which loads the "real" firmware from sd card or flash into ram and then executes that firmware in ram.
So imagine the binary has been created to link totally to ram and the address is stored in APPLICATION_ADDRESS the code is as follows:
JumpToApplication = (pFunction) (*(__IO uint32_t*) (APPLICATION_ADDRESS + 4));
__set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
This sets the top of the stack jumps to the entry point (main()) and the STM idea is that you never return from main(). For me this solution would work but in general it seems a bit wasteful of our 64k of onboard flash.
So this got me into thinking about some sort of plugin infrastructure, these plugins could be quite simple containing minimally a Setup() and LoopProcess().
So plugins could be compiled with the firmware to have them running from onboard flash, or they could be loaded at startup by the firmware from SDCard or external flash into ram.
This would allow people to add functionality to the firmware without messing around with the original firmware code.
What do you guys think?