cancel
Showing results for 
Search instead for 
Did you mean: 

print messages are not coming in teraterm

jacobgeorge
Associate II

Hai,

I am using STM32L496ZG-P board and STM32CUBE IDE (1.15.1).

 

I tried to print hello world in tera term using UART/USART,USB etc , i tried many programs by reffering many videos in youtube, and some docs from STM communinty link etc etc,. Maximum all the ways i tried , but running is successfull, i can debug also , but prints are not coming in tera term. Some basic baudrate ,stopbit etc settings are all i checked properly, still i am not getting. 

Please help me for this.

I connected the STM32L496ZG-P board to the laptop using USB cable which is present at debugger side of the board. So is there any jumper settings or shall i have to use any usb converter or any tx rx pin i need to connect. Please tell me.

 

Thanku

 

4 REPLIES 4
Imen.D
ST Employee

Hello @jacobgeorge and welcome to the Community :)

Ensure that the UART peripheral is correctly configured, and that Tera Term is configured with the correct settings to match the UART configuration. This includes the correct COM port, baud rate, data bits, parity, and stop bits.

Here is an example configuration :

void UART_Init(void) {
    UART_HandleTypeDef huart;
    huart.Instance = USARTx; // Replace with your UART instance
    huart.Init.BaudRate = 115200;
    huart.Init.WordLength = UART_WORDLENGTH_8B;
    huart.Init.StopBits = UART_STOPBITS_1;
    huart.Init.Parity = UART_PARITY_NONE;
    huart.Init.Mode = UART_MODE_TX_RX;
    huart.Init.HwFlowCtl = UART_HWCONTROL_NONE;
    huart.Init.OverSampling = UART_OVERSAMPLING_16;

    if (HAL_UART_Init(&huart) != HAL_OK) {
        // Initialization error
        Error_Handler();
    }
}

Check the physical connections between the board and the PC. Ensure that the TX and RX lines are properly connected, and that the USB cable is working correctly.

Ensure that the ST-LINK Virtual COM port is enabled and correctly configured.

I recommend you check one of the ready-to-use UART examples available in the STM32CubeL4 firmware package to identify what you have missed.

I suggest you debug and localize where the code hangs/stop: check if the UART transmit function is being called. You can set breakpoints and check the status of the UART peripheral and identify what is the problem that you see and when it occurs.

How to redirect the printf function to a UART for ... - STMicroelectronics Community

Otherwise, you can share your code, your ioc file or post some screenshots of the CubeMX configuration to check it.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
jacobgeorge
Associate II

Did STM32L496ZG-P boards supports for SWV(Serial wire viewer). Can i see the printf output there?

Hello @jacobgeorge  did @Imen.D comment answered your question and got messages on TeraTerm?


Can i see the printf output there?

What do you mean by "there"? in TeraTerm?

You can use Serial Wire Viewer for example with CubeIDE in debug mode.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Andrew Neil
Evangelist III

@jacobgeorge wrote:

I tried to print hello world in tera term using UART/USART,USB etc


Please show what you tried.

See the Posting Tips for how to post your source code; also show a schematic of how you connected it all up:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228