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?

Parents
  • HI Damon, 

    the nRF52840 should not alter the pin configuration when entering Debug mode. 

    Which pins to you have connected to the 9DOF sensor?

    Does the code beside the event handler run properly in Debug mode, i.e. you're not asserting or ending up in an error handler ?

    Have you verified that the output pin of the 9DOF sensor is toggeling when you're debugging the custom board?

    Best regards

    Bjørn 

Reply
  • HI Damon, 

    the nRF52840 should not alter the pin configuration when entering Debug mode. 

    Which pins to you have connected to the 9DOF sensor?

    Does the code beside the event handler run properly in Debug mode, i.e. you're not asserting or ending up in an error handler ?

    Have you verified that the output pin of the 9DOF sensor is toggeling when you're debugging the custom board?

    Best regards

    Bjørn 

Children
Related