Ok since I can't read back what I wrote to the watchdog, I did this:
char WD_Track __attribute__( ( section( "IRAM2"),zero_init) );
void WDT_PET(char Track)
{
T2CLRI=Track;
WD_Track = Track;
}
But even though I said IRAM2 (0x43F00, length 0xFF, NoInit checked in target configuration) and zero_init, it still gets reset when the watchdog bites.
Looking at the .map file, it looks like Keil stuffed it into 0x4064c (Doh! I thought I was being clear enough?)
How do I make this variable persist across reboots?