I am encountering a problem with GPIOTE PORT events on the NRF51422 in a custom design. The chip occasionally seems to be able to get into a state in which the registers are set up correctly for a PORT event and interrupt to be generated, but despite this no event occurs.
I have a pin which is connected to a push switch and external pullup resistor, which normally triggers various visible actions on the system. The symptom of the problem is that the system stops responding to the button.
If I hold the switch down when the problem is occuring and then halt the CPU, I can see in the debugger that:
- PIN_CNF is set to input, connected, no pull, standard drive, sense low.
- The IN register for the pin shows the input level as low.
- The GPIOTE INTENSET register shows the PORT enable bit set.
- EVENTS_PORT is zero.
If I set a breakpoint at the GPIOTE interrupt, then:
-
With the system working normally, the breakpoint is hit when the button is pressed and shows the registers in the state above, except that EVENTS_PORT reads 1, indicating the event has occured.
-
When the problem is occuring, the breakpoint is not hit, and if I halt the CPU I see the registers in the same state as above with EVENTS_PORT reading zero.
I can reproduce this problem on two copies of the board.
What could be preventing this event from being generated?