USB Set/get report control transfer failing on STM32G4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-09-06 2:06 PM
I'm using STM32G473 with the STM32_USB_Device_Library files. I set up a custom HID device with 1 IN EP. It is enumerating correctly and can successfully communicate bulk transfers with the host (proprietary software proven to work with other STM32 MCUs).
However when the host sends a set report request it fails to receive an ACK from the device. All other control transfer requests from the host (e.g. get descriptor) succeeds so I'm at a loss to why only the set report request fails. Are there any working examples for USB customHID projects with control transfers out there? Any help is appreciated.
- USBlyzer results where you can see the device receiving and then sending back the report, but the transfer then fails on the host side due to no ACKs.
- Code inside setup stage of USBD_Class that handles set/get report requests.
case HID_REQ_GET_REPORT:
reportID = uint8_t (req->wValue & 0x00FF);
uint8_t packetSize = PackConfigReports(reportID, (uint8_t*)&DataToHost, \
COMM_INTERFACE_USB);
if(packetSize > 0)
{
USBD_CtlSendData(&hUsbDeviceFS, DataToHost, packetSize);
}
else
{
USBD_CtlError (&hUsbDeviceFS, req);
}
break;
case HID_REQ_SET_REPORT:
reportID = uint8_t (req->wValue & 0x00FF);
USBD_CtlPrepareRx(&hUsbDeviceFS, DataFromHost, packetSize);
break;
Labels:
- Labels:
-
STM32G4 Series
-
USB
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
