AnsweredAssumed Answered

Loss of synchro while transmitting data using STM32

Question asked by jackblack.po on Aug 27, 2011
Latest reply on Aug 28, 2011 by Andrew Neil
Dear STM32 users,

I am facing an issue not related to the micro, it seems to be a general topic when transmitting data over usart.
In my application I have an STM32 micro that will transmitt and receive data to/from another device (let us say device X).
The STM32 device is doing the following steps:
 1- Receive 16-byte from the device X
 2- Process the received 16-byte data : this process is a workload for the STM32
 3- Receive a new buffer of 16-byte (I am using a time-out for error handling)

The device X:
1- Transmit a 16-byte to STM32 device
2- Make an active delay
3- Transmit a new 16-byte to STM32 device

I discovered that sometimes the device X transmit the new buffer while the STM32 is processing data (step 2).
Using delay is not good especially that I have the two systems running @ different frequencies.
I was thinking to use hardware flow control but the usart embedded in STM32 is doing flow control on a single byte and not on 16-byte buffer.

Is there a solution how to synchronize the two devices and avoid this desynchro?

Thank you in advance and have a nice week-end.