2026-02-22 10:52 AM - last edited on 2026-03-02 4:15 AM by KDJEM.1
Hello everyone,
I'm facing a very frustrating issue with USART2 on my Nucleo-L475VGT6 board using the built-in ST-LINK Virtual COM Port.
What works: - ST-LINK is detected (COM3 appears, Windows sound plays on connect)
- Code downloads successfully (no error in CubeIDE console)
- LED blinks (proof that main() is reached and while(1) is running)
- HAL_UART_Transmit is called
What does NOT work:
- Nothing appears in any terminal: MobaXterm, PuTTY, PowerShell serial reader
- No garbage, no partial characters, just black screen
- Same behavior in Run mode (no breakpoint) and after physical Reset button
MY code:
/* USER CODE BEGIN 0 */
uint8_t tx_buff[]={0,1,2,3,4,5,6,7,8,9};
/* USER CODE END 0 */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Transmit(&huart2, tx_buff, 10, 1000);
HAL_Delay(10000);
}
What am I missing? Is there a jumper / solder bridge I forgot on Nucleo-L475VGT6 for VCP? Or is there a known bug with USART2 VCP on L4 series?
Thank you very much for any hint!
Edited to apply source code formatting - please see How to insert source code for future reference.
Solved! Go to Solution.
2026-02-23 2:31 AM - edited 2026-02-23 2:32 AM
As the others have said, make sure you're using the pins which are physically connected to the ST-Link's VCP - see the board's User Manual and/or Schematics for details.
CubeMX should also show which pins are connected to the ST-Link's VCP.
2026-02-22 11:25 AM
> Nucleo-L475VGT6
This is not a board that exists. Perhaps you meant Nucleo-L476VGT6?
Are you using PA2/PA3?
You're sending non-ascii characters. How are you viewing them? Most terminal software will discard them. Perhaps send "Hello world\n" instead.
2026-02-22 11:29 AM
Welcome @emna, to the community!
There is no NUCLEO-L475VG, but you probably mean the B-L475E-IOT01A, which already has the status NRND (Not Recommended for New Designs). Anyway, if that's correct, the the debugger ST-LINK/V2-1 is not connected to USART2, but to USART1 (see the schematics).
Hope that answers your question?
Regards
/Peter
2026-02-23 2:31 AM - edited 2026-02-23 2:32 AM
As the others have said, make sure you're using the pins which are physically connected to the ST-Link's VCP - see the board's User Manual and/or Schematics for details.
CubeMX should also show which pins are connected to the ST-Link's VCP.
2026-02-25 12:23 PM
Thank you very much for your quick replies and for welcoming me to the community
I have installed the official ST-LINK driver , and configured PB6 and PB7 AS TX and RX PINS,
everything is stable now on USART1 . Thank you so much for your help it really guided me to check the right things in the manual and schematic.
2026-02-25 12:35 PM
Please accept as solution the post that answred your original question.
Thank you