AnsweredAssumed Answered

I2C Slave Cannot Clear STOPF Flag

Question asked by clark.david.001 on Jul 19, 2012
Latest reply on Jul 19, 2012 by fm

Another small little conundrum I am hoping someone out there might help me solve.

I have got an i2c master and slave talking to each other, I'm fairly sure the Master code is good as it's been working with other non stm32 slave devices.

The Slave however is a different story, although I've actually got it working reasonable i.e. I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED, setup DMA to transfer data all of which it is doing. Unfortunately my I2C IRQ call is getting itself into an infinite loop whereby an interrupt is triggered, and it's always I2C_EVENT_SLAVE_STOP_DETECTED.

I've tried clearing it using the following commands (after stopping the DMA) :-

       I2C_ClearFlag(I2C1, I2C_FLAG_STOPF);     
     (void)(I2C_GetITStatus(I2C1, I2C_IT_STOPF));
     while(!I2C_CheckEvent(I2C1, I2C_EVENT_SLAVE_STOP_DETECTED))

but the interrupt continues occurring, and checking the code the other end it doesn't appear to be getting repeatedly generated by the Master.

Many thanks for any responses in advance.