cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767ZI USART abnormal Rx in interrupt mode

Andrea Dall'Era
Associate II

I do my code with CUBEMX 5.6.0 with en.STM32Cube_FW_F7_V1.16.0 & Atollic 9.2.0.

My trouble :

when i send a data by USART3 (using putty or the terminal in Atollic) even if i set that i want to recive 1 byte the HAL_UART_RxCpltCallback is fired two time (like i set i want recive 2 byte), why it happen? What wrong i do?

I attach the file that i write/change using CUBEMX & Atollic => main.c & stm32f7xx_it.c, and a screenshot.

I try some solution (are commented inside the function) but i don't find one.

In the picture you can see:

1) If i send only one char, in the console i see the char that i send and an \r (i see it using debug ), and no error occured;

2) If i send 2 char, in the console i see the 2 char that i send, and no error occured;

3) If i send 3 char, in the console i see only 2 char, and no error occured;

I write HAL_UART_ErrorCallback in this way only for debug test.

1 REPLY 1
Andrea Dall'Era
Associate II

​FIND SOLUTION:

s1) See the picture.

s2) In the Putty configuration terminal last time i have seeting Local line editing = Force on  and i have the trouble, today i set Local line editing = Force off  and and the behaviour of the transmission gone right; i suppose that if i set 1st config the press of ENTER is sent (isn't only a wait used by putty to transmit when i want) so i have the trouble.

s3) If i sent from putty a char that is in the extend ascii table, the behaviour is like that i sent two byte but it is not right subdivide in two byte??

NOW I HAVE SOME QUESTIONS:

q1) why the behaviour that i said in point "s3" is like this ?

q2) where in Atollic i can configure the right procotol like in Putty (i supposed that the trouble is generated like in point "s2" for Putty) ?

q3) the code that i have writed is the right way to operate ? or ther is a better way?

Thank you.