[HAL][LL][USB] Fix handling of ODDFRM bit in OTG_HCCHARx for Isochronous IN transactions
High bandwidth EPs are not supported yet
Signed-off-by: Aymen Bouattay <aymen.bouattay@st.com>
diff --git a/Src/stm32f2xx_hal_hcd.c b/Src/stm32f2xx_hal_hcd.c
index 47eaef2..e4190c2 100644
--- a/Src/stm32f2xx_hal_hcd.c
+++ b/Src/stm32f2xx_hal_hcd.c
@@ -1253,7 +1253,8 @@
       (void)USB_HC_Halt(hhcd->Instance, (uint8_t)ch_num);
       __HAL_HCD_CLEAR_HC_INT(ch_num, USB_OTG_HCINT_NAK);
     }
-    else if (hhcd->hc[ch_num].ep_type == EP_TYPE_INTR)
+    else if ((hhcd->hc[ch_num].ep_type == EP_TYPE_INTR) ||
+             (hhcd->hc[ch_num].ep_type == EP_TYPE_ISOC))
     {
       USBx_HC(ch_num)->HCCHAR |= USB_OTG_HCCHAR_ODDFRM;
       hhcd->hc[ch_num].urb_state = URB_DONE;
@@ -1264,17 +1265,6 @@
       HAL_HCD_HC_NotifyURBChange_Callback(hhcd, (uint8_t)ch_num, hhcd->hc[ch_num].urb_state);
 #endif /* USE_HAL_HCD_REGISTER_CALLBACKS */
     }
-    else if (hhcd->hc[ch_num].ep_type == EP_TYPE_ISOC)
-    {
-      hhcd->hc[ch_num].urb_state = URB_DONE;
-      hhcd->hc[ch_num].toggle_in ^= 1U;
-
-#if (USE_HAL_HCD_REGISTER_CALLBACKS == 1U)
-      hhcd->HC_NotifyURBChangeCallback(hhcd, (uint8_t)ch_num, hhcd->hc[ch_num].urb_state);
-#else
-      HAL_HCD_HC_NotifyURBChange_Callback(hhcd, (uint8_t)ch_num, hhcd->hc[ch_num].urb_state);
-#endif /* USE_HAL_HCD_REGISTER_CALLBACKS */
-    }
     else
     {
       /* ... */
diff --git a/Src/stm32f2xx_ll_usb.c b/Src/stm32f2xx_ll_usb.c
index 695d54c..9c463c8 100644
--- a/Src/stm32f2xx_ll_usb.c
+++ b/Src/stm32f2xx_ll_usb.c
@@ -1695,9 +1695,9 @@
                                       (((uint32_t)ep_type << 18) & USB_OTG_HCCHAR_EPTYP) |
                                       ((uint32_t)mps & USB_OTG_HCCHAR_MPSIZ) | HCcharEpDir | HCcharLowSpeed;
 
-  if (ep_type == EP_TYPE_INTR)
+  if ((ep_type == EP_TYPE_INTR) || (ep_type == EP_TYPE_ISOC))
   {
-    USBx_HC((uint32_t)ch_num)->HCCHAR |= USB_OTG_HCCHAR_ODDFRM ;
+    USBx_HC((uint32_t)ch_num)->HCCHAR |= USB_OTG_HCCHAR_ODDFRM;
   }
 
   return ret;