cancel
Showing results for 
Search instead for 
Did you mean: 

HAL UART Receive with Interrupt issue

mushfiq
Associate II
Posted on September 13, 2016 at 22:12

Hello everyone i'm a beginner, i have implemented uart receive of variable number of characters successfully using IRQ and RXCmpltCallback , what i did is i have received each character one by one and then inserting it in an array of chars, i have used an ''if check'' to identify the terminating symbol in my case i used the newline character. but now i want to modify my code so that i wont need any terminating symbol such as the newline character, is there any way to know whether the whole UART receive process is complete or like checking any flag or uart status ??? 

#uart #stm32f103
2 REPLIES 2
Posted on September 13, 2016 at 22:45

> is there any way to know whether the whole UART receive process is complete or like checking any flag or uart status ???

A special character for this purpose is probably the best option. There are schemes to compensate for the reserved character in the character set, usually envolving escaping, e.g. https://en.wikipedia.org/wiki/High-Level_Data_Link_Control#Asynchronous_framing .

In theory, handshake signals (RTS/CTS, DTR/DSR) could be used for framing, but in practice the various drivers mainly on PC have usually trouble maintaining synchronicity and such schemes then create more problems than they solve.

JW
mushfiq
Associate II
Posted on September 14, 2016 at 11:26

thanks for ur reply wacklawek.jan but my question is i wanna implement a simple function like Serial.available() does in arduino, as u know it returns the number of byte Serial or Uart port read .... what i actually wanted to know , is there any way so that i will know the whole bunch of character reception is complete or not by calling any getstatus function call or checking any flag ???