I am trying to debug new board based on AM1705.
Right now not all the peripheral devices works (including memory), but I am modifying sft code, booting it up and trying to diagnose the problems.
So, I was trying to make a watchdog reset and, unexpectedly, fail.
Here are how I program 2 timers - timer0 into 64-bit free count mode and timer1 into watchdog mode:
*( (unsigned int *)0x01C20020 ) = 0x00C000C0;
*( (unsigned int *)0x01C20024 ) = 0x3;
*( (unsigned int *)0x01C20018 ) = 0x80000000;
*( (unsigned int *)0x01C2001C ) = 0;
*( (unsigned int *)0x01C20010 ) = 0;
*( (unsigned int *)0x01C20014 ) = 0;
// now timer 1 into watchdog mode
*( (unsigned int *)0x01C21020 ) = 0x00C000C0;
*( (unsigned int *)0x01C21024 ) = 0xB;
*( (unsigned int *)0x01C21018 ) = 0x00100000;
*( (unsigned int *)0x01C2101C ) = 0x00000000;
*( (unsigned int *)0x01C21010 ) = 0;
*( (unsigned int *)0x01C21014 ) = 0;
*( (unsigned short *)0x01C21028 ) = 0x4000;
*( (unsigned short *)0x01C2102A ) = 0xA5C6;
*( (unsigned short *)0x01C2102A ) = 0xDA7E;
Then I am sitting in infinite loop and printing the value of counters. And my timer1 counters never count and watchdog reset never happen. If I program timer1 into 64 bit mode - it works fine. Here is the output (timer0, then timer 1):
// revid tim34 tim12 pr12 pr34 tcr tgcr wdtcr
Target: 0x4472020C 0x00000000 0x1CC6F84C 0x80000000 0x00000000 0x00C000C0 0x00000003 0x00000000
Target:
Target: 0x4472020C 0x00000000 0x00000000 0x00100000 0x00000000 0x00C000C0 0x0000000B 0xDA7E4000
Target:
Target: 0x4472020C 0x00000000 0x1CCCC3AC 0x80000000 0x00000000 0x00C000C0 0x00000003 0x00000000
Target:
Target: 0x4472020C 0x00000000 0x00000000 0x00100000 0x00000000 0x00C000C0 0x0000000B 0xDA7E4000
Target:
Target: 0x4472020C 0x00000000 0x1CD28F0C 0x80000000 0x00000000 0x00C000C0 0x00000003 0x00000000
Target:
Target: 0x4472020C 0x00000000 0x00000000 0x00100000 0x00000000 0x00C000C0 0x0000000B 0xDA7E4000
What am I doing wrong?