This is an automated email from the ASF dual-hosted git repository. antmerlino pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 41e1696b2711492f8957a1d51e45d6e86c437532 Author: David Sidrane <david.sidr...@nscdg.com> AuthorDate: Thu Sep 9 10:03:51 2021 -0700 stm32f4:USB otgdev Ensure proper EP state Repeated automated sercon, serdis on VBUS proved to fail for CDCACM DATA IN (device Serial TX). The root cause was that the EP was left active after disconnect. This resulted in the first serial write falling to kick-off the EP IN request. That should restart the EP ISR. --- arch/arm/src/stm32/stm32_otgfsdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index 8c6e24a..31e3a95 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -2090,6 +2090,8 @@ static void stm32_usbreset(struct stm32_usbdev_s *priv) /* Reset IN endpoint status */ privep->stalled = false; + privep->active = false; + privep->zlp = false; /* Return read requests to the class implementation */ @@ -2099,6 +2101,8 @@ static void stm32_usbreset(struct stm32_usbdev_s *priv) /* Reset endpoint status */ privep->stalled = false; + privep->active = false; + privep->zlp = false; } stm32_putreg(0xffffffff, STM32_OTGFS_DAINT); @@ -4003,6 +4007,8 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, privep->ep.maxpacket = maxpacket; privep->eptype = eptype; privep->stalled = false; + privep->active = false; + privep->zlp = false; } /* Enable the interrupt for this endpoint */ @@ -4101,6 +4107,8 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, privep->ep.maxpacket = maxpacket; privep->eptype = eptype; privep->stalled = false; + privep->active = false; + privep->zlp = false; } /* Enable the interrupt for this endpoint */