adafruit / ArduinoCore-samd

114 stars 116 forks source link

samd51 wire hangs when no device connected #162

Closed GMagician closed 4 years ago

GMagician commented 4 years ago

it seems there is an issue in wire library in function: bool SERCOM::startTransmissionWIRE(uint8_t address, SercomWireReadWriteFlag flag)

my AGCM4 boards with marlin configured for an I2C eeprom hangs in:

    while( !sercom->I2CM.INTFLAG.bit.MB )
    {
      // Wait transmission complete
    }

but I don't know why...usually i2c should trasmit and detect missing slave because of ACK missing...how to fix this?

ladyada commented 4 years ago

you need to have pullups on i2c

GMagician commented 4 years ago

why are they needed? what happens on bus/Soc if missing (and they are missing since no shield is connected)?

ladyada commented 4 years ago

because i2c specification requires it. i2c will always hang/crash without them, they are required!