cancel
Showing results for 
Search instead for 
Did you mean: 

I2C timeout not working correctly

psusi
Associate II

I have tried enabling the timeout function in the I2C controller by setting a value in TIMEOUTA and setting TIMOUTEN. I can see the bus working normally on a scope, then when I connect with the debugger ( no reset, no upload ), the halt causes the timeout to occur and the timeout bit is set in the ISR, however, instead of releasing SDA and SCL, SDA remains held low jamming up the bus until I set PE=0 to disable the I2C controller.

2 REPLIES 2
TDK
Guru

Is the STM32 a master or slave?

Are you expecting the lines to go when the program is halted in debug mode? Probably need to continue for things to happen.

Timeout is an SMBUS feature. I2C has no timeout specified or allowed. Is the peripheral in SMBUS mode?

If you feel a post has answered your question, please click "Accept as Solution".
psusi
Associate II

It is both master and slave. I'm not sure what you mean about SMBUS mode. According to the manual, in the event of a timeout, both SDA and SCL are supposed to be released, but it appears that only SCL is.