Skip to content

i2c hang whole avr - probably twi library loops #7328

Closed
@smarq8

Description

@smarq8

Why i2c/wire library does not have any timeout fuses? Its known issue froam a years and still no solutions.
Its my 4th project where endTransmission or requestFrom hang my avr.

probably hanging code:

  while(TWI_READY != twi_state){
    continue;
  }
or
  while(TWI_MRX == twi_state){
    continue;
  }
or
  while(TWI_READY != twi_state){
    continue;
  }
or
  while(wait && (TWI_MTX == twi_state)){
    continue;
  }
or
  while(TWCR & _BV(TWSTO)){
    continue;
  }

In worst case I should receive error or corrupted data so I can repeat operation. Haging whole avr beacuse some random noise on I2C line or damaged I2C device (in some situations) is not acceptet in my opinion. And as I said, many peoples complains on that form a years and still no solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Architecture: AVRApplies only to the AVR microcontrollers (Uno, etc.)Library: WireThe Wire Arduino libraryType: BugType: DuplicateAnother item already exists for this topic

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions