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

SPIM transfer from RTC handler gets stuck

Hi,

I wrote a function setting some GPIO pins, initiating an SPIM transfer (with EasyDMA), then waiting for the SPIM handler to signal end of transfer, and then set some GPIO pins again.

This is working perfectly fine from the main thread. If I try to use it from the context of an RTC handler (RTC2, running at 8 Hz), however, it gets stuck. First I thought it's only the SPIM handler that won't be called, but actually it seems like the SPIM transfer does not even start as long as the program is in the RTC handler context.

Is that known behavior? What is the workaround? I am using SDK11.

Thanks, NewtoM

Update:

  • Incorporating SDK v11.0 -> v12.1 changes within nrf_drv_spi.c did not help.
  • Disabling EasyDMA did not help, either.
  • When disabling the SPI handler function, i.e., using nrf_drv_spi_init(&m_spi0, &SPI_config, NULL);, the code works again as expected (both with and without EasyDMA). But, then my SPI transfer blocks execution, which I don't want.

If I understand well, the latter case (no SPI handler) also means that the SPI driver will generate no interrupt at the end of the transfer. May that be the problem in my original case? I mean, starting code from an interrupt (RTC2) handler, in which another interrupt handler (SPI) tries to run ...

Any ideas?

Thanks!

Related