SPI slave always returns -ETIMEDOUT

Hi,

I am working on SPI master-slave application, as in, on one BL653 I am running SPI master driver, I am able to observe the waveforms for clock and data transfer from master on USB logic analyzer.

But I am facing an issue with the BL653 board which is running SPI slave code, basically, for slave under main my code is as below:

	m_spi_cfg->operation |= SPI_WORD_SET(8);

	m_rx_bufs->buf = &data;
	m_rx_bufs->len = sizeof(data);

	m_rx_set_buff->buffers = m_rx_bufs;
	m_rx_set_buff->count = 1;

	if ((m_spi_dev) != nullptr)
	{
		l_nStatus = spi_read(m_spi_dev, m_spi_cfg, m_rx_set_buff);
		printk("Received data : %u : %d\n",data,l_nStatus);
		if (l_nStatus != SUCCESS)
		{
			return ERR;
		}
	}

Here spi_read always returns -116, that is  -ETIMEDOUT.

My device binding, spi slave configurations and wiring with spi master are in order.

But I do not understand why slave driver always returns -ETIMEDOUT.

I traced the flow of execution all the way to the source of the error and here is what I found

spi_read( ) -> transceive (in file "spi_nrfx_spis.c") -> spi_context_wait_for_completion( in file "spi_context.h") -> and the source of error is as attached in the below snap in #else part 

Without debug mode as well I am getting the same -ETIMEDOUT.

Kindly suggest on if I have missed out on configuring something.


Thanks,

Ubaid

Related