Skip to main content
Senior
September 9, 2025
Question

STM32F4xx example project FreeRTOS+CLI with USB virtual com port

  • September 9, 2025
  • 2 replies
  • 432 views

Is there an STMF4xx example project I can reference for using a virtual COM port to connect to FreeRTOS+CLI? I tried to do this myself by having the FreeRTOS+CLI function _write() call CDC_Transmit_FS() and by having CDC_Receive_FS() call a function that puts the received data into a circular queue, and then calls vTaskNotifyGiveFromISR() to tell the CommandConsoleTask that there is data in the queue for it to process.

I see CDC_Transmit_FS() being called, but a breakpoint in CDC_TransmitCplt_FS() never fires, and no data appears in a Tera Term window connected to the serial port labeled as STMicroelectronics STLink Virtual COM Port (COM4). Likewise, typing into the Tera Term window does not result in a breakpoint in CDC_Receive_FS() ever getting hit.

I'm sure I'm doing something fundamentally wrong, but what?

2 replies

MGogr.1
Senior
September 10, 2025

Tera Term can be connected to the serial port labeled as STMicroelectronics STLink Virtual COM Port. There are separate pins configured to connect using virtual com port. Tera term is connected to one of the uart configuration.

You can check using other virtual com port.

Senior
September 10, 2025

That much I already figured out. My question is about an example project I can use to see how the embedded side works, so that I can connect the command task to the virtual COM port.

Pavel A.
Super User
October 8, 2025
Technical Moderator
October 8, 2025

Hello @jlthompson 
If you still need help on this topic,

You can refer to this knowledge base article, which explains how to integrate and use the FreeRTOS™ command-line interface (CLI) library.

You can also search GitHub for existing projects on this subject.

Gyessine

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.