Skip to content

Commit 99c9ff1

Browse files
committed
[USB] Fix EPO STALL issue in STM32 USB Device library
USB Specification EP0 should never STALL during setup stage. Device is not properly setup if STALL present. Fixes #664 Signed-off-by: Frederic.Pillon <[email protected]>
1 parent cef14f4 commit 99c9ff1

File tree

1 file changed

+6
-4
lines changed
  • system/Middlewares/ST/STM32_USB_Device_Library/Core/Src

1 file changed

+6
-4
lines changed

system/Middlewares/ST/STM32_USB_Device_Library/Core/Src/usbd_core.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,14 @@ USBD_StatusTypeDef USBD_LL_DataInStage(USBD_HandleTypeDef *pdev,
393393
}
394394
else
395395
{
396-
if ((pdev->pClass->EP0_TxSent != NULL) &&
397-
(pdev->dev_state == USBD_STATE_CONFIGURED))
396+
if (pdev->dev_state == USBD_STATE_CONFIGURED)
398397
{
399-
pdev->pClass->EP0_TxSent(pdev);
398+
if (pdev->pClass->EP0_TxSent != NULL)
399+
{
400+
pdev->pClass->EP0_TxSent(pdev);
401+
}
402+
USBD_LL_StallEP(pdev, 0x80U);
400403
}
401-
USBD_LL_StallEP(pdev, 0x80U);
402404
USBD_CtlReceiveStatus(pdev);
403405
}
404406
}

0 commit comments

Comments
 (0)