Ok just a little update: Error is still there, but occurs only on SDA line glitches. SCL is error prone.
To reproduce error:
1) Perform continuous communication with I2C slave in loop.
2) Toggle SDA line to ground externally.
3) In around 10% cases the MCU gets stuck in I2C1_EV_IRQHandler interrupt handler.
4) Safety timeout is set to 100 ms, but doesn't work.
Environment: STM32F100 low density and ChibiOs 2.4.2 + 10DOF board
This error should be very rare so I will probably rely on watchdog to recover from this state. But I think it is important to know that it might happen. I spent more than 5 hours trying to resolve this issue with no success. Maybe someone with deeper understanding of inner structure of the driver can be more successful.
I2C Bus error handling
Moderators: RoccoMarco, lbednarz, tfAteba
Re: I2C Bus error handling
nosense wrote:Ok just a little update: Error is still there, but occurs only on SDA line glitches. SCL is error prone.
To reproduce error:
1) Perform continuous communication with I2C slave in loop.
2) Toggle SDA line to ground externally.
3) In around 10% cases the MCU gets stuck in I2C1_EV_IRQHandler interrupt handler.
4) Safety timeout is set to 100 ms, but doesn't work.
Environment: STM32F100 low density and ChibiOs 2.4.2 + 10DOF board
This error should be very rare so I will probably rely on watchdog to recover from this state. But I think it is important to know that it might happen. I spent more than 5 hours trying to resolve this issue with no success. Maybe someone with deeper understanding of inner structure of the driver can be more successful.
Ahoj!
I also have a project, in which when I2C communication fails, it can hit the ground and kill thousand of innocent people
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: I2C Bus error handling
Hi,
The HW is crap, hopefully the I2C in F0 and F3 is better.
I am looking in a SW I2C implementation for the STM32F1, it might be not elegant but, at least, safer. It will be API compatible so you will be able to use the new implementation almost transparently.
Anyway if you want to try improvements get in touch with barthess who made most of the current driver and has a deeper experience with it.
Giovanni
The HW is crap, hopefully the I2C in F0 and F3 is better.
I am looking in a SW I2C implementation for the STM32F1, it might be not elegant but, at least, safer. It will be API compatible so you will be able to use the new implementation almost transparently.
Anyway if you want to try improvements get in touch with barthess who made most of the current driver and has a deeper experience with it.
Giovanni