STM32 USB HOST cannot get line configuration of device
Hi, I am trying to use a Nucleo-H745ZIQ to implement the USB CDC HOST functionality over the USB OTG FS port.
I succeeded to do it and make it work if the device connected to my board is another STM32 board which is configured as an usb device, and the communication works alright.
The problem comes when I try to do the same with a modem. The modem has 1 configuration, and 4 interfaces. I increased the USBH_MAX_NUM_INTERFACES to match that and forced it to choose the CDC class from the device which is the Third interface and his CDC data class interface the fourth.
The problem is that it cannot get past the HOST_CLASS_REQUEST state on the state machine because I'm getting this result: CDC: Device Get Line Coding configuration failed. Does somebody knows which could be the problem?
The sections of code I've changed so far if anyone is interested to check:
Inside usbh_core.c:
- Changed ltf_desc[0] for [2] because the interface I want to use is the third, cause its CDC.
if (phost->pClass[idx]->ClassCode == phost->device.CfgDesc.Itf_Desc[2].bInterfaceClass)
{
phost->pActiveClass = phost->pClass[idx];
break;
} - Changed the USBH_MAX_NUM_INTERFACES from 2 to 4 adapted to the device because I read it on the descriptors.
- USBH_ParseDevDesc(): device descriptor: idVendor = 5446, idProduct = 4422, bcdDevice = 256,iManufacturer=1, iProduct=2, iSerialNumber=3, bNumConfigurations=1
- USBH_ParseCfgDesc(): Configuration descriptor: blength = 9, bDescriptorType = 2, wTotalLength = 141,bNumInterfaces=4, bConfigurationValue=1, iConfiguration=0, bmAttributes=224, bMaxPower=250
There's what I see about interfaces on the logs:
- USBH_FindInterface(): bInterfaceClass = 224, ExpectedInterfaceClass= 2,bInterfaceSubClass= 1, Expected Subclass= 2,bInterfaceProtocol= 3, Expected Protocol= 1
- USBH_FindInterface(): bInterfaceClass = 10, ExpectedInterfaceClass= 2,bInterfaceSubClass= 0, Expected Subclass= 2,bInterfaceProtocol= 0, Expected Protocol= 1
- USBH_FindInterface(): bInterfaceClass = 2, ExpectedInterfaceClass= 2,bInterfaceSubClass= 2, Expected Subclass= 2,bInterfaceProtocol= 1, Expected Protocol= 1
- USBH_FindInterface(): bInterfaceClass = 224, ExpectedInterfaceClass= 10,bInterfaceSubClass= 1, Expected Subclass= 0,bInterfaceProtocol= 3, Expected Protocol= 0
- USBH_FindInterface(): bInterfaceClass = 10, ExpectedInterfaceClass= 10,bInterfaceSubClass= 0, Expected Subclass= 0,bInterfaceProtocol= 0, Expected Protocol= 0
If you need any further information or portion of code I can provide it.
Thank you very much in advance.
