USB control transfers vs ZLP

Niibe Yutaka gniibe at fsij.org
Mon Oct 7 09:09:36 CEST 2019


Jeremy Drake wrote:
> Confirmed this fix works with both versions of GCC I've tested with.
>
> diff --git a/mcu/usb-st-common.c b/mcu/usb-st-common.c
> index b97df38..58fe4fc 100644
> --- a/mcu/usb-st-common.c
> +++ b/mcu/usb-st-common.c
> @@ -235,10 +235,9 @@ usb_lld_init (struct usb_dev *dev, uint8_t feature)
>    USB->CNTR = CNTR_FRES;
>    USB->CNTR = 0;
>
> -  USB->BTABLE = 0;
> -
>    /* Clear Interrupt Status Register, and enable interrupt for USB */
>    USB->ISTR = 0;
> +  USB->BTABLE = 0;
>    USB->CNTR = (CNTR_CTRM | CNTR_OVRM | CNTR_ERRM
>                | CNTR_WKUPM | CNTR_SUSPM | CNTR_RESETM);
>  }

Thanks a lot.  I applied your patch and pushed it.
-- 



More information about the Gnuk-users mailing list