<p><b>@miri64</b> commented on this pull request.</p>

<p>I on the other hand can't say much about the flashing part. Maybe <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=1301112" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/benpicco">@benpicco</a> and I can share the load with me reviewing the python side of things and <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=1301112" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/benpicco">@benpicco</a> the more technical side.</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12251#discussion_r327083960">dist/tools/bmp/bmp.py</a>:</p>
<pre style='color:#555'>> @@ -0,0 +1,236 @@
+#!/usr/bin/python3
+# Black Magic Probe helper script
+# This script can detect connected Black Magic Probes and can be used as a flashloader and much more
+
</pre>
<p>License note missing.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12251#discussion_r327084255">dist/tools/bmp/bmp.py</a>:</p>
<pre style='color:#555'>> +
+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__':
</pre>
<p>At least some of the code below could go into its own function for easier readability.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/12251?email_source=notifications&email_token=ABE7WYHGOOVF2LG5FIG6LMLQLCYVFA5CNFSM4IXCWVHKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFRYW5Y#pullrequestreview-291736439">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYAV7522GFS326MZIWLQLCYVFANCNFSM4IXCWVHA">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYAMT7WHFTTJCVWR353QLCYVFA5CNFSM4IXCWVHKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFRYW5Y.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12251?email_source=notifications\u0026email_token=ABE7WYHGOOVF2LG5FIG6LMLQLCYVFA5CNFSM4IXCWVHKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFRYW5Y#pullrequestreview-291736439",
"url": "https://github.com/RIOT-OS/RIOT/pull/12251?email_source=notifications\u0026email_token=ABE7WYHGOOVF2LG5FIG6LMLQLCYVFA5CNFSM4IXCWVHKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFRYW5Y#pullrequestreview-291736439",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>