I tried using the file from Chester and I got a new error related to trying to read from the address specified in the OnPreFileLoaded( ) function. I check the Tiva datasheet and the register (SRCR0) specified in the gel file does not exist in the Tiva device. I found a similar register (SRWD) for the Tiva device, and changed the code within the OnPreFileLoaded( ) function and that seems to work. Here is the updated function:
// Reset the WATCHDOG0 and WATCHDOG1 modules prior to loading a file, so that
// the watchdog doesn't corrupt downloading to flash
#define SYSCTL_SRCR0_R 0x400FE500 //0x400FE040
#define SYSCTL_SRCR0_WDT1 0x00000010 // 0x10000000 // WDT1 Reset Control
#define SYSCTL_SRCR0_WDT0 0x00000001 // 0x00000008 // WDT0 Reset Control
#define WR_MEM_32(addr, data) *(unsigned int*)(addr) = (unsigned int)(data)
#define RD_MEM_32(addr) *(unsigned int*)(addr)
OnPreFileLoaded()
{
//WR_MEM_32 (SYSCTL_SRCR0_R, RD_MEM_32(SYSCTL_SRCR0_R) | (SYSCTL_SRCR0_WDT1 | SYSCTL_SRCR0_WDT0));
//WR_MEM_32 (SYSCTL_SRCR0_R, RD_MEM_32(SYSCTL_SRCR0_R) & ~(SYSCTL_SRCR0_WDT1 | SYSCTL_SRCR0_WDT0));
WR_MEM_32 (SYSCTL_SRCR0_R, (SYSCTL_SRCR0_WDT1 | SYSCTL_SRCR0_WDT0));
}
I changed the define values as needed and now only write to the register as only two bits have any meaning.
To get the TivaWare watchdog example to fail, do this:
- Load project into workspace.
- Build project
- Click Run -> Debug. Program should load and run fine.
- Stop debugger.
- Click Run -> Debug. Errors should appear and JTAG interface will be broke, requiring unlocking.
Thanks for the help!
Jeff