Closed froha closed 3 years ago
Hi @froha,
Thank you for your report. May I ask you the firmware version you are using and the file the potential issue is located into.
With regards,
Hi @ALABSTM,
we use a combination from the old Standard Peripherals Library and only the USB part from the STM32CubeF2 library. We made this for supporting multiclass devices like CDC+MSC, but that is an other story.
STM32F2xx Standard Peripherals Library Drivers V1.1.2 STM32CubeF2 STM32F2xx HAL Drivers V1.1.1 STM32 USB Host Library V3.2.2
Best regards
Hi @froha,
Regarding the F2 HAL, latest version is v1.2.4. Regarding USB Host library, latest version supported in F2 firmware is v3.3.3. Would you mind migrating to these and check whether the issue still persists?
May I also know which source file the couple of lines of code you put in your first comment are extracted from. It would help us very much to locate and fix the issue if confirmed.
Thank you,
Hi @ALABSTM,
no, because the flag is not handled in the source code, so it wouldn't solve the problem. We fixed it ourselves and made other changes. And i cannot reproduce a Babble Error now to verify.
The line of codes are from the STM32CubeF4 / Drivers / STM32F4xx_HAL_Driver / Src / stm32f4xx_hal_hcd.c file. https://github.com/STMicroelectronics/STM32CubeF4/blob/5d01400afd60410f6e049cbd19179a67d44d53fd/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c#L1173
Best regards
Hi @froha,
Thank you for these details. Your report will be sent to our development teams for further analysis. I will get back to you as soon as I get their feedback.
Best regards,
Hi @froha,
The issue you pointed out has been confirmed by our development teams.
Actually, the handling of the babble error has been internally implemented. The update should be available in the frame of the next release of the STM32CubeF2 FW package. We cannot share a date for the moment. It should be done soon enough hopefully.
In the meanwhile, please find attached the updated version of the hal_hcd
source files (along with hal_pcd
and ll_usb
source files needed for successful compilation) hoping this helps. Thank you again for your contribution.
With regards,
The flag USB_OTG_HCINT_BBERR is not handled in the HCD_HC_IN_IRQHandler. So if this occurs, then the flag would never be cleared and the interrupt is always running.
The CubeF4 HCD_HC_IN_IRQHandler does handle the babble error:
else if ((USBx_HC(ch_num)->HCINT & USB_OTG_HCINT_BBERR) == USB_OTG_HCINT_BBERR) { __HAL_HCD_CLEAR_HC_INT(ch_num, USB_OTG_HCINT_BBERR); hhcd->hc[ch_num].state = HC_BBLERR; __HAL_HCD_UNMASK_HALT_HC_INT(ch_num); (void)USB_HC_Halt(hhcd->Instance, (uint8_t)ch_num); }