Ostiole can now use SEGGER J-Link probes directly over USB. Its J-Link package finds the probe’s application interface, reads its firmware and capabilities, configures SWD, and sends raw bit streams. Building it meant reconstructing enough of the USB protocol to know not only which bytes to send, but exactly how many to expect back.
The protocol is simple in a way that is not especially forgiving. Each request starts with a one-byte operation code followed by whatever data that operation needs. The reply contains only that operation’s response: no common header, transaction number, length, checksum, or error envelope. Read the wrong number of bytes once and the leftovers can look like the answer to the next request.
One documented RTCK measurement made the risk unusually concrete. On my J-Link EDU Mini V2, the request went out, no reply came back, and the probe stayed wedged after I closed it and reset the USB device. It recovered only after I unplugged and reconnected it.
The complete reconstruction is now this Trace. Ostiole uses it for the J-Link support that exists today, and there is enough protocol in it for another implementation to start without first reconstructing the same conversation from old clients and a probe on the bench.