I'm using the i2c-slave patch from http://forum.chibios.org/phpbb/viewtopic.php?f=2&t=1502&start=40#p18502 thread on the STM32F4 with ChibiOS 3.
Slave-RX works so far.
Only sometimes i get a problem when sending, and the other master supposedly sends at the same time (?).
I call i2cMasterTransmitTimeout(..) wich calls i2c_lld_master_transmit_timeout(..). The Function returns with MSG_TIMEOUT.
now the following code is called:
Code: Select all
if (rdymsg == MSG_TIMEOUT)
i2cp->state = I2C_LOCKED
else
i2cp->state = I2C_READY;which keeps me in a locked state.
How to recover from such an error? After the state is I2C_LOCKED nothing ever will reset it again!!
The I2C registers MSL (master mode), BUSY and TRA (transmitter mode) are SET!
Best,
Peter