raspberrypi: Don't block DMA_IRQ_1 during common_hal_mcu_disable_interrupts#10049
Merged
jepler merged 1 commit intoadafruit:mainfrom Feb 12, 2025
Merged
raspberrypi: Don't block DMA_IRQ_1 during common_hal_mcu_disable_interrupts#10049jepler merged 1 commit intoadafruit:mainfrom
jepler merged 1 commit intoadafruit:mainfrom
Conversation
|
I tested this artifact on a Solderparty rp2350 stamp xl and it did eliminate the screen going black during writes to flash. |
tannewt
requested changes
Feb 11, 2025
Author
|
Updated, hopefully it's green now. |
Author
|
welp 🤣 |
Author
|
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. |
tannewt
reviewed
Feb 12, 2025
Member
tannewt
left a comment
There was a problem hiding this comment.
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
Author
|
rebased. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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==0is 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