2022-09-22 02:15 AM
I"m using my Nucelo-H745ZI-Q board with HAL for USB with CDC. I'm hitting the hard fault at the host project from the USBH_CDC_Transmit() function. On debuggin, I can see that the phost (USBH_HandleTypeDef type) ->ActiveClass->pData has no valid data.
And the "phost->pclass[0]->ClassCode == phost->device.CfgDesc.Itf_Desc[0].bInterfaceClass"
is failing. On checking the structure values, Left side , it is CDC class value 2 while on the right side at the device side it is zero.
Also before this line, in the USBH_Init() function, we are setting the phost->ActiveClass = NULL.
Similarly, in the USBH_process function, the execution is going into only one cases of the
switch (phost->gState) , i.e., HOST_IDLE , which is initialized by default. So the USBH_process is essentially not gettind executed.
On briefing :
Whenever I try to force change this by adding my code, it is resulting in other mismatch error.
Please tell me where I'm doing it wrong. Expecting for a reply soon.