2025-07-08 9:13 AM
Hi. Last week I received my first STM32U5A5 board and tried to implement USBX HID standalone mode, following this tutorial. Guess what? I managed to make it work and It just works very well!
I should call
USBX_Device_Process(NULL);
in the main loop so the STM32U5A5 serves as USB HID device. My question is that, is it appropriate to call USBX_Device_Process function in the main loop, while the USB polling rate is 1000 Hz (depending on settings)? When debugging, that function is called multiple times per milliseconds and I'm worrying about some malfunctioning due to the excess of USBX_Device_Process calling.
Or is it totally fine repeating the USBX_Device_Process function without carefully configured timers or fitting the timing into the polling rate?
Thanks in advance!
2025-07-08 1:00 PM
Hi @ksi134340 & welcome to ST Community,
Calling USBX_Device_Process frequently is expected and normal:
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.