From 35e5de9b283f5e4c2fd425d3d00e5c080a8b1ef3 Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Tue, 14 Oct 2025 12:47:05 +0100 Subject: [PATCH] fix: Don't shift BASEPTR0 BASEPTR0's field only needs masking of its lower bits. --- pyocd/coresight/dap.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyocd/coresight/dap.py b/pyocd/coresight/dap.py index d69fed2ab..a6665c1a7 100644 --- a/pyocd/coresight/dap.py +++ b/pyocd/coresight/dap.py @@ -69,7 +69,6 @@ BASEPTR0_VALID_MASK = 0x00000001 BASEPTR0_PTR_MASK = 0xfffff000 -BASEPTR0_PTR_SHIFT = 12 ABORT_DAPABORT = 0x00000001 ABORT_STKCMPCLR = 0x00000002 @@ -498,7 +497,7 @@ def _check_version(self) -> None: baseptr0 = self.read_reg(DP_BASEPTR0) valid = (baseptr0 & BASEPTR0_VALID_MASK) != 0 if valid: - base = (baseptr0 & BASEPTR0_PTR_MASK) >> BASEPTR0_PTR_SHIFT + base = baseptr0 & BASEPTR0_PTR_MASK if self._addr_size > 32: baseptr1 = self.read_reg(DP_BASEPTR1) base |= baseptr1 << 32