swd: handle various failure conditions

When communication with target fails for whatever reason, it makes
sense to do JTAG-to-SWD (in case the target got power-cycled or the
DAP method was reset anyhow), SWD line reset sequence (part of
JTAG-to-SWD already) and the mandatory IDCODE read. Schedule that to
be performed on the next poll.

Fix the return values for ftdi and jlink drivers to be consistent with
OpenOCD error codes and remove ad-hoc calls to perform DAP method
switching (as it's now done from the upper layer automatically).

Change-Id: Ie18797d4ce7ac43d8249f8f81f1064a2424e02be
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2371
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-by: Mateusz Manowiecki <segmentation@fault.pl>
This commit is contained in:
Paul Fertser
2014-11-02 15:16:13 +03:00
committed by Spencer Oliver
parent c120fb6d89
commit 9f6d4d1302
4 changed files with 51 additions and 40 deletions

View File

@@ -213,6 +213,12 @@ struct adiv5_dap {
* the AHB-AP has strange byte ordering these processors, and we need to
* swizzle appropriately. */
bool ti_be_32_quirks;
/**
* Signals that an attempt to reestablish communication afresh
* should be performed before the next access.
*/
bool do_reconnect;
};
/**