aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-10-26 11:12:01 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-10-26 11:12:01 +0000
commite523acf824d24a45c3194a191057e1ed8f87b75d (patch)
treebe452257b75e049e26ab44e372513f343e716643 /os/hal/ports
parent6172fdfb71e9d65479f77dd6a01b6907293335de (diff)
downloadChibiOS-e523acf824d24a45c3194a191057e1ed8f87b75d.tar.gz
ChibiOS-e523acf824d24a45c3194a191057e1ed8f87b75d.tar.bz2
ChibiOS-e523acf824d24a45c3194a191057e1ed8f87b75d.zip
Fixed bug #786.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9879 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports')
-rw-r--r--os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
index 22ea69f31..52e44f011 100644
--- a/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
+++ b/os/hal/ports/STM32/LLD/OTGv1/hal_usb_lld.c
@@ -414,11 +414,17 @@ static void otg_epout_handler(USBDriver *usbp, usbep_t ep) {
/* Setup packets handling, setup packets are handled using a
specific callback.*/
_usb_isr_invoke_setup_cb(usbp, ep);
-
}
if ((epint & DOEPINT_XFRC) && (otgp->DOEPMSK & DOEPMSK_XFRCM)) {
- /* Receive transfer complete.*/
- USBOutEndpointState *osp = usbp->epc[ep]->out_state;
+ USBOutEndpointState *osp;
+
+ /* Receive transfer complete, checking if it is a SETUP transfer on EP0,
+ that it must be ignored, the STUPM handler will take care of it.*/
+ if ((ep == 0) && (usbp->ep0state == USB_EP0_WAITING_SETUP))
+ return;
+
+ /* OUT state structure pointer for this endpoint.*/
+ osp = usbp->epc[ep]->out_state;
/* A short packet always terminates a transaction.*/
if (((osp->rxcnt % usbp->epc[ep]->out_maxsize) == 0) &&