-
Notifications
You must be signed in to change notification settings - Fork 2
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
Exclusive Access to PSRAM on RP2350 #398
Comments
Here's the chat history on matrix where we discuss this. |
You are correct, PSRAM does not support exclusive transactions. |
I asked about this internally, and was pointed at section 2.1.6.2. of https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf which says:
and
and
|
Thank you for the quick response. Are we correct that the failure mode is an infinite loop rather than an exception? I haven't got PARAM working so I can't test. |
Our assumption that this will endlessly loop comes from the LLVM implmentation of various "compare and swap" primitives:
If this does not cause some kind of fault, it's likely users of |
But answering @thejpster's question from datasheet section 2.1.6.2:
So I think the answer is pretty clearly "yes, expect endless loops". |
Based on our reading of the RP2350 datasheet, we believe that any Exclusive Load/Stores to the PSRAM region will always fail (thus any code with an Exclusive Load/Store loop, e.g. to do a CAS operation, will either loop indefinitely or raise a fault).
Is our understanding correct? If so, creating a Rust
AtomicU32
value (or similar) in PSRAM is going to end badly and we need to try and stop people doing that. Perhasps the same applies to a C11 _Atomic value.The text was updated successfully, but these errors were encountered: