openocd/src/helper
Angus Gratton 9fce8a21ca stlink_usb: Fix swallowed error on read/write operations, add retries on SWD WAIT, clean up error debug output.
- stlink_usb_get_rw_status() had a bug where FAULT or WAIT responses
  in read/write operations were ignored, leading to incomplete data.

- Added wrapper stlink_cmd_allow_retry to handle
  SWD_AP_WAIT/SWD_DP_WAIT statuses in most commands. These statuses
  appear if an SWD read or write received a WAIT ACK response from the
  target more than 4 times in a row. The driver retries the operation
  (with exponential backoff) before failing outright (in testing 1
  retry was always enough.)

- As part of the implementation of stlink_cmd_allow_retry a large
  number of lines of boilerplate were refactored.

- Fleshed out stlink_usb_error_check and added it to some more code
  paths so WAIT or FAULT responses are logged to debug. WAIT responses
  will be logged even if they are subsequently retried, which should
  help in case the retries have subtle side effects (none
  anticipated.)

Tested with two targets: STLINK F0 Discovery, Nordic NRF51822. Only
tested with STLINK V2 programmers.

Change-Id: I9af24e8f0121b035356dbb9978d6bbf4feb2e4d3
Signed-off-by: Angus Gratton <gus@projectgus.com>
Reviewed-on: http://openocd.zylin.com/2201
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-11 22:34:52 +00:00
..
bin2char.sh Fix some problems with the bin2char utility 2014-08-02 09:01:32 +00:00
binarybuffer.c binarybuffer: Remove unnecessary cast and fix hidden "bug" 2013-10-31 20:45:26 +00:00
binarybuffer.h binarybuffer: Remove unnecessary cast and fix hidden "bug" 2013-10-31 20:45:26 +00:00
command.c Update to the current Jim Tcl 2014-05-09 20:12:17 +00:00
command.h Update to the current Jim Tcl 2014-05-09 20:12:17 +00:00
configuration.c Remove unnecessary casts 2013-10-31 20:43:27 +00:00
configuration.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
fileio.c Clean up const usage to avoid excessive casting 2013-10-31 20:42:34 +00:00
fileio.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
ioutil_stubs.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
ioutil.c ioutil: Remove unnecessary casts and fix const-discarding 2013-10-31 20:45:34 +00:00
ioutil.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
jim-nvp.c build: cleanup src/helper directory 2012-02-06 10:49:52 +00:00
jim-nvp.h build: cleanup src/helper directory 2012-02-06 10:49:52 +00:00
list.h Add a bit-level transfer queue 2012-07-06 14:58:25 +00:00
log.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
log.h stlink_usb: Fix swallowed error on read/write operations, add retries on SWD WAIT, clean up error debug output. 2014-08-11 22:34:52 +00:00
Makefile.am Provide od+sed replacement for the bin2char helper 2014-08-02 09:00:28 +00:00
options.c Add %APPDATA%\OpenOCD to script search path on win 2013-12-22 20:24:26 +00:00
replacements.c Don't cast return value of [cm]alloc 2014-03-30 03:53:45 +00:00
replacements.h libusb1_common, ftdi: clarify libusb_open error message 2013-06-12 14:40:16 +00:00
startup.tcl Fix "Evaluate 'script' in the global scope" 2011-10-24 17:40:52 +00:00
system.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
time_support_common.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
time_support.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
time_support.h update files to correct FSF address 2013-06-05 19:52:42 +00:00
types.h swd: Improve parity calculation and move it to types.h 2014-06-28 09:27:19 +00:00
util.c update files to correct FSF address 2013-06-05 19:52:42 +00:00
util.h update files to correct FSF address 2013-06-05 19:52:42 +00:00