-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug on STM32F2 USB Low Layer HAL #13066
Comments
@RamiroOliveira Following the steps above, I tested cdc_acm_composite sample on olimexino_stm32 and stm32f3_disco. It works fine. But on my 96b_carbon kernel I get the same error. |
@RamiroOliveira, @finikorg, @ydamigos , correct me if I'm wrong but AFAIU, CDC ACM requires 3 endpoints per instance whereas stm32f4 (and f2) usb otgfs offers only four bidirectional endpoints, which makes impossible to run the acm composite sample. I, however, agree that we should gracefully fail at build or runtime in such situation. Note: It also explains why it works with stm32f3_disco (8 bidir endpoints) |
The stack should not start with this configuration, usb_validate_ep_cfg_data (and usb_dc_ep_check_cap in the driver) would fail. @RamiroOliveira can you please set USB_DRIVER_LOG_LEVEL to debug and post the console output? |
Do you mean |
@jfischer-phytec-iot The console output on my 96b_carbon: For some reason HAL_PCD_EP_Open() in not called for ep 0x84. Later we try to write to ep 0x84 which is not opened (and, as a result, its maxpacket size is not configured, so it is zero) and stm32cube HAL function Edit:
|
As @loicpoulain mentioned (96b_carbon) stm32f4 offers 4 bidirectional endpoints (including EP0) so it can't run acm composite sample. |
Describe the bug
When creating a composite device using #12682 on a STM32 Nucleo F207ZG board, the kernel panics.
According to addr2line the faulty error occurs in ext/hal/st/stm32cube/stm32f2xx/drivers/src/stm32f2xx_ll_usb.c on line 573 because ep->maxpacket is 0 when a division operation occurs.
Using other boards (stm32f072b-disco) this issue doesn't occur which might point to an error on the F2 USB LL HAL.
Seems related with #7364.
@erwango @finikorg @ydamigos @loicpoulain
To Reproduce
Steps to reproduce the behavior:
3 mkdir build; cd build
minicom --device /dev/ttyACM0
minicom --device /dev/ttyACM1
minicom --device /dev/ttyACM2
Expected behavior
The sample should run without error and data sent from ACM1 should appear on ACM2 and vice-versa.
Impact
Kernel crashes
Screenshots or console output
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: