summaryrefslogtreecommitdiff
path: root/tools/pydfu.py
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2020-03-05 15:00:07 +1100
committerDamien George <damien.p.george@gmail.com>2020-03-22 15:24:57 +1100
commit38ccb4c643aac4069b2dbd88e5d6a9b276dbf3fa (patch)
tree1311fc4fc783903ee2dacc9f346c6fc13735931d /tools/pydfu.py
parentf7130a99b614e5ce94c472fdb73d15c34b47a49e (diff)
tools/pydfu.py: Display any error strings from device/mboot.
Diffstat (limited to 'tools/pydfu.py')
-rwxr-xr-xtools/pydfu.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/pydfu.py b/tools/pydfu.py
index 36465aa91..030f56bf8 100755
--- a/tools/pydfu.py
+++ b/tools/pydfu.py
@@ -161,6 +161,13 @@ def clr_status():
def get_status():
"""Get the status of the last operation."""
stat = __dev.ctrl_transfer(0xA1, __DFU_GETSTATUS, 0, __DFU_INTERFACE, 6, 20000)
+
+ # firmware can provide an optional string for any error
+ if stat[5]:
+ message = get_string(__dev, stat[5])
+ if message:
+ print(message)
+
return stat[4]