How to call MX_USB_HOST_Process() from freeRTOS Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-12 4:28 PM
Update: I found a timer1 conflict with the USB_OTG so I do think this will be resolved once I fix the timer1. I'm learning how to use STM32CubeIDE with freeRTOS to program my STM32F407 DISCO board. From my understanding, I have to call MX_USB_HOST_Process() to keep my debugger/IDE updated. Since the main loop in my main.c file is no longer called and superseded by freeRTOS, I created a defaultTask who's sole job is to call 'MX_USB_HOST_Process()'. I created a default_task.h and default_task.c file and include the usb_host.h file however I get an 'undefined reference error' when calling 'MX_USB_HOST_Process();.
Is there an example for using STM32CubeIDE with freeRTOS tasks instead of a main.c loop?
I included the default_task.c file
- Labels:
-
FreeRTOS
-
STM32F4 Series
-
TIM
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-04-19 4:29 AM
Hello @LMorr.3​
You can refer to the following example provided under the F4 Firmware Package:
- Path: Projects\STM32469I_EVAL\Applications\USB_Host\HID_RTOS
I hope this helps.
BeST Regards,
Walid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-05-16 11:34 AM - edited ‎2023-11-20 7:44 AM
You do not need to manually call MX_USB_HOST_Process() when using RTOS. As long as you enable USBH_USE_OS under Middleware->USB_HOST in the .ioc file, the automatic code generation should take care of it for you.
In my case, it inserted a MX_USB_HOST_Init() call into my first task. All I had to do was add an osDelay() in the for loop and USB worked just fine. I don't know where MX_USB_HOST_Process() is being called, but it must be somewhere hidden in the RTOS code.
