diff options
author | 2022-05-06 15:57:35 +0800 | |
---|---|---|
committer | 2022-05-06 15:57:35 +0800 | |
commit | 3c67b4ced9b10546c92e36a935c2e27e0df3281b (patch) | |
tree | f0110393bf8322291cc8e4926c77e63e7ab1c6ac /src | |
parent | d5d50a05faff5d1d0177dcdbd2798f1abc3e57f6 (diff) | |
download | cortex-m-3c67b4ced9b10546c92e36a935c2e27e0df3281b.tar.gz cortex-m-3c67b4ced9b10546c92e36a935c2e27e0df3281b.tar.zst cortex-m-3c67b4ced9b10546c92e36a935c2e27e0df3281b.zip |
fix bug on cmse::TestTarget::mpu_region
This function should read `mrvalid` and `mregion` fields from test target result, instead of `srvalid` and `sregion`.
Diffstat (limited to 'src')
-rw-r--r-- | src/cmse.rs | 6 |
1 files 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<u8> { - 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 } |