-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raspberrypi: Don't block DMA_IRQ_1 during common_hal_mcu_disable_interrupts #10049
base: main
Are you sure you want to change the base?
Conversation
I tested this artifact on a Solderparty rp2350 stamp xl and it did eliminate the screen going black during writes to flash. |
Updated, hopefully it's green now. |
welp 🤣 |
I put back the old code for2040s with Cortex M0, and without BASEPRI. At this point, if it doesn't interfere with review, I'd prefer to rebase it so that the git blame of the file isn't deceptive, showing that the rp2040 implementation of the routine was invented in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Go ahead and rebase.
…rrupts doing so causes the picodvi display on rp2350 to blank, because this irq is handed by cpu0. Instead, use the BASEPRI register so that common_hal_mcu_disable_interrupts masks interrupts with lower priority (higher priority values) than PICO_ELEVATED_IRQ_PRIORITY. This has the effect of masking "regular" interrupts while still letting this priority interrupt occur. port_idle_until_interrupt now needs to directly manipulate the interrupt enable state, because an interrupt masked via BASEPRI also does not cause the WFI instruction to complete. Since I don't know that `nesting_count==0` is a precondition of `port_idle_until_interrupt`, also set and restore BASEPRI before WFI. Because RP2040 is Cortex M0+ lacking BASEPRI, the old implementation is used there.
a0e3918
to
f331a85
Compare
rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
doing so causes the picodvi display on rp2350 to blank, because this irq is handed by cpu0.
Instead, use the BASEPRI register so that common_hal_mcu_disable_interrupts masks interrupts with lower priority (higher priority values) than PICO_ELEVATED_IRQ_PRIORITY. This has the effect of masking "regular" interrupts while still letting this priority interrupt occur.
port_idle_until_interrupt now needs to directly manipulate the interrupt enable state, because an interrupt masked via BASEPRI also does not cause the WFI instruction to complete. Since I don't know that
nesting_count==0
is a precondition ofport_idle_until_interrupt
, also set and restore BASEPRI before WFI.Testing performed: display on metro rp2350 doesn't blank while writing to flash. neopixel status LED still works, though that's not a comprehensive test that DMA is still working properly.
Closes #10031