From 3c67b4ced9b10546c92e36a935c2e27e0df3281b Mon Sep 17 00:00:00 2001 From: Luo Jia Date: Fri, 6 May 2022 15:57:35 +0800 Subject: fix bug on cmse::TestTarget::mpu_region This function should read `mrvalid` and `mregion` fields from test target result, instead of `srvalid` and `sregion`. --- src/cmse.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmse.rs b/src/cmse.rs index 36d7447..7826bb8 100644 --- a/src/cmse.rs +++ b/src/cmse.rs @@ -174,9 +174,9 @@ impl TestTarget { /// * the TT instruction was executed from an unprivileged mode and the A flag was not specified. #[inline] pub fn mpu_region(self) -> Option { - if self.tt_resp.srvalid() { - // Cast is safe as SREGION field is defined on 8 bits. - Some(self.tt_resp.sregion() as u8) + if self.tt_resp.mrvalid() { + // Cast is safe as MREGION field is defined on 8 bits. + Some(self.tt_resp.mregion() as u8) } else { None } -- cgit v1.2.3