aboutsummaryrefslogtreecommitdiff
path: root/src/target/cortex_m.c
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2012-05-11 09:39:58 +0100
committerSpencer Oliver <spen@spen-soft.co.uk>2012-05-14 09:38:59 +0000
commitec5e4bae251e01d2b7681e370a6c5e82a81e5962 (patch)
treee1afef97b527c1807e4bc53ed4b0194527f28a96 /src/target/cortex_m.c
parentf9ea791e9b89bed91200f27202f9a95dd4e8640b (diff)
stlink: add armv7m stlink handling
This enables us to better handle some of the low level functions that the stlink does not support. It also enables us to share a few more of the standard cortex_m3 functions if necessary. Change-Id: I7a2c57450122012ec189245d8879d8967913e00e Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/637 Tested-by: jenkins
Diffstat (limited to 'src/target/cortex_m.c')
-rw-r--r--src/target/cortex_m.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index f992bde4..acf28050 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -1780,9 +1780,13 @@ int cortex_m3_examine(struct target *target)
struct adiv5_dap *swjdp = &cortex_m3->armv7m.dap;
struct armv7m_common *armv7m = target_to_armv7m(target);
- retval = ahbap_debugport_init(swjdp);
- if (retval != ERROR_OK)
- return retval;
+ /* stlink shares the examine handler but does not support
+ * all its calls */
+ if (!armv7m->stlink) {
+ retval = ahbap_debugport_init(swjdp);
+ if (retval != ERROR_OK)
+ return retval;
+ }
if (!target_was_examined(target)) {
target_set_examined(target);