STM32F4 I2C BTF interrupt is generated repeatedly until the stop is generated
I've been developing my own I2C interface. When the BTF is set, I issue STOP. However, the interrupt routine is repeatedly called until the STOP is generated..
In document it says that BTF is cleared by hardware after a start or stop condition in transmission. It looks like, setting STOP does not clear. The hardware waits until STOP is detected on the line..
Here is the whole transaction:

STOP part zoomed:

The numbers in the last row is simple trace output via pins. 1 means irq routine started, 6 means BTF flag is set and is being processed.. The routine is called repeatedly until a stop condition is generated..
How can I prevent module to generate Irq's until the stop is generated?