-
Notifications
You must be signed in to change notification settings - Fork 7.4k
soc: arm: stm32h7x mapping system memory region #60765
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
Conversation
c32429b
to
dec3d41
Compare
931f0bf
to
a4dfac0
Compare
rebased on 8505986 |
MPU_REGION_ENTRY("SYSTEM", 0x1FF00000, | ||
{ (STRONGLY_ORDERED_SHAREABLE | | ||
REGION_512K | | ||
FULL_ACCESS_Msk) }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't MPU_RASR_XN_Msk | P_RW_U_NA_Msk
instead of FULL_ACCESS_Msk
be more appropriate? Then it would be the same as REGION_RAM_ATTR
above. But generally STRONGLY_ORDERED_SHAREABLE
solves all issues in our application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this also removes the RDSERR (even if do not really catch the difference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that with MPU_RASR_XN_Msk
we avoid to execute code from this region and with P_RW_U_NA_Msk
we avoid that a user mode thread can access it. Both should not happen in my point of view and the configuration should therefore be a bit more secure.
System memory declared by the MPU as 'Strongly Ordered' with region attributes which will inhibit the speculative fetch, preventing the Flash RDSERR. Signed-off-by: Francois Ramu <[email protected]>
Changing attributes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the proposed changes solves issue #60449 in the provided sample application as well as in our productive application.
Is there something blocking the PR from being merged? |
System memory declared by the MPU as 'Execute-Never' will inhibit the speculative fetch, preventing the RDSERR.
This is explained by the https://community.st.com/t5/stm32-mcu-products/spurious-rdperr-and-rdserr-when-all-protection-and-security/td-p/279852
Fixes #60449