STM32L496ZGT6PU STLINK UART communication not working
Goodmorning
I have a new STM32L496ZGT6PU board and I'm currently trying to print a message on the debugger serial terminal, I've followed many official guides step by step failing every time.
In particular, I perform the following:
- Connect the board through a USB type micro-B cable to my laptop (USB PWR connector).
- Create a new STM32 project, selecting the NUCLEO-L496ZG-P board from the board selector -> target language C++ -> initialize the peripherals with their default mode (YES).
- In Pinout & Configuration I go to Connectivity -> USART2 -> Mode Asynchronous and leave the default values.
- Device Configuration Tool Code Generation
- In Src/main.c simply write the following two lines of code in the main() function:
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Transmit(&huart2, (uint8_t*)"Ciao ", 6, 100);
HAL_Delay(1000);
}
/* USER CODE END 3 */
Then I build the project and start Debug keeping the default settings.
During the debug I create a new command shell console with
- Connection Type: Serial Port
- Serial port: COM6 (my PC seems to correctly recognize the STLINK on this COM port)
- Baudrate: 115200
- Data size: 8
- Parity: none
- Stop bits: 1
By clicking on "resume", the code seems to run, but nothing pops on the serial console.
I tried to use an equal board, change the cable, and change USART interface but this didn't solve the problem.

