stm8s flash entire new program - how?
Let's assume I have a program that exposes a serial interface for commands and one such command is "load new program". I upload the new program as hex strings and the old program writes this to flash and the resets. Hopefully at this point the new program starts up.
Now the peripheral library gives three examples but they write either to EEPROM or just tiny bits of data to flash and it appears that only the calls to FLASH_ProgramBlock() and FLASH_EraseBlock() run from RAM.
Since I am rewriting up-to ALL the flash memory, do I need to wrap and entire method in RAM() so that the entire processing, from the UART receiving hex to the writing to flash gets run from RAM? I assume I cannot risk any of the old program (or at least the update method) running from anything other than RAM because I might be overwriting the flash copy of the old program.
Is that correct? Anyone point me at an example of this or some documentation beyond PM0051?
Thanks,
Paul DS.
