AnsweredAssumed Answered

Unexpected COP Timeout on ColdFire V1

Question asked by Mark Donkers on Apr 20, 2017
Latest reply on Apr 27, 2017 by TomE

We are implement the COP feature on the MCFJE256 MCU and *appear* to be having an issue where the COP times out prematurely.

 

The following is our configuration which should give a timeout of 1.024 ms:
    COPW = 0 (normal mode)
    COPCLKS = 0 (uses 1 kHz LPOCLK)
    COPT = 3

 

To prove that the application is servicing the COP, the code that resets the COP timer (sequential write of 0x55 and 0xAA to SRS) is wrapped with a general purpose output being set and cleared. On the scope, it is very clear that the code is being executed every 250 ms.

 

Here is my watchdog reset macro:

 #define WDOG_KICK() DBG_YW_SetVal(), SRS = 0x55U, SRS = 0xAAU, DBG_YW_ClrVal()

   
When the timeout occurs, my debugger halts and the Debug window says "Suspended: Signal 'Halt". received. Description: User halted thread."

 

What is strange is that sometimes the issue occurs after the initial download, but not on subsequent restarts. Other times, the first run after the initial download is fine, but subsequent restarts fail. Each time, I scope that feeding of the COP as outlined above, and it still seems to writing the reset sequence.

 

Another thing that's strange is that it always seems to halt after the instruction that follows the writing of 0xAA to SRS. See the last line in the following disassembly.

 

447                 WDOG_KICK();
00012fd6:   clr.b d0
00012fd8:   bset d0,0xFFFF8002 (0xffff8002)
00012fdc:   moveq #85,d0
00012fde:   move.b d0,0xFFFF9800 (0xffff9800)
00012fe2:   moveq #-86,d0
00012fe4:   move.b d0,0xFFFF9800 (0xffff9800)
00012fe8:   clr.b d0
00012fea:   bclr d0,0xFFFF8002 (0xffff8002)   <--- halts here

 

Lastly, if I disconnect and run without the debugger, everything seems fine.
    
Can anyone share any insight or experience with the using the COP in any of the Coldfire v1 parts?

 

Thanks,
Mark

Outcomes