cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use print anything on teraterm using UART

Lm3332
Associate

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: 


ioc_file.png
Below is the Code in my while(1) Loop: 
Code_while(1)_Loop.png

Below is the configuration for USART2 in main.c file and msp_c: 

USART_main_c.pngUSART_msp_c.png

Finally, this is my clock configuration for this project: 

Clock_configuration.png

My teraterm settings are as follows: 
TeraTerm_setting.png

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 

1 ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
Karl Yamashita
Principal

When posting code, use the </> instead of screen shots

KarlYamashita_0-1748029633269.jpeg

 

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 } }

 

I was told that if a devices starts to smoke, put the smoke back in. I guess I never got all the smoke because the device never worked afterwards.
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
Chris21
Senior III

Are you using a NUCLEO-L4R5ZI board?

Default solder bridge connects to PG7 and PG8.

 

Chris21_0-1748030458697.png

 

Chris21_0-1748030911036.png

Not USART2...

Thank you. I knew that PG7 and PG8 were the terminals for my terminal. However, I was following a lot of tutorials on YouTube, and most of them were using USART2. That's why I was using it. 

 

Anyways, Thanks for the help. Appreciate it @Chris21