Hi,

some days ago I added a jtag connector to a ADuC7022 board and used an
olimex USB adapter with OpenOCD (compiled from SVN head) to test whether
that works.

Well, I stumbled into some strange problems, and after some hours of
debugging OpenOCD it looks like the ADuC7022's watchdog is the culprit.
After issuing a 'halt' via OpenOCD's telnet terminal, the watchdog timer
is not frozen, and when the watchdog finally tries to reset the
ADuC7022, the JTAG state is somewhat corrupted.

Of course I could rewrite the firmware to keep it from enabling the
watchdog in the first place.  But the most elegant fix for that would be
to make OpenOCD periodically issue a 'mww 0xffff036c 0' to reset the
watchdog.  But I didn't find any way to configure that.  If OpenOCD had
a full TCL interpreter, the following code would work:

  proc watchdog_service {} {
      mww 0xffff036c 0
      after 200 watchdog_service
  }

  target_script 0 post_halt watchdog_service
  target_script 0 pre_resume { after cancel watchdog_service }

So, does anybody know how to achieve that without patching the sources?  

If patching the sources were required, maybe adding another kind of
target script ("while_halted") might be a solution and I'd be happy to
write a patch if nobody objects.

cheers,

David
-- 
GnuPG public key: http://user.cs.tu-berlin.de/~dvdkhlng/dk.gpg
Fingerprint: B17A DC95 D293 657B 4205  D016 7DEF 5323 C174 7D40

_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to