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

Interrupt not firing

Hello DevZone,

SDK 15.0.0 SD S140

Currently working without an active SoftDevice but even with an active SoftDevice these problems keep occurring. 

I'm currently working with a couple of SPI devices connected to my nRF52840.

I am using an app timer to create periodic moments to read out my SPI device.

I have allocated a GPIOTE and a PPI channel to the SPI->EVENTS_END to set it and in the SPI handler I clear the GPIOTE. 

In the image you can see the device working properly and communicating with 6 devices.

The top 6 signals are the chip selects, white is MISO, brown is MOSI, red is SCK and green is the GPIOTE pin.

If I zoom in to one packet you can clearly see that the GPIOTE pin is set and cleared.

A second later I need to communicate again with all six devices but for some reason my interrupt handler isn't called. 

The GPIOTE pin is set indicating that the event has happened but the interrupt handler isn't called.

By not calling the handler the SPI appears to be always busy since I clear the busy flag in the interrupt handler.

I have checked in the register group if something is changed or something but it isn't.

Everything seems to work but then again it doesn't.

If my code wasn't working I would not have had six successful transmissions and I cannot figure out what is going on.

Parents
  • Hello,

    I would expect the SPI interrupt to be pending based on the register readout shown in your last screenshot. Is it possible that the program may have ended up in another interrupt after the six successful transmissions that causes the SPI interrupt to become blocked, or have you verified that the program returns back to the main context?

  • No, the program continues normally after the first six transmissions. I can find nothing that would cause the system to hang or something. 

    The app timer's handler is called, I do my SPI communication, wait for it to be done using its interrupt and send a new packet. 

    But it keeps getting stuck in waiting for the transmission to be done all though I can see on my logic analyzer and in my breakpoint code that the data is transmitted but the interrupt handler is never called, thus never clearing the transmission done flag.

Reply
  • No, the program continues normally after the first six transmissions. I can find nothing that would cause the system to hang or something. 

    The app timer's handler is called, I do my SPI communication, wait for it to be done using its interrupt and send a new packet. 

    But it keeps getting stuck in waiting for the transmission to be done all though I can see on my logic analyzer and in my breakpoint code that the data is transmitted but the interrupt handler is never called, thus never clearing the transmission done flag.

Children
Related