AnsweredAssumed Answered

Need help with RS232 receive & STMCubeMx

Question asked by Osto on Aug 2, 2014
Latest reply on Apr 25, 2015 by m.antoine

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.