-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(platform): extend Black Magic Debug Probe upload method to more boards #2621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @ALTracer
Well, STLink can be disconnected if needed and so I guess BMP upload method can be used but don't see any interest. 😉 Except (maybe) avoid to install the STM32CubeProgrammer and driver. And also to be compatible with host arm architecture. What do you mean by
Simply due to boards.txt format. No submenu can be defined else it will be already factorized so it have to be duplicated for each menu.
We support only Arduino IDE. Maybe you mean Arduino IDE 2 by Theia IDE? If true then I guess it can be done anyway I will not have time to test/deploy this. You can open a discussion first for this not an issue, maybe other user will comment. |
👋🏼 lead maintainer of Black Magic Debug here, what he's referring to is Black Magic Debug App, just known as BMDA by the project. It is the BMD firmware but built to run as a host program and able to interface with BMPs and other dongles running the firmware, CMSIS-DAP adaptors, J-Link's, ST-Links, and FTDI devices being used as adaptors. It provides the same GDB server and all the goodness of automatic part discovery, but over TCP/IP (port 2000 by default) instead of a serial device. No config files, just a single binary - |
Hi 👋🏼 @dragonmux and thanks for the detailed explanation. Clear now :) |
Then I'll add the lines to Nucleo/Disco/Eval regardless of SoC and connectors -- Nucleo-64 and 144 always have the external debugger connectors, to which a BMP can be connected with a flat cable (assuming STLink/V2-A is no-MSD, pins tristated, or even in Reset). Discovery Kits are more varied, that is 32F072B-Disco, 32F407G-Disco, 32F429i-Disc1 have 6-pin connectors, but STM32MP157D-DK1 has nothing (testpoints for pogo jig don't count). The caveat is that BMP won't immediately support newly General Available chips like STM32U0, and stm32duino shouldn't limit the Programmer selection. BMDA is BMP logic on PC hardware (also runs on anything you compile it for, including SBC like Pi 3B) that bridges some USB wiggler to TCP socket (for Arduino 2 intents and purposes). That is the primary way some users upload&debug to Nucleo via its STLink/V2-A without resorting to OpenOCD Tcl.
Yes, I mean IDE 2 as opposed to IDE 1.8 (Processing) which had no Debug capabilities. Let's run a Discussion for that, sure. |
* Only GenF1, GenF3, GenF4, GenL0 and GenFlight allowed this by now, so extend support to the rest of chip families supported by BMP v2.0 * GenU0 and GenWBA are not supported.
7d0141a
to
c6b57c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Summary
This PR implements the following feature
Black Magic Debug Probe supports interactive debugging as well as one-shot uploading, via gdb script or multi-argument command line. This is useful with Generic boards which often don't have an onboard debugger. Method was contributed here earlier and carried on for GenF1, GenF3, GenF4, GenL0, GenFlight.
Let's extend this to 3rd party boards, too. Garatronic Pybstick26 was omitted because it only has LEDs on PA13/14 SWD, no testpoints even.
Of course I am unsure about allowing this on Nucleo/Disco/Eval products from ST, which should have a working STLink/V2 or V3E running proprietary firmware; but also P1x6 SWD 2.54mm or STDC-14 headers. If you deem this okay, then it's +20 more lines in a third commit.
BMDA does not create a COM port, it will need a new upload method for tcp socket (like openocd but simpler) which is how one uses BMDA with STLink backend (or CMSIS-DAP, or FTDI MPSSE, or JLink etc.) And of course you don't ship BMDA builds, there's no xPack for it but only GH CI builds and releases.
GenU0 and GenWBA are not supported by BMP (yet), it will treat them as generic Cortex-M without flash reprogramming.
Similar PRs: PR #2528 closing #2437 (CMSIS-DAP), PR #2455 closing #2452 (JLink). I wonder if something systemwide happened that you now have to set per-family
upload_method
s.Small feature request: is it possible to also Debug via BMP not OpenOCD in Theia IDE? What is required to configure Cortex-Debug for this automatically? Editing conffiles is less convenient. I may open a separate issue on this.
Validation
blackpill-f411ce
boards or so (one flashed with BMP, one running user sketches) just like two Raspberry Pico (they use picoprobe/debugprobe on one of them but it's not self-contained and needs OpenOCD/pyocd/probe-rs as gdbserver).Code formatting
boards.txt
, localastyle.py
doesn't complainClosing issues
Not opening an issue myself for this.