2024-04-22 12:16 PM
Hello guys!
I'm using USB custom HID on STM32G0B for an application alike the mouse demo on "STM32G0C1E-EV" HAL package. But instead a button sending the Report, a PC software sends a 64 bytes Report to get another 64 bytes as answer.
In fact, this same code worked flawless on STM32H750 but on G0, I'm always getting a "loopback" answer after "USBD_HID_SendReport()" function, with some garbage bytes. I'm suspicious of the "USB_WritePMA" function, as it put a byte pointer to word buffer...
Do you guys have any tip about this?
Thanks again!
Solved! Go to Solution.
2024-04-23 04:27 AM
It turns out that I didn't set the PMA for OUT endpoint... So on "USBD_LL_Init" function, I must add a "HAL_PCDEx_PMAConfig" for address 0x01. Now it's working fine!
Thanks!
2024-04-22 02:12 PM
It looks like the "USB_WritePMA" is ok... The problem happens when the "USBD_HID_SendReport" function is inside of "USBD_HID_DataOut" routine, where I verify if the data received by PC is ok and then, send the response... But why?
2024-04-23 04:27 AM
It turns out that I didn't set the PMA for OUT endpoint... So on "USBD_LL_Init" function, I must add a "HAL_PCDEx_PMAConfig" for address 0x01. Now it's working fine!
Thanks!