Decrease the control USB pipe size on f103 blackmagic probes to 8 bytes

Rationale:
In USB device mode, the f103 chip provides 512 bytes
of memory for USB traffic. In the 'master' branch
of the blackmagic probe, the control endpoint pipe size
is set to 64 bytes, effectively consuming a quarter
(1 'in' endpoint, 1 'out' endpoint == 2 endpoints,
2 /* endpoints */ x 64 /* bytes per endpoint */ == 128 bytes
out of 512 /* bytes of precious usb packet memory */).
The USB standard, for full speed devices, does allow
a control endpoint size of 8 bytes.

I am not too aware of all the details of the USB standard,
but the USB standard seems to allow fragmented transactions
on the control USB pipe (endpoint 0), which libopencm3
apparently supports:
libopencm3/lib/usb/usb_control.c:usb_control_send_chunk()

I am using this change (from 64, to 8 bytes)
on a windows 10 machine, on an stlink hardware
('PROBE_HOST=stlink'). It works on my machine.

This change can potentially provide other USB endpoints
in the blackmagic firmware with more memory
This commit is contained in:
Stoyan Shopov 2020-06-02 21:27:13 +03:00 committed by UweBonnes
parent 69e330849d
commit 34a13723d8
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ static const struct usb_device_descriptor dev = {
.bDeviceClass = 0xEF, /* Miscellaneous Device */
.bDeviceSubClass = 2, /* Common Class */
.bDeviceProtocol = 1, /* Interface Association */
.bMaxPacketSize0 = 64,
.bMaxPacketSize0 = 8,
.idVendor = 0x1D50,
.idProduct = 0x6018,
.bcdDevice = 0x0100,