cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with RS232 receive & STMCubeMx

Osto
Senior
Posted on August 02, 2014 at 08:45

Hi,

I'm using RS232 on USART2 of STM32F407 with CubeMx 4.0. I have a protocol which starts with '[' and ends with ']'. I need everythin between 2 braces and I have variable record length. So its not possible to use HAL_UART_Receive_IT because the length need to be known at time of call.

Therre is also no way to set a delimiter or any character to stop receving or call HAL_UART_RxCpltCallback when it receives a defined character. Something like readline() or similar. Right now, I have a big buffer (max possible size + 10) and check the huart structure manually and process them when there is anything received.

But I think, its not the right way to do that.

Have anybody an idea how such problem should be solved?

Thanks in advance.
This discussion is locked. Please start a new topic to ask your question.
10 REPLIES 10
cladstrife911
Associate
Posted on April 25, 2015 at 18:39

Hello Reay.rob,

What you did is exactly what I need, could you please share some simple code sample?

Thank you

Antoine