Skip to content

Async I2C-device driver implementation locks up #104

@polygon

Description

@polygon

I want to use a CH32 to read out some analog peripherals and provide the values via I2C. I built an async driver that operates the I2C peripheral in device mode (also requested in #70). I put the code and a demo here:

https://github.com/polygon/ch32_i2cdevice/

It works for a while and then stops. Requests are no longer answered, the program spins in the embassy executor, and interrupts on the I2C device are disabled (ITEVTEN=0, ITERREN=0 in I2C1_CTLR2). I can't really see a way how these interrupts could get disabled while the poll function is being waited on (I verified that it's awaiting listen).

Very happy for ideas about what might be going wrong here.

Driver src: https://github.com/polygon/ch32_i2cdevice/blob/main/src/i2c_device.rs
Demo src: https://github.com/polygon/ch32_i2cdevice/blob/main/src/bin/demo.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions