NCS/Zephyr SPIM: issue triggering spi_transceive from counter ISR

Hi,

I am using nRF5340 DK + NCS v2.0.0 with nrfx backend for SPIM.

For my application I want to trigger a SPIM1 transaction at a fixed interval. To do this, I set up an interrupt on TIMER1 that calls spi_transceive. However, spi_transceive is returning error -116 (ETIMEDOUT) when called from the ISR.

I've attached an example project that I think demonstrates the issue, could you please let me know if this is a bug or if I'm doing something wrong?

/cfs-file/__key/communityserver-discussions-components-files/4/counter_5F00_spim.zip

The debug logs show the following

*** Booting Zephyr OS build v3.0.99-ncs1  ***
[00:00:00.259,948] <inf> counter_spim: boot
[00:00:01.256,683] <err> spi_nrfx_spim: Timeout waiting for transfer complete
[00:00:01.256,713] <err> counter_spim: error: -116
[00:00:02.253,509] <err> spi_nrfx_spim: Timeout waiting for transfer complete
[00:00:02.253,509] <err> counter_spim: error: -116
[00:00:03.250,305] <err> spi_nrfx_spim: Timeout waiting for transfer complete
[00:00:03.250,305] <err> counter_spim: error: -116
[00:00:04.247,161] <err> spi_nrfx_spim: Timeout waiting for transfer complete
[00:00:04.247,161] <err> counter_spim: error: -116
[00:00:05.243,957] <err> spi_nrfx_spim: Timeout waiting for transfer complete
[00:00:05.243,988] <err> counter_spim: error: -116
[00:00:06.241,058] <err> spi_nrfx_spim: Timeout waiting for transfer complete
[00:00:06.241,058] <err> counter_spim: error: -116

...

Related