2020-03-13 10:14 AM
IN the function USBD_HID_setup for a class requese I added a case for send report.
case HID_REQ_SET_REPORT:
Debug::Instance()->printf(Debug::ALLWAYS, (char *) "Set report %X\n", req->wValue);
Debug::Instance()->printf(Debug::ALLWAYS, (char *) "Received: ");
for (int ii = 0; ii < req->wLength; ii++)
Debug::Instance()->printf(Debug::ALLWAYS, (char *) "%02X ", CtlEP0OutData[ii]);
Debug::Instance()->printf(Debug::ALLWAYS, (char *) "\n");
Report::Instance()->ProcessReport(CtlEP0OutData);
USBD_CtlPrepareRx(pdev, CtlEP0OutData, sizeof(CtlEP0OutData));
return USBD_OK;
break;
The first time I get here the buffer is empty, the second time is shows data from 1st transfer. Bus analysis says the data is being transferred as exepected. Moving USBD_CtlPrepareRx before the print (even with a delay) does not change the behavior.
Thanks for looking,
Rob
Solved! Go to Solution.
2020-03-13 12:07 PM
SOLVED
That part was just fine. You need to add an EP0 Rx Ready handler in the ClassTypeDef declaration. This is much clearer in the custom HID example.
2020-03-13 12:07 PM
SOLVED
That part was just fine. You need to add an EP0 Rx Ready handler in the ClassTypeDef declaration. This is much clearer in the custom HID example.