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

spi slave status

I am using the SPI Slave port in the nRF51822 and am always transferring 20 bytes. No matter what I do, it seems that the status register in the IRQ says that I got a TX buffer over-read and a RX buffer overflow errors (0x3). During every IRQ I write 3 to the status register, which clears the register, but the next IRQ has the same error in the register. I'm using another nRF51822 as a SPI master to send the data and I'm pretty certain I'm only sending and receiving 20 bytes per packet. Searching the questions database doesn't indicate there is a problem with the hardware. Anyone have any ideas where to go to resolve this problem. I am getting strange SPI data occasionally (millions of successful operations), which is crashing my program (by choice as a checksum fails). I haven't determined where the error occurs, but I'm trying to resolve as many issues in this transmission path as possible and the STATUS register is haunting me.

  • Hi Daniel

    If you are using the spi_slave_example in the SDK, the buffer size of both RX and TX buffers is 16 bytes. So if you transfer 20 bytes from master to slave, then you will get an overread status. Can this be the problem?

    Update 13.1.2014 What is the buffer size in your case? What happens if you increase the buffer size to something larger than 20 bytes? According to the nRF51 Ref manual v3.0, the reason for the overread error is that the SPI master clocks out more data than the buffer size of the SPI slave, i.e. MAXTX. The buffer is adjusted my modifying the value of the TX_BUF_SIZE constant in the spi_slave example in the SDK.

Related