-
-
Notifications
You must be signed in to change notification settings - Fork 795
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
Blackmagic Probe Autodetection Picks UART #4023
Comments
Potential fix for macOS if this is reproducible and not just my computer:
|
After testing on linux, ubuntu 20.04.2 returns "Black Magic Probe (STLINK/V2) v1.7.1-194-g8089e05-dirty - Black Magic UART Port" and "Black Magic Probe (STLINK/V2) v1.7.1-194-g8089e05-dirty - Black Magic GDB Port" for the description field, so filtering by "GDB" seems to work fine there. |
Note: I was able to test and received the same issue on Windows where it consistently picked COM4, but GDB was COM3. I'm not super familiar with Windows COM port ordering, but it seems to also be related to the usb interface descriptor number in some way. I'm not sure this is a great solution, but filtering by one digit in the hwid line (0 or 2) or guessing the first COM port instead of the second might be better options. I'm going to keep testing and make a fork with what I find |
Does it work if you specify You can also manually control |
FWIW, I've always had to specify the exact ports, and then things work fine. |
I completely missed notifications from this, evidently I need to fix that. Yes, it works if I manually specify the ports on all platforms. However, especially on windows since there is no difference in Device Manager between the GDB and UART ports, it's a guessing game and as a side issue that I probably should submit separately with blackmagic it seems to lock up when you accidentally use the uart port as GDB, so if you guess wrong you have to unplug it and plug it in again and hope it uses the same COM ports so you know which is which now. |
Thanks for the report! Could you re-test with |
On MacOS, I can now omit
As you can see, it picked the |
Fixed. Could you re-run |
Yep, latest now works for upload and monitor - i.e. port specs not needed when a single BMP is present \o/ |
Configuration
Operating system: macOS Catalina 10.15.7
PlatformIO Version (
platformio --version
): PlatformIO, version 5.0.3Description of problem
MacOS auto-detects incorrect serial port for black magic probe. On macOS, the serial ports are labeled by the descriptor index:
/dev/cu.usbmodemXXXXXXX#
where XXXXXX is the serial port identifier provided by the usb device and # is the interface descriptor id. I do not know if there is a better way of distinguishing these, my computer showsNone
forserial.tools.list_parts.ListPartInfo.interface
, but my computer does recognize the interface name:Adding a condition for macOS to filter by the interface descriptor id seems to be more reliable than searching for "GDB" in the usb description which will always be the same for both ports. For context, printing
item
on line 140 ofbuilder/tools/pioupload.py
shows:So identifying by usb description is not working. The usb descriptor id is a constant in the blackmagic probe firmware, and should be a good option to filter on for auto-detection unless the descriptors change in a new release of that firmware.
Steps to Reproduce
upload_port
Additional info
I'm working on making a PR and testing linux because I'm curious if there's a difference there. According to the pyserial docs: https://pyserial.readthedocs.io/en/latest/tools.html#serial.tools.list_ports.ListPortInfo it should always give the usb descriptor, not the individual interface descriptors for that "description" field in which case GDB filtering may have been broken on all non-windows platforms for a while.
The text was updated successfully, but these errors were encountered: