Skip to main content
kNass.1
Associate
Solved

stm32f4 UART receive interrupt - can't process more than one character

Dear All,

So, i have just implemented Uart receive as an interrupt on the stm32f401re board using the HAL library in STM32cube ide.

I have failed to process characters when they are more than one.

Any advise for me, i will be glad.

This topic has been closed for replies.
Tesla DeLorean
Tesla DeLoreanBest answer
Guru

Should we try to guess what you did in the failing case? Or the type of messages and test cases?

​

As you fill a buffer with each byte as it arrives under interrupt make a determination ​if you have completed the message or reached the end of line case. If using as strings NUL terminate the buffer before processing.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..

3 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru

Should we try to guess what you did in the failing case? Or the type of messages and test cases?

​

As you fill a buffer with each byte as it arrives under interrupt make a determination ​if you have completed the message or reached the end of line case. If using as strings NUL terminate the buffer before processing.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
kNass.1
kNass.1Author
Associate

Thank you @Community member​  for this advice, Let me give my best shot ot it.

kNass.1
kNass.1Author
Associate

hello @Community member​  , this an appreciation note to you. After your previous response to my post, i searched further on this community , where am still new and came across your piece code your previously shared where you reading 1 byte at a time handling the Nmea sentence. I have borrowed it and implemented it on my end and its working for me well. Thank you.