Skip to content

RP2350: need cache flush in microcontroller.nvm #9783

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Nov 1, 2024

The lower-level flash-write code in supervisor/internal_flash.c does cache flushing when PSRAM is in use. Some of that code is duplicated in microcontroller.nvm, but it didn't have the cache flushing.

  • Make a simple API to wrap around low-level flash writes.
  • Call it from the nvm code, and use it in internal_flash.c.
  • Update to a safer cache-flushing scheme, as mentioned in Update RP2350 cache flushing #9770.

Also see:
https://forums.raspberrypi.com/viewtopic.php?t=378249

There may later be pico-sdk support for some of this:
raspberrypi/pico-sdk#1983
raspberrypi/pico-sdk#2005

Copy link

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense as a potential bug source.

@dhalbert dhalbert merged commit 24a8927 into adafruit:main Nov 2, 2024
137 checks passed
@dhalbert dhalbert deleted the rp2350-nvm-write-flush-cache branch November 2, 2024 17:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Writing to the NVM on the RP2350 crashes to Safe Mode, CP-9.2.0 Update RP2350 cache flushing
2 participants