I2C timeout not working correctly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 9:38 AM
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.
- Labels:
-
I2C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 11:10 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-14 11:38 AM
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.
