Skip to content

Disallow zero-length buffers in TWIM #208

@Dirbaio

Description

@Dirbaio

The TWIM hal functions don't check for zero-length buffers, and write 0 to TXD.MAXCNT / RXD.MAXCNT.

However Nordic's docs say the value should be in range [1..0xFFFF], so 0 is not allowed: https://infocenter.nordicsemi.com/topic/ps_nrf52840/twim.html?cp=4_0_0_5_30_6_22#register.RXD.MAXCNT

In practice. doing a zero-length write or read makes the current implementation hang forever. Maybe this should be checked, and return an error like Error::ZeroLengthBuffer

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions