STM32F101
seem to be experiencing random I2C lockup at startup/reset.
when locked up the SDA line in low all the time. If it doesn't lockup then it seems to run ok.
the software is still running and calling i2cMasterTransmitTimeout, but it just returns -1 MSG_RESET.
I2C Lockup
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: I2C Lockup
It is possible your debugger is resetting the device while the I2C is in use, the device will be locked after the reset.
Giovanni
Giovanni
Re: I2C Lockup
Giovanni wrote:It is possible your debugger is resetting the device while the I2C is in use, the device will be locked after the reset.
Giovanni
it does it even when the debugger is not connected
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: I2C Lockup
Try putting I2C IRQ priority above the other peripherals.
Also: http://wiki.chibios.org/dokuwiki/doku.p ... e_shooting
Giovanni
Also: http://wiki.chibios.org/dokuwiki/doku.p ... e_shooting
Giovanni
Re: I2C Lockup
This could happen when the slave and the master become unsynchronized. The slave is apparently transmitting a "zero" right now, while your master thinks it is no longer inside a byte. The raspberry pi can, under certain circumstances, generate a VERY short pulse that the slave may not recognize as a pulse, but because it itself generated that pulse, it knows it's sent it.
Anyway, Put the SCL pin in open-drain mode and produce 9 pulses. Wait 5 microseconds before each toggle (100kHz max).
Anyway, Put the SCL pin in open-drain mode and produce 9 pulses. Wait 5 microseconds before each toggle (100kHz max).
Re: I2C Lockup
Giovanni wrote:Try putting I2C IRQ priority above the other peripherals.
Also: http://wiki.chibios.org/dokuwiki/doku.p ... e_shooting
Giovanni
It is 5 for Ints and 3 for DMA does not make any difference.
So i dropped the driver, and bit banged it, now everything works great