As libusb has no real async callback, we need to call libusb_handle_events() in different places. While waiting for the gdb connection, we set the socket to non-blocking and check additional for usb events in that loop. That way, detach is also detected while waiting for connection. With debugger attached, SET_IDLE_STATE ist missused for checking for usb events.
Stlink V2/3 with original STM firmware as Blackmagic Debug Probes
Recent STM Stlink firmware revision (V3 and V2 >= J32) expose nearly all functionality that BMP needs. This branch implements blackmagic debug probe for the STM Stlink as a proof of concept. Use at your own risk, but report or better fix problems.
Run the resulting blackmagic_stlinkv2 executabel to start the gdb server
CrosscCompling for windows with mingw succeeds.
Drawback: JTAG does not work for chains with multiple devices.
This branch may get forced push. In case of problems:
- git reset --hard master
- git rebase