2025-05-29 5:14 AM
Hello everyone, I am having a problem with a simple program. My board is a STM32-U575ZITxQ.
Using only the USART1 interface, if I try to print the string: "USART1_READY" on my laptop's serial port, I have no problem. However, as soon as I also enable the USART2, I cannot print anything. Whether with only the USART2 enabled, or with both USART1 and USART2 enabled, if I try to print the string with USART2, I cannot. I checked all the settings of the USART1 and USART2 and they are the same (in GPIO, in Parameter setting, etc.).
/* USER CODE BEGIN PV */
char USART1 = "USART1_READY:\r\n";
char USART2= "USART2_READY:\r\n";
/* USER CODE END PV */
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start_IT(&htim4);//ready for trigger at 1 seconds
/* USER CODE END 2 */
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance == TIM4)
{
//HAL_UART_Transmit(&huart1, &USART1, sizeof(USART1),HAL_MAX_DELAY);
HAL_UART_Transmit(&huart2, &USART2, sizeof(USART2),HAL_MAX_DELAY);
}
}
where am I going wrong?
Solved! Go to Solution.
2025-05-29 6:15 AM
@SMusc.1 wrote:VCP is the com serial port of laptop right?
"VCP" = Virtual COM Port - it is part of the ST-Link on the board:
via: https://www.st.com/en/evaluation-tools/nucleo-u575zi-q.html#documentation
2025-05-29 6:16 AM
I am using a simple USB cable connected to USB port of my laptop tho the board. I see that the port com associate to this connection is any time COM4. How can i know which com port are used from USART2 and USART3 of my nucleo board?
2025-05-29 6:21 AM - edited 2025-05-29 6:22 AM
@SMusc.1 wrote:I am using a simple USB cable connected to USB port of my laptop tho the board. I see that the port com associate to this connection is any time COM4.
That is the VCP of the ST-Link - see my previous post
@SMusc.1 wrote:How can i know which com port are used from USART2 and USART3 of my nucleo board?
There is no other COM port.
If you want additional COM ports to connect to those UARTs, you will need to provide them yourself; eg, using USB-to-UART adaptors or cables
https://uk.rs-online.com/web/p/development-tool-accessories/6877770
2025-05-29 6:26 AM
okay clear, tks a lot to everyone