Skip to main content
Graduate II
December 22, 2023
Solved

STM32F407G-DISC1 does not support virtual com, I cannot send data to PC via UART through virtual com

  • December 22, 2023
  • 4 replies
  • 5320 views

Hi All,

I can not send data from the board to the PC via UART. I can see that USART2 can be used as virtual com. But, when send data from board to the PC, I can not see anything on serial port, I use TeraTerm, Putty, Hercules. I thought the new version of STM32F407G-DISC1 board has this feature built in, but apparently it does not.

Can anyone help me with this please ?

    This topic has been closed for replies.
    Best answer by Tesla DeLorean

    Correct, only later models had the firmware/parts for the ST-LINK/V2-1 (mbed) however the PCB does not support physically connectivity to any of the UARTs like later DISCO and NUCLEO models.

    It could perhaps be wired, but honestly probably more of a headache. Perhaps use a cheap RPi-Pico as a USB-to-Serial, or use one of the NUCLEO-F429ZI, etc

    4 replies

    Technical Moderator
    December 22, 2023

    Hello @demir 

    I think the replays in this link can help you. 

    Best Regards.

    STTwo-32

    Graduate II
    December 22, 2023

    Correct, only later models had the firmware/parts for the ST-LINK/V2-1 (mbed) however the PCB does not support physically connectivity to any of the UARTs like later DISCO and NUCLEO models.

    It could perhaps be wired, but honestly probably more of a headache. Perhaps use a cheap RPi-Pico as a USB-to-Serial, or use one of the NUCLEO-F429ZI, etc

    Graduate II
    April 25, 2024

    I too have an STM32F407G-DISC1.

    I am successfully flashing code to it, and I know that the code

     

    HAL_UART_Transmit(&huart2, (uint8_t *)message, strlen(message), 100);

     

    runs, but I am not able to view my message by any means I have tried to cat ttyACM0, Putty, Serial Monitor plugin for VSCode.

    Is it really so that serial communication is unavailable for this board? Doesn't that make it useless if you are integrating it into a system and want to (e.g.) read some sensor values such as the accelerometer?

    demirAuthor
    Graduate II
    April 25, 2024

    Thats right, you need the serial to usb converter.

    demirAuthor
    Graduate II
    December 22, 2023

    Hi @Tesla DeLorean AND @STTwo-32 

    I have the STM32F407G-DISC1, MB997E. Isnt this supporting virtual com port ?

     

    Technical Moderator
    December 22, 2023

    No, this module include only  ST-LINK/V2-A wich is for SWD only without Virtual COM Port (VCP). But there is a workaround that allows you to retrofit the Virtual COM Port (VCP) for the ST-LINK/V2-A. You can find the workaround in the post mentionned on my first replay.

    Best Regards.

    STTwo-32 

    demirAuthor
    Graduate II
    December 22, 2023

    Could you please advise me some options that I can order which comes with Virtual Com Port ?

    Thank you.

    Graduate II
    April 26, 2024

    Thank you @demir and @Tesla DeLorean!

    I've been thinking there has to be a bug in my code, that 

    HAL_UART_Transmit(&huart2, (uint8_t *)message, strlen(message), 100);

    isn't the right way to print serial output. I've spent a few hours on this issue, and thanks to you I won't waste many more.

    Why does the function HAL_UART_Transmit even exist for the STM32F407G-DISC1?
    If it does work, it shouldn't exist, or perhaps the editor (I use VSCode) should at least display a warning.