Refactor PSRAM clock frequency handling#19224
Conversation
Read clock speed before entering direct mode (flash access is unavailable while QMI direct mode is enabled) Signed-off-by: phuzzyday <phuzzyd@yahoo.ca>
|
Code size report: |
Removed blank space Signed-off-by: phuzzyday <phuzzyd@yahoo.ca>
Signed-off-by: phuzzyday <phuzzyd@yahoo.ca>
If with failed checks you mean the CI errors, then those are related to your changes. Given what you committed I reckon you probably didn't read Just in case, please read that document. There's all the necessary information to not cause the two CI errors you see here. Also, since the commits have to be altered, please squash those three commits into just one atomic change. You're just making minor modifications to your main change, after all. |
|
Support for PSRAM on RP2 should be moved upstream to rely on the Pico SDK functions when possible- #19209 As such it would be prudent to make sure these issues don't also exist in the Pico SDK implementation, or we'll get a regression sometime in the future- raspberrypi/pico-sdk#2919 |
Upstream support isn't affected by this, as the timing calculation is already separated from the direct mode use |
Read clock speed before entering direct mode (flash access is unavailable while QMI direct mode is enabled)
Summary
Fix PSRAM init crash when system clock differs from default
Move clock_get_hz() call before QMI direct mode is enabled.
Flash access is unavailable during direct mode, causing a bus fault
on the instruction fetch when clock_configure_undivided is not
in the XIP cache. Confirmed via debugprobe on WeAct RP2350A.
NOTE - Failed Checks are happening in areas of the code far away from what I changed.
Tested on multiple RP2350 boards. (Weact.)
Generative AI
I used generative AI tools when creating this PR, but a human has checked the
code and is responsible for the code and the description above. (earlphilhower)