This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

spim errorsrc 0x01

nRF52, SPIM0, I'm getting EVENTS_ERROR with ERRORSRC set to 0x01. However that error isn't documented, 0x02 is ANACK, 0x04 is DNACK, what's 0x01?

  • Hi RK,

    As far as I know there is no ERRORSRC register for SPIM. SPI and TWI share registers, and it seems to me you refer to the TWIM registers. Are you sure you have not enabled conflicting SPI and TWI instances, and that you are operating the correct peripheral?

    The TWIS ERRORSRC register uses 0x01, 0x04 and 0x08 for OVERFLOW, DNACK and OVERREAD respectively.

    Note that the ERRORSRCregister address is not the same for TWIS and TWIM, and that there are no documented SPI registers at the addresses for the TWIS and TWIM ERRORSRC registers.

    Regards, Terje

  • I have no idea why I wrote SPIM0 when I'm using TWIM0, complete carelessness on my part. It's TWIM I'm using, sorry. The rest of the post is right however, I'm getting 0x01 as the ERRORSRC for TWIM0, which isn't documented.

    I found the problem anyway, I'd missed out the LASTRX->STOP short on the peripheral in one case so it wasn't stopping when the TWIM had received MAXCOUNT bytes. In that case it seems you get an error with ERRORSRC of 0x01. That's sort of the TWIM version of overflow, because you didn't tell the slave to stop sending. My guess is that's a real error which just doesn't appear in the manual.

  • Yeah, that sounds reasonable. Just wanted to add that I am looking into this in order to confirm your observations and I will get back to you when I get a definite answer regarding this undocumented error.

Related