Repository navigation
Fix RP2350 boards with PSRAM crashing after raising the CPU speed - #11516
Merged
Merged
Conversation
mcu_processor_update_psram_timing() kept CLKDIV at 2 and RXDELAY at 1 at every system clock. After microcontroller.cpu.frequency was raised, PSRAM reads came back wrong: a 4 MB bytearray raised MemoryError at 200 MHz and hard faulted from 216 MHz up, rebooting into safe mode. Pick CLKDIV so PSRAM SCK stays at or below 133 MHz and RXDELAY to match, the same rule arduino-pico uses for the APS6404. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… rp2350-psram-clkdiv
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.
What
PSRAM clock divider and read delay now follow the CPU speed.
Why
Setting
microcontroller.cpu.frequencyabove 150 MHz corrupted PSRAM reads, then crashed into safe mode.Uses the arduino-pico rule: SCK at or under 133 MHz, read delay matched to the divider. Follows up #11250.
Hardware tested
Fruit Jam (8 MB PSRAM)
How I tested it
Cold boot, set the clock, then write and verify 4 MB of PSRAM:
MemoryErrorAI assistance
Claude Code helped find, fix and test this on my Fruit Jam.