From d1ee827b4df710a0f693f6df7808cb5d75b2530c Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Wed, 28 Aug 2019 20:45:39 +0200 Subject: [PATCH] pc-stlinkv2: STLINK_SWD_DP_ERROR seem unrecoverable. Throw exception. --- src/platforms/pc-stlinkv2/stlinkv2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platforms/pc-stlinkv2/stlinkv2.c b/src/platforms/pc-stlinkv2/stlinkv2.c index 98e04f6..f7aeb4c 100644 --- a/src/platforms/pc-stlinkv2/stlinkv2.c +++ b/src/platforms/pc-stlinkv2/stlinkv2.c @@ -440,6 +440,7 @@ static int stlink_usb_error_check(uint8_t *data, bool verbose) case STLINK_SWD_DP_ERROR: if (verbose) DEBUG("STLINK_SWD_DP_ERROR\n"); + raise_exception(EXCEPTION_ERROR, "STLINK_SWD_DP_ERROR"); return STLINK_ERROR_FAIL; case STLINK_SWD_DP_PARITY_ERROR: if (verbose) @@ -487,7 +488,7 @@ static int send_recv_retry(uint8_t *txbuf, size_t txsize, gettimeofday(&now, NULL); timersub(&now, &start, &diff); if ((diff.tv_sec >= 1) || (res != STLINK_ERROR_WAIT)) { - DEBUG_STLINK("Failed: "); + DEBUG("write_retry failed"); return res; } } @@ -510,7 +511,7 @@ static int read_retry(uint8_t *txbuf, size_t txsize, gettimeofday(&now, NULL); timersub(&now, &start, &diff); if ((diff.tv_sec >= 1) || (res != STLINK_ERROR_WAIT)) { - DEBUG_STLINK("Failed: "); + DEBUG("read_retry failed"); return res; } } @@ -534,7 +535,6 @@ static int write_retry(uint8_t *cmdbuf, size_t cmdsize, gettimeofday(&now, NULL); timersub(&now, &start, &diff); if ((diff.tv_sec >= 1) || (res != STLINK_ERROR_WAIT)) { - DEBUG_STLINK("failed"); return res; } }