Skip to content

Deadlock in SERCOM::startTransmissionWIRE() #65

Open
@sampscl

Description

@sampscl

In SERCOM.cpp the startTransmissionWIRE() function does some setup, transmits the slave address, and waits on completion. In the current GitHub version (cf28026aef2f65e2ddc5c631d2b01a144ff0a068), this is on line 529. There are circumstances in which the MB flag will never be set, in particular when the bus is in an "unknown" state. I've run across the case where startTransmissionWIRE() deadlocks on the MB flag when addressing an SMBUS device on a SAMD21G18 MCU.

A temporary fix for me was to add a check for sercom->I2CM.INTFLAG.bit.ERROR and return false if that is set while waiting on MB. I didn't want to mod the code and do a pull request since I don't have a good way of verifying that my changes work in all circumstances and on all supported variants.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions