From: Kalus M. <mic...@on...> - 2010-05-26 17:28:00
|
Hi Andy. Am 26.05.2010 um 17:48 schrieb an...@ki...: .. > D. It may be worth considering creating a word like "FactoryReset" or > something that lives in the core/Boot-loader section and after > confirmation wipes/purges/re-initializes the non core/Boot-loader > section. Restoring the board/chip to a clean state. (Good for > classroom > scenarios and new starters) For an atmega168 board based projekt here I use amforth 3.6 and added two words NEW and SAVESYSTEM to accomplish this: SAVESYSTEM copies all system vectors from eeprom into a reserved flash area. On a reset these vectors are restored, so there will be a working system in case something went wrong. NEW restores system vectors as well, but uses vectorcopies of the pure assembled amforth version. So with NEW I get rid of any tests and errors I have done after a brand new assembled amforth is flashed into the chip, while RESTORESYSTEM gives back to me the last working coopie of mforth. Those words share the headerless word POPEE as a piece of code also used in the MARKER word. Files added. So, on default reset runs through the compiles code given by appleturnkey.asm where restorsystem is executed, which is equal to NEW then. After a SAVESYSTEM a restoresystem now restores to the currently saved vector set. Michael |