Skip to content

I2C repeated start not working on GD32F130 #132

Description

@JamesWhitlock

When performing a read from i2c slaves with registers, the wire library appears to be failing on repeated starts. The bus gets stuck in a clock low state and the I2C state machine gets stuck in I2C_BUSY.

To work around the issue I have forced the processor to send a stop and start by changing:

Wire.beginTransmission(address);
Wire.write(subAddress);
Wire.endTransmission(false);
Wire.requestFrom(address, (uint8_t)1);
uint8_t data = wire.read();

to

Wire.beginTransmission(address);
Wire.write(subAddress);
Wire.endTransmission();
Wire.requestFrom(address, (uint8_t)1);
uint8_t data = wire.read();

This behaviour was found on a MPU6050A slave device. I have not tried other slaves but I believe this behaviour lies within the GD32 libraries. Has anyone experienced similar (or disimilar) behaviour?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Component: I2CRegarding the I2C componentbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions