cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4 teraterm

VYoun
Associate III

Hello,

I want to use teratern to send a string to my usart on stm32f4, but nothing is received.

these are the settings of my teraterm

0690X00000D9AtpQAF.png

0690X00000D9AvRQAV.png

0690X00000D9AwZQAV.png0690X00000D9AwFQAV.png

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

UART is a stream (not message) based protocol. You can't assume that your message is at the beginning of received data block.

View solution in original post

7 REPLIES 7
VYoun
Associate III

I intend to receive a string from using the code below:

HAL_UART_Receive(&huart3, (uint8_t *) usartReceiveBuffer, sizeof (usartReceiveBuffer),100);

However, I can not receive anything from Teraterm.

I can, for example, receive data from Hterm, but not from teraterm.

Please help is you can.

Thank you and best regards,

Assuming the F4 discovery, it has a V2.0 ST-Link, without VCP link to the target.

So, do you see any output from the F407 Tx pin ?

Did you check the connection (F407-Tx to PC-Rx) ?

For a serial connection to a PC, you need a level converter to at least 5V. The 3.3V of the MCU Tx is not sufficient.

VYoun
Associate III

Hello,

Thank you for your reply.

There is output on the TX pin and the connection to PC is ok.

Data is shown on the HTerm. Hterm also receives data from PC and transmit to MCU.

My problem is that Hterm hangs when I want to use it for a data stream.

The data stream is shown on the Tere term, but I can not take any USART Receive data.

Thank you again for your help

> My problem is that Hterm hangs when I want to use it for a data stream.

> The data stream is shown on the Tere term, but I can not take any USART Receive data.

It's not clear to me what you mean here.

But according to the screenshots, hterm operates in VT100 mode, i.e. it emulates the behavior of a old mainframe terminal.

Those therminals used to operate line-based, not character-based.

Try setting it to a raw mode, without any character preprocessing or interpretation.

I'm using Linux for such stuff, not familiar with HTerm. I had worked with PuTTY once, which has such a raw mode.

VYoun
Associate III

Hello,

> It's not clear to me what you mean here.

sorry I think i was not very clear about this.

I have designed an interface using USART which takes the user input and starts the program. It uses the following code to take data from USART.

while (whileLoopFlag [1] == 1)
{
	memset(usartReceiveBuffer,0,sizeof(usartReceiveBuffer));
	HAL_UART_Receive(&huart3, (uint8_t *) usartReceiveBuffer, 255, 100);
 
	if (strcasecmp(startMeasString, usartReceiveBuffer) == 0){
	    memset(usartReceiveBuffer,0,sizeof(usartReceiveBuffer));
 
	    printChooseMsrmntMethodMenu();
 
	    whileLoopFlag [1] = 0;
 
	    whileLoopFlag [4] = 1;
	}
}

The code takes a string from USART and compares it with another string, and makes a flag one if the two strings match.

The program works on Hterm. When I enter data in the input section the program works.

However, on Tera Term it does not work. When I type data in Tera Term, the entered data is not seen.

I can only see the entered data when I turn on the local echo.

even after turning on the local echo, the entered data is not taken with the USART Receive, and it does not start the program.

I tried to add a "\r\n" in the end of my reference string, the string with which the entered string is compared, but this also does not work.

This is really confusing me, thank you in advance for your help.

Best regards,

Vouria

Screenshots are from Tera Term and basic text printing should work in VT100 mode also.

Piranha
Chief II

UART is a stream (not message) based protocol. You can't assume that your message is at the beginning of received data block.