STM32F030 USART bug?
- April 20, 2019
- 9 replies
- 3062 views
When working with a STM32F030C8T6 board, communicating with another board through serial comms (115200bps), I suddenly started to get erroneous characters once in a while, when the remote board were sending data at the same time.
It's a block protocol, with the remote board sending 256 byte blocks and the F030 board sending ACKs (hex 0x06) along the way.
It had worked fine, when the ACK from the F030 was sent after a full block. When sending while there was still incoming data, the start bit of the outgoing data was suddenly shortened a bit, resulting in incorrect data being received in the remote end.
The logic traces show this.
Start bit + one bit should be 17.38us (bit time 8.68us), which can be seen to be correct in the "normal startbit" screenshot. In the "short startbit" screenshot, this time is only 12.62us.
( I don't know if it's actually the startbit or the first bit that is corrupted, but assume it is the startbit). Following bits are all okay.
This causes the 0x06 to be read as 0x83 (as the analyser also shows). I've had a case where it was read as 0x07 instead of 0x06, which could indicate that the bit corruption is not just happening on the startbit.
The data were captured on the TX/TX of the CPU, USART1.
USART1 was running code with interrupt driven TX and RX. I've tried changing the TX to be "direct" (look at TXE bit to see if it's ready, then write to TDR). This does NOT change the behaviour.
This seems to indicate that there might be an issue with the HW implementation of the USART.
I've checked the Erratas, but could not find anything related to this.
The CPU marking is STM32F030C8T6 AA039 1198 TWN AA 826
Any takers? Comments?
