Hi,
I have ported my already working nRF52840 SPI slave code to a nRF5340, but it doesnt seem to receive any data. I have verified the CS, SCK and MOSI signals, but no MISO from nRF5340.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
.
.
static const struct spi_config spis_cfg = {
.operation = SPI_WORD_SET(8) | SPI_TRANSFER_MSB | SPI_OP_MODE_SLAVE | SPI_MODE_CPOL | SPI_MODE_CPHA,
.slave = 1,
};
.
.
static void spi_slave_init(void)
{
spis_dev = DEVICE_DT_GET(MY_SPI_SLAVE);
if (!device_is_ready(spis_dev)) {
printk("SPI slave device not ready!\n");
}
else
LOG_INF ("SPI slave ready");
}
.
.
static int spi_slave_check_for_message(void)
I get 'SPI slave ready' as a result of invoking spi_slave_init () function.
I can see the spis_handler () is invoked repeatedly, but 'spi_slave_check_for_message() == 0' seems to fail all the time.
I use nordic SDK 2.9.0.
I saw in the nRF5340 user guide that there is a hardware semaphore for accessing spi buffers, which was not available in nRF52840. Is there anything I need to implement in the application level to do that?
I have tried all I can think of and need some help urgently.
Thanks,
Kaushalya