Hello,
I have updated the SDK, but it is not yet online... send me an email and I will send you the latest version which is a whole lot easier to work with.
to beat the dog, use the Watchdog() or the watchdog function (one is inlined, one is a function call).
if that is not defined in your version of the SDK, here is the code that I am using. It even answers 2 of your questions!:
#ifdef _ARM_
#include "board.h"
TMyApplication *const MyApplication= (TMyApplication*)0x300000;
// restart the watchdog
inline void Watchdog() { AT91C_BASE_WDTC->WDTC_WDCR= 0xA5000001; }
void watchdog(); // same function as above, but not inlined...
#else
extern TMyApplication MYAPPLICATION;
TMyApplication *const MyApplication= &MYAPPLICATION;
inline void Watchdog() { }
#endif
do not forget to define MYAPPLICATION in the windows only part of the code somewhere...
the backup RAM is at address 300000. there is a way to create a section for the linker and then to tell the linker to place variables there, but I found it easier to create a structure (TMyApplication) that contains all the data that needs to be backed up and then to put that structure at 0x300000. It also makes is a whole lot easier to check that the structure is less than 2KB (sizeof)... as a matter of fact, in the test menu, the number under the copyright message is just that, the size of TMyApplication in order for me to check at each build if I did not mess up!
regards, cyrille