Hi all:
I am trying to implement a firmware update function using Flash API similar to the example that comes with Flash API document.
- The firmware is executing normally until is receives a certain command that requests an update is received from the SCI port.
- Once the command is received, the WD disabled, DINT, and the MemCopy() is run to copy Flash API and then MemCopy() to copy custom functions to the secured LO memory.
- the main function UpdateFrm() is called ( it 's run from LO memory)
- Inside the UpdatedFrm() function Flash2812_Erase( AllSectors) is called.
- SendStatus(" Flash Memory Erased \n\r") is called.
Problem happens here.
- A BlockProcess() function is called (similar to one from the example) to copy image file to the flash memory.
Problem: Inside the SendStatus(char* msg) function the message msg points to NULL after Flash2812_Erase has run. It looks like the Flash2812_Erase erases something like stack or similar.
Did somebody had similar problem?
Is possible to erase all the flash memory sectors and then upload a new image? (when the Flash API is part of the firmware).
Thanks,
Yvon.