cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 USB Low Speed Enumeration fail issue

JitendraD20
Associate

Hello,

Greetings to all community members,

 This post is regarding USB enumeration in STM32H7 series. I am currently using MCU STM32H747XIH6 for one my project in which I am configuring this MCU in USB Host by using USB_OTG feature available in it. I am using firmware package of STM32Cube_FW_H7_V1.11.0 as a reference driver and USB HOST library from it.

I am currently testing USB HID Keyboard on the custom PCB of above mentioned controller from which it has been observed that some keyboard are get detecting (i.e. enumerating and then registering its class) while some are not.

For example, if I connect "DELL" keyboard to my PCB then it get fail in enumeration process, while other keyboard get enumerated after some trials and some keyboard get enumerated instantly...!!!

While debugging though code, I found that after HOST_DEV_ATTACHED stage is completed and HOST_ENUMERATION stage get starts, it first transfer command of get descriptor from USB keyboard and in state machine of USBH_PROCESS(), after CTRL_SETUP_WAIT stage, nothing get happened and it get repeats its states as per state machine.

Further debugging, I also found that after first command send from STM32H7 to keyboard, URB status was first "URB_TXERR" and then "URB_NOTREADY" and get stuck there till device plugged in there.

I want to know why some of keyboard which is "LOW SPEED" category device get enumeration while some are not? Is there any update in library of USB peripheral which I need to implement or I need to change some code section?

If anyone already faced this or similar kind of issue then please give suggestion or direction for debugging of same.

If any further information required then please let me know. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @JitendraD20 


I suggest you update the latest version of middleware as it adds some checks to the size of descriptors that are larger than allocated buffer. So, it helps to provide clear error message for debugging. Also, you can check report descriptors for each keyboard.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

2 REPLIES 2
FBL
ST Employee

Hi @JitendraD20 


I suggest you update the latest version of middleware as it adds some checks to the size of descriptors that are larger than allocated buffer. So, it helps to provide clear error message for debugging. Also, you can check report descriptors for each keyboard.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @FBL 

Thanks for this solution. 

UPDATE: As per your suggestion, I had changed HAL driver file of stm32h7xx_ll_usb.c and stm32h7xx_ll_usb.h for USB driver with latest version of 1.11.3 from ST HAL Library (Master) found on Github of link below:

https://github.com/STMicroelectronics/stm32h7xx_hal_driver

However, a new problem and possible cause for this issue was found out that, the delay used in USB state machine (and for whole working of USB functionality) named HAL_Delay() is not accurate thus causing timing issue in USB operation.

When further back-tracing this delay funciton it was found that SysTick_Handler() in my code isn't get triggered thus unable to increment timer in HAL_Delay().

As per some fourm suggestion, I had check that #define USER_VECT_TAB_ADDRESS should be uncomment which is indeed same in my code. But still unable to trigger SysTick_Handler().

Please suggest me direction in which I need to check code or some code snippets which I need to update or to check.

Thank you very much in advance for your precious time.