cancel
Showing results for 
Search instead for 
Did you mean: 

Adding FreeRTOS into STM32Cube IDE project disables Virtual Com

cristina-stangaciu
Associate

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?

2 REPLIES 2
Pavel A.
Evangelist III

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.

 

cristina-stangaciu
Associate

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.