comparison python/stlink.py @ 143:1cc59ac80950

Fixed halt button
author Windel Bouwman
date Sun, 27 Jan 2013 13:18:53 +0100
parents 14e739ed03ab
children 59a9a499e518
comparison
equal deleted inserted replaced
142:982ddb5f786d 143:1cc59ac80950
24 # debug commands: 24 # debug commands:
25 DEBUG_ENTER = 0x20 25 DEBUG_ENTER = 0x20
26 DEBUG_EXIT = 0x21 26 DEBUG_EXIT = 0x21
27 DEBUG_ENTER_SWD = 0xa3 27 DEBUG_ENTER_SWD = 0xa3
28 DEBUG_GETSTATUS = 0x01 28 DEBUG_GETSTATUS = 0x01
29 DEBUG_FORCEDEBUG = 0x02
29 DEBUG_RESETSYS = 0x03 30 DEBUG_RESETSYS = 0x03
30 DEBUG_READALLREGS = 0x04 31 DEBUG_READALLREGS = 0x04
31 DEBUG_READREG = 0x5 32 DEBUG_READREG = 0x5
32 DEBUG_WRITEREG = 0x6 33 DEBUG_WRITEREG = 0x6
33 DEBUG_READMEM_32BIT = 0x7 34 DEBUG_READMEM_32BIT = 0x7
165 def run(self): 166 def run(self):
166 cmd = bytearray(16) 167 cmd = bytearray(16)
167 cmd[0:2] = DEBUG_COMMAND, DEBUG_RUNCORE 168 cmd[0:2] = DEBUG_COMMAND, DEBUG_RUNCORE
168 self.send_recv(cmd, 2) 169 self.send_recv(cmd, 2)
169 def halt(self): 170 def halt(self):
170 pass 171 cmd = bytearray(16)
172 cmd[0:2] = DEBUG_COMMAND, DEBUG_FORCEDEBUG
173 self.send_recv(cmd, 2)
171 174
172 # Helper 1 functions: 175 # Helper 1 functions:
173 def write_debug32(self, address, value): 176 def write_debug32(self, address, value):
174 cmd = bytearray(16) 177 cmd = bytearray(16)
175 cmd[0:2] = DEBUG_COMMAND, JTAG_WRITEDEBUG_32BIT 178 cmd[0:2] = DEBUG_COMMAND, JTAG_WRITEDEBUG_32BIT