-
Notifications
You must be signed in to change notification settings - Fork 37
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
HID Keyboard + Audio Microphone #19
Comments
Dump USB data transfer for STM32 HID Keyboard standalone and for composite HID Keyboard + UAC MIC Looks like for composite device host doesn't read some config data and device for host is in wrong state. Data goes but rejected. RAW dump data |
After some changes my composite device works well. Thanks a lot of your huge work! |
That is nice!! Do you mind sharing your changes? If so, please send a pull request. |
I can explain my changes and test it on STM32L475. Now I have hardware USB protocol analyzer and can debug USB communications on low-level. General:
if(!STM32F1_DEVICE) else if (hpcd->Init.speed == PCD_SPEED_HIGH) { speed = USBD_SPEED_HIGH; }
I'll resume later. Your plugin is very helpfull I can help you to do it better. |
Also for HID keyboard I replaced report descriptor In the file usbd_hid_keyboard.h change size of report descriptor #define HID_KEYBOARD_REPORT_DESC_SIZE 63U In the file usbd_hid_keyboard.c replace report descriptor /* HID keyboard report descriptor */ |
After this changes for keyboard it works well. |
Generic changes for usb microphone:
#define AUDIO_MIC_VOL_MIN 0x0000 After this changes Windows 10 read its without any problem. Dirty solution for send audio data
case USB_REQ_SET_INTERFACE:
Very important that when capture started to fill any data to output buffer. Without data after few rejected IN requests in Windows and 5000 IN requests in Linux -> the MIC IN pipe will be stopped without notification on application side. I added play silent white noise before and after played prerecorded audio all time while capture exist. |
Need do working USB composite device USB keyboard and USB microphone. I did it for CubeMX standalone devices, it works well.
The MCU is STM32L476
STM32CubeMX 1.9.0
Software Pack Componet Selector marked:
Software Packs Parameter Settings marked:
Also configured FreeRTOS, MX_USB_DEVICE_Init() called at once when default task started.
Build process break on:
#if(!STM32F1_DEVICE) else if (hpcd->Init.speed == PCD_SPEED_HIGH) { speed = USBD_SPEED_HIGH; } #endif
PCD_SPEED_HIGH undeclared.
After remove this #if....#endif build process is success. PC Windows/Linux found composite USB device keyboard + microphone. But when I send key like keyboard via function USBD_HID_Keyboard_SendReport keys not typed on console. I used wireshark in Linux and see that MCU send ISO IN packet like in worked standalone solution. But no any key on console.
Also I see error in USB description by Thesicon USB Descriptor Dumper
`AC Interface Header Descriptor:
0x09 bLength
0x24 bDescriptorType
0x01 bDescriptorSubtype
0x0100 bcdADC
0x0026 wTotalLength (38 bytes)
0x01 bInCollection
0x02 baInterfaceNr(1)`
usb_composite_not_wrk.txt
What is wrong?
The text was updated successfully, but these errors were encountered: