cancel
Showing results for 
Search instead for 
Did you mean: 

USB stick enum error on STM32H7B0 board

Huiqi
Visitor

Hi everyone:

 

I am trying to add USB stick support to STM32H7B0VBT based board. I used STM32CubeMX to generate code relating to USB host, FatFs, and system clock. USB plugging in and unplugging can be recognized by the middleware (in usbh_core.c), but the return value is always USBH_BUSY from function USBH_HandleEnum(). So the operation on USB stick is not functional. I have a few questions here:

1. We use the USB port as USB OTG, the D+ and D- signal is connected to ground with 1.5 ohm pull-down resistor.  Anything else should we take care of regarding to the USB OTG interface.

2. As to system clock, what is the best way to configure for USB OTG with STM32CubeMX.

3. As to the register relating to USB host, what registers should be checked, and what are the correct values for each register.

 

Thanks & Best Regards,

Arthur

1 REPLY 1
RPC
Associate

I tried increasing the number of interfaces changing the define USBH_MAX_NUM_INTERFACES and introducing some traces to se how many interfaces you have, I did so using usart and having the mcu connected to the computer.
The place where you read how many interfaces the device has is inside this function:
static USBH_StatusTypeDef USBH_ParseCfgDesc(USBH_HandleTypeDef *phost, uint8_t *buf, uint16_t length)

I managed to increase it and select the proper interface but I'm getting stucked on GetLineCodeCoding afterwards.

Tell me if changing that helped you.

Cheers