summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openocd/src/jtag/drivers/cmsis_dap_usb.c18
-rw-r--r--openocd/src/jtag/drivers/xds110.c17
-rw-r--r--openocd/src/target/startup.tcl9
-rw-r--r--openocd/tcl/target/ti_msp432.cfg5
4 files changed, 34 insertions, 15 deletions
diff --git a/openocd/src/jtag/drivers/cmsis_dap_usb.c b/openocd/src/jtag/drivers/cmsis_dap_usb.c
index dd37522..d1a9857 100644
--- a/openocd/src/jtag/drivers/cmsis_dap_usb.c
+++ b/openocd/src/jtag/drivers/cmsis_dap_usb.c
@@ -1003,11 +1003,25 @@ static void cmsis_dap_execute_reset(struct jtag_command *cmd)
1003 * there's no way to tristate them */ 1003 * there's no way to tristate them */
1004 uint8_t pins = 0; 1004 uint8_t pins = 0;
1005 1005
1006 if (!cmd->cmd.reset->srst) 1006 static bool first = true;
1007 pins |= SWJ_PIN_SRST; 1007
1008 if (!cmd->cmd.reset->trst) 1008 if (!cmd->cmd.reset->trst)
1009 pins |= SWJ_PIN_TRST; 1009 pins |= SWJ_PIN_TRST;
1010 1010
1011 if (!cmd->cmd.reset->srst)
1012 pins |= SWJ_PIN_SRST;
1013 else if (swd_mode) {
1014 /* Always assert nSRST in SWD mode */
1015 /* pin = 0 */
1016 } else if (first) {
1017 /* Assert nSRST in JTAG mode on first call */
1018 first = false;
1019 } else {
1020 /* Do not assert nSRST in JTAG mode on second call */
1021 pins |= SWJ_PIN_SRST;
1022 first = true;
1023 }
1024
1011 int retval = cmsis_dap_cmd_DAP_SWJ_Pins(pins, 1025 int retval = cmsis_dap_cmd_DAP_SWJ_Pins(pins,
1012 SWJ_PIN_TRST | SWJ_PIN_SRST, 0, NULL); 1026 SWJ_PIN_TRST | SWJ_PIN_SRST, 0, NULL);
1013 if (retval != ERROR_OK) 1027 if (retval != ERROR_OK)
diff --git a/openocd/src/jtag/drivers/xds110.c b/openocd/src/jtag/drivers/xds110.c
index 4a20f94..fe975a7 100644
--- a/openocd/src/jtag/drivers/xds110.c
+++ b/openocd/src/jtag/drivers/xds110.c
@@ -1594,6 +1594,8 @@ static void xds110_execute_reset(struct jtag_command *cmd)
1594 char trst; 1594 char trst;
1595 char srst; 1595 char srst;
1596 1596
1597 static bool first = true;
1598
1597 if (cmd->cmd.reset->trst != -1) { 1599 if (cmd->cmd.reset->trst != -1) {
1598 if (cmd->cmd.reset->trst == 0) { 1600 if (cmd->cmd.reset->trst == 0) {
1599 /* Deassert nTRST (active low) */ 1601 /* Deassert nTRST (active low) */
@@ -1610,8 +1612,19 @@ static void xds110_execute_reset(struct jtag_command *cmd)
1610 /* Deassert nSRST (active low) */ 1612 /* Deassert nSRST (active low) */
1611 srst = 1; 1613 srst = 1;
1612 } else { 1614 } else {
1613 /* Assert nSRST (active low) */ 1615 /* TODO: Workaround for double nSRST reset in JTAG mode */
1614 srst = 0; 1616 if (xds110.is_swd_mode) {
1617 /* Always assert nSRST in SWD mode (active low) */
1618 srst = 0;
1619 } else if (first) {
1620 /* Assert nSRST first time in JTAG mode (active low) */
1621 srst = 0;
1622 first = false;
1623 } else {
1624 /* Do not assert nSRST second time in JTAG mode (active low) */
1625 srst = 1;
1626 first = true;
1627 }
1615 } 1628 }
1616 (void)xds_set_srst(srst); 1629 (void)xds_set_srst(srst);
1617 1630
diff --git a/openocd/src/target/startup.tcl b/openocd/src/target/startup.tcl
index 6290b3a..247eff7 100644
--- a/openocd/src/target/startup.tcl
+++ b/openocd/src/target/startup.tcl
@@ -80,14 +80,7 @@ proc ocd_process_reset_inner { MODE } {
80 foreach t $targets { 80 foreach t $targets {
81 # C code needs to know if we expect to 'halt' 81 # C code needs to know if we expect to 'halt'
82 if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} { 82 if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} {
83 # TODO: Workaround for double nSRST pulse issue. The call to 83 $t arp_reset assert $halt
84 # init_reset above will assert and deassert nSRST. But the
85 # steps to examine and restore debug connection only happen just
86 # after that point. This arp_reset call will assert nSRST again
87 # but examination will not happen again. Also, some of the events
88 # that fire need the target scan chain to be examined.
89 # So comment out this second nSRST assert as a quick workaround.
90 # $t arp_reset assert $halt
91 } 84 }
92 } 85 }
93 foreach t $targets { 86 foreach t $targets {
diff --git a/openocd/tcl/target/ti_msp432.cfg b/openocd/tcl/target/ti_msp432.cfg
index 523371d..47ae8b7 100644
--- a/openocd/tcl/target/ti_msp432.cfg
+++ b/openocd/tcl/target/ti_msp432.cfg
@@ -46,6 +46,5 @@ $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE
46set _FLASHNAME $_CHIPNAME.flash 46set _FLASHNAME $_CHIPNAME.flash
47flash bank $_FLASHNAME msp432 0 0 0 0 $_TARGETNAME 47flash bank $_FLASHNAME msp432 0 0 0 0 $_TARGETNAME
48 48
49if { ![using_hla] } { 49reset_config srst_only
50 cortex_m reset_config sysresetreq 50adapter_nsrst_delay 100
51}