AnsweredAssumed Answered

STM8L I²C problem with BTF

Question asked by oakley.jonathan on Jan 28, 2015
Hi folks

I've been debugging some code written by someone who susequently left the project, so I can't ask him...

The code in question runs on an STM8L151G4, and concerns using it as an I²C slave, using interrupts. 99.999% of the time everything works as expected, but just occasionally the interrupt will trigger with the BTF flag set but neither TXE nor RXNE set. As far as I can tell from the reference manual this is not a valid combination, but I though maybe the collected wisdom here might have a better insight!

Unfortunately this happens about every 5 hours of running, or longer, so it's really hard to capture exactly what has occurred. At the point where the flags are in this state DR has been neither read nor written, there shouldn't have been a start or stop condition and PE should still be set - even if any of these had happened, BTF should have been cleared along with the TXE/RXNE bits.

Any ideas?

Best regards