STM32F407 USB host enumeration routine is not called
Hi, my USB host (CDC class) enumeration get stalled when the device is attached and enumeration status is ENUM_IDLE. The "IF then" test statement "if ( USBH_HandleEnum(phost) == USBH_OK)" should call the routine USBH_HandleEnum() but it does not and the calling routine exits immediately. I'm single stepping the code in debug mode within my IDE.
In USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost) (USBH_Core.c)
....
case HOST_ENUMERATION: // The case is host enumeration so that is correctly found
/* Check for enumeration status */
if ( USBH_HandleEnum(phost) == USBH_OK) // this does not test USBH_HandleEnum and heads straight to exit....
{
/* The function shall return USBH_OK when full enumeration is complete */
USBH_UsrLog ("Enumeration done.");
phost->device.current_interface = 0;
... etc
The routine that should be called is (same lib USBH_Core.c)
**
* @brief USBH_HandleEnum
* This function includes the complete enumeration process
* @param phost: Host Handle
* @retval USBH_Status
*/
static USBH_StatusTypeDef USBH_HandleEnum (USBH_HandleTypeDef *phost)
{
USBH_StatusTypeDef Status = USBH_BUSY;
switch (phost->EnumState)
{
case ENUM_IDLE:
/* Get Device Desc for only 1st 8 bytes : To get EP0 MaxPacketSize */
if ( USBH_Get_DevDesc(phost, 8) == USBH_OK)
{
phost->Control.pipe_size = phost->device.DevDesc.bMaxPacketSize;
phost->EnumState = ENUM_GET_FULL_DEV_DESC;
...etc
Why is that happening? Is it a compiler error or setting? I don't get compiler errors or warning for this code.
Both routines are within USBH_Core.c so it should be able to call this routine.
edits: I can't set a breakpoint in static USBH_StatusTypeDef USBH_HandleEnum (USBH_HandleTypeDef *phost)
I can set breakpoints in other parts of USBH_Core.c
Thanks,
Paul
