dist/tools/bmp: improve compatibility #21107
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
The Black Magic Probe is a great debugger. Current implementation does not work with more modern firmware versions, because some commands have been renamed. Further more, Python 3.12 deprecated the
distutils
package (removed in 3.13), so this tool did not work on my machine.Compatibility with older firmware versions has been maintained (or at least, I tried). I first wanted to implement auto--detection of the firmware version, but that does not work with debug mode in the current state.
I also cleaned up the code a tiny bit, and made things a bit more logical (IMHO).
Before, port detection would always throw an exception if no debugger was found, even if
--port
was provided. I relaxed this check, which gives me the possibility to provide any port. In my particular use-case, I run the debugger viaser2net
, so local detection would not work.Created separate commits with all changes. Will squash once approved.
Testing procedure
I tested this as follows:
BOARD=some-board PROGRAMMER=bmp make flash|reset|debug|erase
BOARD=some-board PROGRAMMER=bmp BMP_OPTIONS="--port 10.0.0.192:2000" make flash|reset|debug|erase
.Issues/PRs references
None