Skip to main content
Stanford
Associate II
August 28, 2023
Question

USB HID Host MX_USB_HOST_Process Call

  • August 28, 2023
  • 1 reply
  • 1414 views

I've setup my STM32L475 non-RTOS as a USB HID Host to interface with a barcode scanner.  All works well if I call sdf MX_USB_HOST_Process in my main application loop with no delays.  However, if MX_USB_HOST_Process is not called fast enough, characters are missed.  How have others handled calling MX_USB_HOST_Process?  (if I were using FreeRTOS, then this call could be made from a dedicated task).  One person suggested using a low priority timer interrupt.  However, I was wondering if there was another solution.  thanks

This topic has been closed for replies.

1 reply

AScha.3
Super User
August 28, 2023

i have the MX_USB_HOST_Process() at the end of main while-loop, is called about at 200us interval, when nothing else happens. but maybe also 120ms HAL-delay comes, for delay after keypress, no problem with USB.

i use usb-MSC host, connect to usb-stick, reading data for constant data rate at about 1.6 Mbit . the FAT data read is in interrupt , so no problem. 

important is INT priority ... :) 

usb is highest of other int , see:

AScha3_0-1693238139809.png

 

If you feel a post has answered your question, please click on " Best Answer ".