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

Why is event.rx_amount always 0 in spi_slave example?

Hello all

If you could please point me some directions on how to solve my issue, I would be grateful:

Some background info:

SDK used: 9.0

  • spi master code = example code, spi_master_with_spi_slave
  • spi slave code = example code, spi_slave
  • SPI Master board = PCA10028
  • SPI Slave board = custom board, NRF51822
  • Custom board HW is OK.

Description:

  1. PCA10028 is programmed as spi master, working properly.
  2. Custom board programmed as spi slave. When debugging, code enters SPI_SLAVE_XFER_DONE. When performing if (event.rx_amount == RX_BUF_SIZE) statement, program issues an error, as rx_amount is equal to 0 (always equal to zero...) and RX_BUF_SIZE is not zero.
  3. SPI slave pins have been changed to match used pins in custom board.

Doubt/problems:

Even if spi slave driver SPI_SLAVE_XFER_DONE occurs, no valid data is found in RX buffer. Also, rx_amount is not equal to the amount of data transferred by master.

Thanks for the time reading.

Regards

Parents Reply Children
No Data
Related