Skip to content

transfering a buffer of a single byte hits SPIM errata, causing 2 bytes to be clocked out #411

@korken89

Description

@korken89

Hi,

When doing the following one hits errata 58 in https://infocenter.nordicsemi.com/pdf/nRF52832_Rev_3_Errata_v1.1.pdf which causes the chip to clock out 2 bytes instead of only one.
Plus the CS line goes high while clocking causing weird things to happen on the bus.

The issues happen when RXD.MAXCNT = 1 and TXD.MAXCNT <= 1, which the code below hits.
I'm not sure how to best fix it.
Setting RXD.MAXCNT = 0 for 1 byte transactions fixes the issue but you also do not read a byte then, and some chips do send their status byte in every transaction during the first byte being sent - this would break this kind of status byte reading.

Code:

let mut buf = [Opcode::WriteEnable as u8];
spi.transfer(&mut cs, &mut buf).ok();

Trace:

image

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