Adding FreeRTOS into STM32Cube IDE project disables Virtual Com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-14 12:05 AM
Hello!
I have generated and run a project for testing the serial communication via Serial-UART bridge on STM32f407G-Disc1, following this tutorial https://willfrank.co.uk/stm32-vcp.html
It works as expected, but when FreeRTOS is added from .ioc file and the project is rebuilt and run, the virtual port is not visible anymore in Device Manager on Windows 11, if the call to the default task is commented out. All the configurations from the tutorial remain the same in the .ioc file. If FreeRTOS is disabled, and the project is rebuilt, the Virtual Com is visible once more, and the application is communicating (through DocLight in my case) with the host PC.
This seems to be because MX_USB_DEVICE_Init(); is now called into the default thread StartDefaultTask. What if one does not want to use the default task? Wouldn't it be better if MX_USB_DEVICE_Init(); were called after the initialization of configuration peripherals in the main function?
- Labels:
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-14 2:14 AM
> when FreeRTOS is added from .ioc file and the project is rebuilt and run, the virtual port is not visible anymore
Patient: - When I do this, it pains!
Doctor: - Don't do this.
Adding FreeRTOS to "bare metal" drastically changes the firmware behavior. Please find another example, based on FreeRTOS from the beginning. Or take your time and read the sources and do the needed changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-14 3:07 AM
My suggestion is only to move the MX_USB_DEVICE_Init(); call outside of the StartDefaultTask. I have moved it manually and it works fine.
