Skip to content

NomiChirps/missed_interrupt

Repository files navigation

missed_interrupt

See https://forums.raspberrypi.com/viewtopic.php?t=338900 for context and discussion.

This is a cleaned-up reproduction of the issue:

  • start two DMA channels simultaneously
  • receive both of their interrupt flags in the same call to the handler
  • attempting to use hw_set_bits or hw_clear_bits to clear INTS1 incorrectly clears both flags

scope trace

Events from top to bottom and left to right:

  1. Channel 4 (blue) toggled in the main loop just before starting the transfer.
  2. Channel 3 (cyan) toggled in the interrupt handler about 1us later, after the busy-wait, indicating that DMA channel 1's interrupt bit is set.
  3. Channel 2 (pink) toggled in the same interrupt handler, indicating that DMA channel 2's interrupt bit is also set.
  4. Channel 1 (yellow) goes high, indicating that some bit in INTS is set.
  5. Interrupt handler calls hw_set_bits(INTS, 0)
  6. Channel 1 goes low, showing that INTS is now 0.

Precisely the same behavior occurs with hw_clear_bits and hw_xor_bits.

About

reproduction of my weird problem on Pi Pico

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published