Either GDB or pygdbmi changed behavior to trim off whitespace following
the message, resulting in the `\\n` at the end of the regex no longer
matching. This replaces the `\\n` with `\s*` to match both old and new
output.
Fixes: https://github.com/RIOT-OS/RIOT/issues/20604
The flashing script for the black magic probe stopped working with pygdbmi in
version 0.10.0 due to an API change. This adapts the code to first try
initialization with the old pygdbmi API (as before), but tries again with the
new API if that fails.
This script can detect [Black Magic Probes](https://github.com/blacksphere/blackmagic/wiki) and act as a flashloader (and more).
It is compatible with Linux and macOS.
All important options that can be set via the monitor command are available as arguments.
Makefiles for using `make flash`, `make erase`, `make debug` and `make term` with the script are included.