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

Pin change interrupt not working in Debug mode.

I have a custom nRF52840 board, very similar in basic design to the nRF52840 Dongle, but with a 9DOF sensor. The sensor asserts an output pin when data is ready. This output is connected to a port pin on the nRF52840. The code sets up a pin change interrupt on this signal.

The code uses SDK 15.3.0, with no changes in the pin change interrupt functions etc...

When running "stand-alone" i.e. debugger cable disconnected, the code works exactly as expected -- the event handler is called etc...

However, when running the exact same code using the debugger (through the Debug Out port of a nRF52840 DK), the event handler is never called.

For example:

  1. start the code in "stand-alone" mode -- the code works correctly
  2. plug the 10-pin cable into the Debug Out port on the DK -- the code keeps working correctly
  3. From within SES, go Target->Connect J-Link -- the code keeps working correctly
  4. From within SES, go Target->Attach Debugger -- the code keeps working correctly
  5. In debugging mode, pause and continue execution -- the code keeps working correctly
  6. Restart the code, then run -- the event handler is never called.

Similarly:

  1. If I download the code directly and then run (Debug->Go), the event handler is never called.

Does the nRF52840 in debug mode alter the way pin change interrupts are handled?

What is going on here?

Related