2025-05-23 12:33 PM
Hey everyone. I am trying to print something on TeraTerm console using USART2. I am using STM32L4R5ZI board for this function. Below is a picture of my .ioc file:
Below is the Code in my while(1) Loop:
Below is the configuration for USART2 in main.c file and msp_c:
Finally, this is my clock configuration for this project:
My teraterm settings are as follows:
I am trying to send some data to TeraTerm. However, nothing is being printed out.
Can someone help me out with this issue? @Peter BENSCH
2025-05-23 12:47 PM
When posting code, use the </> instead of screen shots
Use strlen instead of sizeof for strings. Don't use HAL_MAX_DELAY as that is ~49 days before it returns from a timeout. 100ms will suffice.
You don't check HAL status to see what could be the issue.
HAL_StatusTypeDef hal_status;
hal_status = HAL_UART_Transmit(&huart2, Test, strlen(Test), 100);
if(hal_status != HAL_OK)
{
if(hal_status == HAL_TIMEOUT)
{
// do something
}
else if(hal_status == HAL_BUSY)
{
// do something
}
else if(hal_status == HAL_ERROR)
{
// do something
}
}
2025-05-23 1:02 PM
Are you using a NUCLEO-L4R5ZI board?
Default solder bridge connects to PG7 and PG8.
2025-05-23 1:09 PM
Not USART2...