STMicroelectronics / STM32CubeF2

STM32Cube MCU Full Package for the STM32F2 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
Other
43 stars 25 forks source link

Babble error is not in HCD_HC_IN_IRQHandler #3

Closed froha closed 3 years ago

froha commented 4 years ago

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); }

ALABSTM commented 4 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,

froha commented 4 years ago

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

ALABSTM commented 4 years ago

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,

froha commented 4 years ago

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

ALABSTM commented 4 years ago

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,

ALABSTM commented 4 years ago

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,