This is an automated email from Gerrit. Andrey Smirnov ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/2049
-- gerrit commit 92963cb3e61e877204868a23febb1f64412b7087 Author: Andrey Smirnov <[email protected]> Date: Sat Mar 15 10:05:57 2014 -0700 [RFC] Prevent reset handler from trampling over polling setting Not sure about the way I went about it, but I wanted to add a mechanism that would allow to prevent 'target_process_reset' from ignoring all of the polling setting that happened during reset and restore them to original value. Signed-off-by: Andrey Smirnov <[email protected]> Change-Id: I2faa84c7022c5115cadcf59fc7f982df140c383f diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c index a1ee372..da8d417 100644 --- a/src/flash/nor/kinetis.c +++ b/src/flash/nor/kinetis.c @@ -453,6 +453,7 @@ COMMAND_HANDLER(kinetis_check_flash_security_status) } if (val & MDM_STAT_SYSSEC) { + jtag_force_disable_poll(); jtag_poll_set_enabled(false); LOG_WARNING("*********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********"); diff --git a/src/jtag/core.c b/src/jtag/core.c index 24f6a51..33e246c 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -159,6 +159,17 @@ int jtag_error_clear(void) /************/ static bool jtag_poll = 1; +static bool jtag_force_no_poll = false; + +void jtag_force_disable_poll(void) +{ + jtag_force_no_poll = true; +} + +bool is_jtag_forcefully_disabled(void) +{ + return jtag_force_no_poll; +} bool is_jtag_poll_safe(void) { diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index eda4ccd..baf9e90 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -639,6 +639,8 @@ bool jtag_poll_get_enabled(void); */ void jtag_poll_set_enabled(bool value); +void jtag_force_disable_poll(void); +bool is_jtag_forcefully_disabled(void); /* The minidriver may have inline versions of some of the low * level APIs that are used in inner loops. */ diff --git a/src/target/target.c b/src/target/target.c index 1557c72..d874f2b 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -611,7 +611,8 @@ static int target_process_reset(struct command_context *cmd_ctx, enum target_res sprintf(buf, "ocd_process_reset %s", n->name); retval = Jim_Eval(cmd_ctx->interp, buf); - jtag_poll_set_enabled(save_poll); + if (!is_jtag_forcefully_disabled()) + jtag_poll_set_enabled(save_poll); if (retval != JIM_OK) { Jim_MakeErrorMessage(cmd_ctx->interp); -- ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
