Menu

#1055 i2cMasterTransmitTimeout assertion on reentry

19.1.4
closed-rejected
i2c (3) HAL (2)
HAL
Medium
18.2.2
False
2020-01-18
2019-11-06
No

Imaging having a timeout while sending something over I2C. This will set I2C to a locked state:
https://github.com/ChibiOS/ChibiOS/blob/00e51f29768d4592d5ba0d5cb54a325e73b474ea/os/hal/src/hal_i2c.c#L238-L241
However what if for some reason one would like to try again immediatly? In this case the following assert will emerge:
https://github.com/ChibiOS/ChibiOS/blob/00e51f29768d4592d5ba0d5cb54a325e73b474ea/os/hal/src/hal_i2c.c#L184

Is it a desired behaviour?

Discussion

  • Giovanni Di Sirio

    • assigned_to: Giovanni Di Sirio
    • Affected Version: 19.1.3 --> 18.2.2
     
  • Giovanni Di Sirio

    Hi,

    It is the expected behavior, see the state machine diagram here:

    http://chibios.sourceforge.net/docs3/hal/group___i2_c.html

    An i2cStart() or i2cStop() is expected after entering the locked state, then you can try again. This gives the LLD a chance to implement a recovery strategy in the re-start. A timeout usually means that the I2C or the slave are misbehaving somehow, normally you don't get timeouts.

    Do you see problems with this approach?

    Giovanni

     
  • Giovanni Di Sirio

    • status: open --> closed-rejected
     

Log in to post a comment.

MongoDB Logo MongoDB