2020-04-12 11:47 PM
I cannot for the life of me find out where the interface descriptors are defined. Examples I have found on the web indicate ( for a CDC device at least ) a file "usbd_desc.c / h" that contains the definitions. There is no equivalent usbh_desc.c file. I can find the structures ok but not where they are initilised. So, my question is: in which file are the interface descriptors initialised?
Solved! Go to Solution.
2020-04-13 04:57 PM
Actually cracked it. I was looking for a matching interface in the Cube generated code rather than interogating the device to see what it needs. The function:
interface = USBH_FindInterface(phost, DATA_INTERFACE_CLASS_CODE,
RESERVED, VENDOR_SPECIFIC); //NO_CLASS_SPECIFIC_PROTOCOL_CODE);
when changed to look for "VENDOR_SPECIFIC" instead of the generated "NO_CLASS_SPECIFIC_PROTOCOL_CODE" resulted in getting data coming through. All that was then needed was:
if(Appli_state == APPLICATION_READY) {
if(USBH_CDC_Receive(&hUsbHostFS, buff, 1024) == USBH_OK) {
printf("%s\r\n", buff);
}
}
added to the while loop in main();
2020-04-13 04:57 PM
Actually cracked it. I was looking for a matching interface in the Cube generated code rather than interogating the device to see what it needs. The function:
interface = USBH_FindInterface(phost, DATA_INTERFACE_CLASS_CODE,
RESERVED, VENDOR_SPECIFIC); //NO_CLASS_SPECIFIC_PROTOCOL_CODE);
when changed to look for "VENDOR_SPECIFIC" instead of the generated "NO_CLASS_SPECIFIC_PROTOCOL_CODE" resulted in getting data coming through. All that was then needed was:
if(Appli_state == APPLICATION_READY) {
if(USBH_CDC_Receive(&hUsbHostFS, buff, 1024) == USBH_OK) {
printf("%s\r\n", buff);
}
}
added to the while loop in main();