Hello,
I encountered an interesting issue with SPI0 on the nrf52840 that I cannot explain. In short, my SPI bus would stop working shortly after communicating with my slave device. After an extensive investigation and trying different pins to use for SPI, I discovered that the slave device was holding the SPI clock line low. This was causing the Nordic SPI driver to hang in nrfx_spim.c at the line highlighted in green below. I could disconnect the SPI clock line from the slave device and the driver would resume operation without issues. Why does contention on the SPI clock line cause the driver to hang? Should there be some sort of safety timeout here? I was able to reproduce this issue using the Nordic SPI peripheral example project. As a side note, I have since discovered why the slave device was holding the clock line low but not why the driver gets stuck.
SoftDevice: S140
SDK: 15.0.0
Note: I am using the Rigado BMD-340 Eval Kit which is software and pin compatible with the nrf52840 DK.
Thanks,
Derek