I want to be able to install custom rom, image and backup files onto new connect me 9210 modules. My application’s allocations of memory to these is different from default as well as it’s serial settings.
Currently the process is something like this:-
- install rom.bin and image.bin
- reboot module and at the prompt choose to reset to defaults.
- allow module to reboot again and install backup.bin
This actually seems suprisingly cumbersome; surely there is an easy way of combining these in such a way that this can be achieved without the reboot and the user intervention to reset the defaults?
Also, is there anyway to reformat the file system?
Any suggestions would be much appreciated.
Thanks and regards,
The reboot is initiated via a timer in fwdl.c in src\bsp\fsintf. So you have the source code. When the timer expires it calls resetAfterImageDownload. You’ll find the timer in naFWControlClose. All of these are in the same file (fwdl.c).
To reset nvram progrmmatically you could do the following:
Call API customizeUseDefaultParams. This fills a board params structure with default values. This use that board params structure to call customizeWriteDevBoardParams. This will write the values to nvram. See the API reference guide for guidance on these APIs.
There is no easy way to reformat the FLASH file system. You’d have to figure out what sectors make up the FLASH file system and clean out those sectors. There is a sample application in ESP entitled Flash Memory Sample. This shows how to wipe ALL OF FLASH. You’d need to modify it to wipe only what you want to wipe.
I’d advise caution when doing all of this with production modules as there is no way to recover the board if you mess up. Development modules with the JTAG port have the capability to be recovered easily using the debugger. Not so with productions modules.