[riot-notifications] [RIOT-OS/RIOT] Add helper script for Black Magic Probe (#12251)

Martine Lenders notifications at github.com
Mon Sep 23 14:25:54 CEST 2019

miri64 commented on this pull request.

I on the other hand can't say much about the flashing part. Maybe @benpicco and I can share the load with me reviewing the python side of things and @benpicco the more technical side.

> @@ -0,0 +1,236 @@
+# Black Magic Probe helper script
+# This script can detect connected Black Magic Probes and can be used as a flashloader and much more

License note missing.

> +
+def gdb_write_and_wait_for_result(gdbmi, cmd, description, expected_result='done'):
+    res = gdbmi.write(cmd, timeout_sec=TIMEOUT)
+    while True:
+        for msg in res:
+            if msg['type'] == 'result':
+                if msg['message'] == expected_result:
+                    print(description, "successful.")
+                    return True
+                else:
+                    print(description, "failed.", file=sys.stderr)
+                    return False
+        res = gdbmi.get_gdb_response(timeout_sec=TIMEOUT)
+if __name__ == '__main__':

At least some of the code below could go into its own function for easier readability.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190923/9ecc71e2/attachment.htm>

More information about the notifications mailing list