Skip to main content
kNass.1
Associate
Feb 13, 2021 3:29 AM UTC
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
Feb 13, 2021 9:23 AM UTC

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
Feb 13, 2021 9:23 AM UTC

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
Feb 13, 2021 9:55 AM UTC

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

kNass.1
kNass.1Author
Associate
Feb 15, 2021 3:19 AM UTC

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.