Skip to content

fix bug on cmse::TestTarget::mpu_region #439

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

Merged
merged 1 commit into from
May 8, 2022

Conversation

luojia65
Copy link
Contributor

@luojia65 luojia65 commented May 6, 2022

This function should read mrvalid and mregion fields from test target result, instead of srvalid and sregion.

This function should read `mrvalid` and `mregion` fields from test target result, instead of `srvalid` and `sregion`.
@luojia65 luojia65 requested a review from a team as a code owner May 6, 2022 07:59
@thejpster
Copy link
Contributor

Can you point to the spec that says this is how it should be?

@luojia65
Copy link
Contributor Author

luojia65 commented May 8, 2022

@thejpster Thanks for noting! I found the official ARM documents here at: https://developer.arm.com/documentation/dui1095/a/The-Cortex-M23-Instruction-Set/Miscellaneous-instructions/TT--TTT--TTA--and-TTAT?lang=en

Bits Name Description
[7:0] MREGION The MPU region that the address maps to. This field is 0 if MRVALID is 0.
[15:8] SREGION The SAU region that the address maps to. This field is only valid if the instruction is executed from Secure state. This field is 0 if SRVALID is 0.
[16] MRVALID Set to 1 if the MREGION content is valid. Set to 0 if the MREGION content is invalid.
[17] SRVALID Set to 1 if the SREGION content is valid. Set to 0 if the SREGION content is invalid.

According to the documents, SREGION and SRVALID indicates the SAU region for this address; the MPU region is declared by MREGION and MRVALID.
 

@thejpster
Copy link
Contributor

Seems legit!

Copy link
Contributor

@thejpster thejpster left a comment

Choose a reason for hiding this comment

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

bors r+

@bors
Copy link
Contributor

bors bot commented May 8, 2022

@bors bors bot merged commit 4e90862 into rust-embedded:master May 8, 2022
@luojia65 luojia65 deleted the patch-1 branch May 8, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants