soc/tools/remote/server: add --debug parameter

This commit is contained in:
Florent Kermarrec 2015-11-17 15:43:10 +01:00
parent 6870707620
commit 8056653004
2 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,7 @@ class CommUART:
for i in range(length_int):
value = int.from_bytes(self._read(4), "big")
if self.debug:
print("read {:08x} @ {:08x}".format(data, addr + 4*i))
print("read {:08x} @ {:08x}".format(value, addr + 4*i))
if length is None:
return value
data.append(value)

View File

@ -73,6 +73,7 @@ def _get_args():
parser.add_argument("--comm", default="uart", help="comm interface")
parser.add_argument("--port", default="2", help="UART port")
parser.add_argument("--baudrate", default=115200, help="UART baudrate")
parser.add_argument("--debug", action="store_true", help="enable debug")
return parser.parse_args()
def main():
@ -83,7 +84,7 @@ def main():
print("Using CommUART, port: {} / baudrate: {}".format(args.port, args.baudrate))
comm = CommUART(args.port if not args.port.isdigit() else int(args.port),
args.baudrate,
debug=False)
debug=args.debug)
else:
raise NotImplementedError