aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Host
diff options
context:
space:
mode:
authorTC Wan2011-01-05 07:57:49 +0800
committerTC Wan2011-01-05 07:57:49 +0800
commitc9927cc89eca050c779bc4f7fb8a5ce85f64e5a8 (patch)
treebb87facec5867507f745fd07a14b6802c38dc2b2 /AT91SAM7S256/armdebug/Host
parent4aa3653fdf3bda087fa195f75b7b8df928a0e770 (diff)
parentfe178520b884f60abe83dad45c4fef6ca501e942 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'AT91SAM7S256/armdebug/Host')
-rw-r--r--AT91SAM7S256/armdebug/Host/README8
-rwxr-xr-xAT91SAM7S256/armdebug/Host/nxt-gdb-server.py10
2 files changed, 10 insertions, 8 deletions
diff --git a/AT91SAM7S256/armdebug/Host/README b/AT91SAM7S256/armdebug/Host/README
index d9d3e20..9e6b9c1 100644
--- a/AT91SAM7S256/armdebug/Host/README
+++ b/AT91SAM7S256/armdebug/Host/README
@@ -1,9 +1,9 @@
The nxt-gdb-server.py script is initially developed by Nicolas Schodet.
It depends on the following libraries:
- - nxt-python v2.01 http://code.google.com/p/nxt-python/
- - pyusb v1.0x http://pyusb.wiki.sourceforge.net
- - libusb v1.0x http://libusb.org/
+ - nxt-python v2.0x http://code.google.com/p/nxt-python/
+ - pyusb v0.4x http://pyusb.wiki.sourceforge.net
+ - libusb-compat v0.1x and libusb v1.0x http://libusb.org/
It will probably work with libusb v0.1.x but it has not been tested in that configuration.
@@ -18,4 +18,4 @@ It depends on the following libraries:
1. Connect the USB cable from the PC Host to the NXT
2. start nxt-gdb-server.py
- 3. start arm-none-eabi-gdb, configured as remote for port 2828 (default) \ No newline at end of file
+ 3. start arm-none-eabi-gdb, configured as remote for port 2828 (default)
diff --git a/AT91SAM7S256/armdebug/Host/nxt-gdb-server.py b/AT91SAM7S256/armdebug/Host/nxt-gdb-server.py
index fba6073..73e025b 100755
--- a/AT91SAM7S256/armdebug/Host/nxt-gdb-server.py
+++ b/AT91SAM7S256/armdebug/Host/nxt-gdb-server.py
@@ -3,6 +3,7 @@
# Copyright (C) 2011 the NxOS developers
#
# Module Developed by: Nicolas Schodet
+# TC Wan
#
# See AUTHORS for a full list of the developers.
#
@@ -32,6 +33,7 @@ class NXTGDBServer:
# Debug command header, no reply.
debug_command = 0x8d
+ segment_no = 0
def __init__ (self, port):
"""Initialise server."""
@@ -41,16 +43,16 @@ class NXTGDBServer:
"""Return packed data to send to NXT."""
# Insert command and length.
assert len (data) <= self.pack_size
- return struct.pack ('BB', self.debug_command, len (data)) + data
+ return struct.pack ('BBB', self.debug_command, self.segment_no, len (data)) + data
def unpack (self, data):
"""Return unpacked data from NXT."""
# May be improved, for now, check command and announced length.
if len (data) < 2:
return ''
- header, body = data[0:2], data[2:]
- command, length = struct.unpack ('BB', header)
- if command != self.debug_command or length != len (body):
+ header, segment_no, body = data[0:3], data[3:]
+ command, self.segment_no, length = struct.unpack ('BBB', header)
+ if command != self.debug_command or length != len (body) or (self.segment_no != 0):
return ''
return body