-
Notifications
You must be signed in to change notification settings - Fork 36
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
Enumeration in FULL SPEED not working #5
Comments
The core(hardware) speed is set with USBD_LL_SetSpeed() from PCD reset callback in usbs_conf.c USBD_Init() set the stack speed in usb_device.c |
ok, but where is set dev_speed then? i cannot see it. if i set pdev->dev_speed manually to FULL SPEED then it works |
usb.c or usb_otg.c which automatically generated by cube. In this we have function name MX_USB_XXXXXXX_PCD_Init which will decide pdev->dev_speed USBD_SPEED_HIGH or USBD_SPEED_FULL |
this is how it is set on my cpu. looks good. but for some reason somewhere it switches to highspeed.
Vendor ID : 0x0483 (STMicroelectronics) dont know where to change that and i have problems with audio devices. they are not activated from windows. maybe it has something to do with the version? |
put breakpoint in HAL_PCD_ResetCallback() |
ok i found the "version". Its bcdUSB in USBD_DeviceDesc. |
it is definitive USBD_FULL_SPEED but if i do not set it manually again before if (USBD_RegisterClass(&hUsbDevice, &USBD_COMPOSITE) != USBD_OK) then it will be 0 again. |
have you enabled only audio or other classes as well |
aaah, i enabled it with 2 CDC Ports. So why this is not working together? |
I don't know |
audio plus other class, descriptors captured with wire shark looks good but enumeration fails |
are there audio controls implemented? mute, volume and so on? |
have not tried all features but the microphone implementation says it supports audio control |
in Ubuntu it is detected as 2xACM device and for audio as STM32 Composite SPDIF and STM32 Analog Output |
its strange. I added code to play back samples on I2S and now only microphone shows up in ubuntu and no speaker anymore... |
are you using audacity? |
are you able to enumerate in full speed mode? |
i have to set it manually. i have to look through the code where it is reseted |
reset function will be called when you plug the USB, then it will set the speed accordingly. |
in usbd_core.c line 178
here is a decision between HIGH SPEED and FULL SPEED but pdev->dev_speed is never set so it will be 0 and used as USBD_SPEED_HIGH. Therefore wrong descriptor settings will be used and enumeration is not working.
Fix could be to set dev_speed with #if (USBD_USE_HS == 1) somewhere before.
The text was updated successfully, but these errors were encountered: