summaryrefslogtreecommitdiff
path: root/src/target/armv7m.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2010-01-04 22:11:34 -0800
committerDavid Brownell <dbrownell@users.sourceforge.net>2010-01-04 22:11:34 -0800
commit1b3f15d51ee3388e18edb06201f5c6c8b75c3361 (patch)
tree870bc4a548c71b8d555b79d31613bface567c98a /src/target/armv7m.c
parent237a707f9653d7ca8a1ec550b497e9a8d0ce0311 (diff)
downloadopenocd+libswd-1b3f15d51ee3388e18edb06201f5c6c8b75c3361.tar.gz
openocd+libswd-1b3f15d51ee3388e18edb06201f5c6c8b75c3361.tar.bz2
openocd+libswd-1b3f15d51ee3388e18edb06201f5c6c8b75c3361.tar.xz
openocd+libswd-1b3f15d51ee3388e18edb06201f5c6c8b75c3361.zip
ARMv7-M: use AP_REG_* symbol
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src/target/armv7m.c')
-rw-r--r--src/target/armv7m.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index d0f58dee..9d8132d4 100644
--- a/src/target/armv7m.c
+++ b/src/target/armv7m.c
@@ -731,7 +731,12 @@ COMMAND_HANDLER(handle_dap_baseaddr_command)
if (apselsave != apsel)
dap_ap_select(swjdp, apsel);
- dap_ap_read_reg_u32(swjdp, 0xF8, &baseaddr);
+ /* NOTE: assumes we're talking to a MEM-AP, which
+ * has a base address. There are other kinds of AP,
+ * though they're not common for now. This should
+ * use the ID register to verify it's a MEM-AP.
+ */
+ dap_ap_read_reg_u32(swjdp, AP_REG_BASE, &baseaddr);
retval = swjdp_transaction_endcheck(swjdp);
command_print(CMD_CTX, "0x%8.8" PRIx32 "", baseaddr);