Hello everyone,
I'm facing difficulties trying to make SPI List work on the nRF52840.
I'm using SPI1, clocked at 1M. START task is triggered via a GPIOTE event with PPI. I'm trying to read 9 bytes per transaction, using RX post increment flag. The TX buffer is located at 0x2000D1B4 and my RX buffer is initially set to 0x2000C5D0. Chip Select stays low during the multiple transactions (it's not affecting the sensor behavior, I can read data continuously when I don't use SPI List).
Setting a breakpoint in the SPI event handler, I can see that I read 9 bytes after the first GPIO interrupt, but then RXD.PTR is increased with a "random" number. See a screenshot of the memory corresponding to the SPI1 registers. Here RXD.PTR is set to 2000C8A0 after my first read. That address is not the same when I run the firmware multiple times... but interestingly enough, it's always a multiple of 9. The GPIOTE interrupt handler is called only once each time though.
Also, even if the address is still in my buffer, it doesn't seem to put any data at that location after the second read.
Here is the call to the SPI transfer:
nrfx_spim_xfer_desc_t xfer_desc = {.p_tx_buffer = &m_tx_buf[0],
.tx_length = 2,
.p_rx_buffer = data,
.rx_length = 9};
APP_ERROR_CHECK(nrfx_spim_xfer(&m_spi_master, &xfer_desc, NRFX_SPIM_FLAG_HOLD_XFER | NRFX_SPIM_FLAG_RX_POSTINC));
Above, RXD.PTR is hilighted.
I hope I provided enough information about the issue, let me know if you have any clue...
Best,