micropython/shared/tinyusb
Angus Gratton d11ca092f7 shared/tinyusb: Fix dynamic USB control callbacks for wLength==0.
In the case where an OUT control transfer triggers with wLength==0 (i.e.
all data sent in the SETUP phase, and no additional data phase) the
callbacks were previously implemented to return b"" (i.e. an empty buffer
for the data phase).

However this didn't actually work as intended because b"" can't provide a
RW buffer (needed for OUT transfers with a data phase to write data into),
so actually the endpoint would stall.

The symptom was often that the device process the request (if processing
it in the SETUP phase when all information was already available), but the
host sees the endpoint stall and eventually returns an error.

This commit changes the behaviour so returning True from the SETUP phase of
a control transfer queues a zero length status response.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-04-17 12:39:47 +10:00
..
mp_cdc_common.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mp_usbd.c extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
mp_usbd.h extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
mp_usbd_descriptor.c extmod/machine_usb_device: Add support for Python USB devices. 2024-03-15 14:22:11 +11:00
mp_usbd_runtime.c shared/tinyusb: Fix dynamic USB control callbacks for wLength==0. 2024-04-17 12:39:47 +10:00
tusb_config.h shared/tinyusb: Increase default string descr max length to 40 chars. 2024-03-27 23:57:57 +11:00