Skip to content

Commit 35e5de9

Browse files
committed
fix: Don't shift BASEPTR0
BASEPTR0's field only needs masking of its lower bits.
1 parent cc1ae68 commit 35e5de9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pyocd/coresight/dap.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969

7070
BASEPTR0_VALID_MASK = 0x00000001
7171
BASEPTR0_PTR_MASK = 0xfffff000
72-
BASEPTR0_PTR_SHIFT = 12
7372

7473
ABORT_DAPABORT = 0x00000001
7574
ABORT_STKCMPCLR = 0x00000002
@@ -498,7 +497,7 @@ def _check_version(self) -> None:
498497
baseptr0 = self.read_reg(DP_BASEPTR0)
499498
valid = (baseptr0 & BASEPTR0_VALID_MASK) != 0
500499
if valid:
501-
base = (baseptr0 & BASEPTR0_PTR_MASK) >> BASEPTR0_PTR_SHIFT
500+
base = baseptr0 & BASEPTR0_PTR_MASK
502501
if self._addr_size > 32:
503502
baseptr1 = self.read_reg(DP_BASEPTR1)
504503
base |= baseptr1 << 32

0 commit comments

Comments
 (0)