This is an automated email from Gerrit. Spencer Oliver ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/637
-- gerrit commit c5c86a1bb739bf1015f89fc129db423ab4f8dab9 Author: Spencer Oliver <[email protected]> Date: Fri May 11 09:39:58 2012 +0100 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 <[email protected]> diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 9a98f61..fd3a92c 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -1096,14 +1096,6 @@ int ahbap_debugport_init(struct adiv5_dap *dap) LOG_DEBUG(" "); - /* test for initialized low level jtag hardware - * this always fails for stlink hardware - */ - if (!dap->jtag_info) { - LOG_DEBUG("No low level jtag hardware found"); - return ERROR_OK; - } - /* JTAG-DP or SWJ-DP, in JTAG mode * ... for SWD mode this is patched as part * of link switchover diff --git a/src/target/armv7m.h b/src/target/armv7m.h index 6002b57..bcf0ee1 100644 --- a/src/target/armv7m.h +++ b/src/target/armv7m.h @@ -171,9 +171,11 @@ struct armv7m_common { struct adiv5_dap dap; int fp_feature; - uint32_t demcr; + /* stlink is a high level adapter, does not support all functions */ + bool stlink; + /* Direct processor core register read and writes */ int (*load_core_reg_u32)(struct target *target, enum armv7m_regtype type, uint32_t num, uint32_t *value); diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 09a51b7..69fbfcd 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1769,9 +1769,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); diff --git a/src/target/stm32_stlink.c b/src/target/stm32_stlink.c index f9daa01..60a8993 100644 --- a/src/target/stm32_stlink.c +++ b/src/target/stm32_stlink.c @@ -278,6 +278,7 @@ static int stm32_stlink_init_arch_info(struct target *target, armv7m->store_core_reg_u32 = stm32_stlink_store_core_reg_u32; armv7m->examine_debug_reason = stm32_stlink_examine_debug_reason; + armv7m->stlink = true; return ERROR_OK; } -- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
