STM32F302K8 I2C weirdness
I have noticed some very strange behavior with the I2C controller. It appears that when it has a slave address match, it sets the ADDR ISR flag and raises an interrupt ( if enabled ). If I have a breakpoint in the interrupt handler, the ISR BUSY flag remains set and it appears to be locking up the bus with an indefinate clock stretch. As I step through the ISR, as soon as it clears the ADDR flag, it stops blocking the bus and transfers the byte, clearing the BUSY flag, and setting STOPF and RXNE to indicate that there is a byte in the receive register. Why is the controller waiting for the ADDR flag to be cleared ( you may not even be interested in it and not enable its interrupt! ) before accepting the data byte? Then it gets even stranger. If I step to the next line of the ISR, the RXNE flag self clears before the ISR has a chance to recognize it and read from the RXDR. This definitely should not happen right?
