diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2019-02-03 21:07:31 +0100 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2019-03-07 21:00:41 +0000 |
commit | 5c55fbb065a829beafa233e5c0c0be56d9664934 (patch) | |
tree | 9b50bbb8620bb18b49084c770fadbd76ac90f1e6 /src/jtag | |
parent | e243075962fc11f0b217db72d68819355c1be7dc (diff) | |
download | riscv-openocd-5c55fbb065a829beafa233e5c0c0be56d9664934.zip riscv-openocd-5c55fbb065a829beafa233e5c0c0be56d9664934.tar.gz riscv-openocd-5c55fbb065a829beafa233e5c0c0be56d9664934.tar.bz2 |
stlink: handle error bad-AP
The new firmwares for ST-Link support handling multiple AP, but
are (actually) limited to the AP number in range [0..8].
Any tentative to operate on AP number higher than 8 returns an
error "bad AP".
Add the error code and the related message.
Change-Id: I78a98b2612d10e580d03fc43ed9f2b09619d39d8
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4981
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
Diffstat (limited to 'src/jtag')
-rw-r--r-- | src/jtag/drivers/stlink_usb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index a9ee44d..134cb2f 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -167,6 +167,8 @@ struct stlink_usb_handle_s { #define STLINK_SWD_AP_STICKY_ERROR 0x19 #define STLINK_SWD_AP_STICKYORUN_ERROR 0x1a +#define STLINK_BAD_AP_ERROR 0x1d + #define STLINK_CORE_RUNNING 0x80 #define STLINK_CORE_HALTED 0x81 #define STLINK_CORE_STAT_UNKNOWN -1 @@ -751,6 +753,9 @@ static int stlink_usb_error_check(void *handle) case STLINK_SWD_AP_STICKYORUN_ERROR: LOG_DEBUG("STLINK_SWD_AP_STICKYORUN_ERROR"); return ERROR_FAIL; + case STLINK_BAD_AP_ERROR: + LOG_DEBUG("STLINK_BAD_AP_ERROR"); + return ERROR_FAIL; default: LOG_DEBUG("unknown/unexpected STLINK status code 0x%x", h->databuf[0]); return ERROR_FAIL; |