diff python/stlink.py @ 143:1cc59ac80950

Fixed halt button
author Windel Bouwman
date Sun, 27 Jan 2013 13:18:53 +0100
parents 14e739ed03ab
children 59a9a499e518
line wrap: on
line diff
--- a/python/stlink.py	Sun Jan 27 12:18:28 2013 +0100
+++ b/python/stlink.py	Sun Jan 27 13:18:53 2013 +0100
@@ -26,6 +26,7 @@
 DEBUG_EXIT = 0x21
 DEBUG_ENTER_SWD = 0xa3
 DEBUG_GETSTATUS = 0x01
+DEBUG_FORCEDEBUG = 0x02
 DEBUG_RESETSYS = 0x03
 DEBUG_READALLREGS = 0x04
 DEBUG_READREG = 0x5
@@ -167,7 +168,9 @@
       cmd[0:2] = DEBUG_COMMAND, DEBUG_RUNCORE
       self.send_recv(cmd, 2)
    def halt(self):
-      pass
+      cmd = bytearray(16)
+      cmd[0:2] = DEBUG_COMMAND, DEBUG_FORCEDEBUG
+      self.send_recv(cmd, 2)
 
    # Helper 1 functions:
    def write_debug32(self, address, value):