jessebraham / icm42670

An embedded-hal driver for the ICM-42670 6-axis IMU
Apache License 2.0
7 stars 9 forks source link

esp32c3 Rust board returns Ack error #9

Closed elpiel closed 3 months ago

elpiel commented 8 months ago

As mentioned in the PR https://github.com/esp-rs/esp-hal/pull/862 the I2C impl of the icm42670 currently throws an Ack. error when initialising the sensor. I managed a few times to get acceleration data but only single reads. I believe there might be some timing issue.

! A panic occured in 'examples/i2c_icm42670.rs', at line 44, column 76

PanicInfo {
    payload: Any { .. },
    message: Some(
        called `Result::unwrap()` on an `Err` value: BusError(AckCheckFailed),
    ),
    location: Location {
        file: "examples/i2c_icm42670.rs",
        line: 44,
        col: 76,
    },
    can_unwind: true,
}

Not sure if this is relevant but accordingly to the datasheet

To write the internal ICM-42670-P registers, the master transmits the start condition (S), followed by the I2C address and the write bit (0). At the 9th clock cycle (when the clock is high), the ICM-42670-P acknowledges the transfer

elpiel commented 7 months ago

@jessebraham any luck trying to figure out why this ACK error happens?

jessebraham commented 3 months ago

Sorry it's been awhile since you commented @elpiel 😅 Did we determine that this was an issue with the Rust board? I seem to recall that being the case, so I'll assume my memory is correct and close this issue. Feel free to re-open if I am mistaken.

elpiel commented 3 months ago

Yes, correct @jessebraham , it was hardware related issue.