Skip to content

Commit

Permalink
firmware: fix ZLPs for USB0 EP0
Browse files Browse the repository at this point in the history
This fixes 64-byte-aligned USB0 commands, which were broken due to a Linux spec violation.
See greatscottgadgets/greatfet#283 for more details.
  • Loading branch information
Qyriad committed Sep 24, 2019
1 parent f21543a commit 595e619
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions firmware/platform/lpc43xx/drivers/usb/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,11 @@ void usb_endpoint_init_without_descriptor(
{
bool zero_length_terminate = (transfer_type == USB_TRANSFER_TYPE_CONTROL) && !manual_zlps;

// IN EP0 needs non-automatic-ZLPs to work around a Linux spec violation.
if (endpoint->address == 0) {
zero_length_terminate = false;
}

usb_endpoint_flush(endpoint);

// TODO: There are more capabilities to adjust based on the endpoint
Expand Down

0 comments on commit 595e619

Please sign in to comment.