This is an automated email from Gerrit.

"Tarek BOCHKATI <tarek.bouchk...@gmail.com>" just uploaded a new patch set to 
Gerrit, which you can find at https://review.openocd.org/c/openocd/+/6994

-- gerrit

commit e810639b47095553b9d2805c96a6415d405db293
Author: Tarek BOCHKATI <tarek.bouchk...@gmail.com>
Date:   Tue May 24 11:32:51 2022 +0100

    stlink: manage TCP_BUSY status code when using RW MISC
    
    Change-Id: I4f9eed3781b549742565a3a8ac5245a4b94ceb53
    Signed-off-by: Tarek BOCHKATI <tarek.bouchk...@gmail.com>

diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c
index 2785d9b968..bb2c8174a5 100644
--- a/src/jtag/drivers/stlink_usb.c
+++ b/src/jtag/drivers/stlink_usb.c
@@ -504,6 +504,8 @@ static inline int stlink_usb_xfer_noerrcheck(void *handle, 
const uint8_t *buf, i
 #define STLINK_TCP_SS_CMD_NOT_AVAILABLE      0x00001053
 #define STLINK_TCP_SS_TCP_ERROR              0x00002001
 #define STLINK_TCP_SS_TCP_CANT_CONNECT       0x00002002
+#define STLINK_TCP_SS_TCP_CLOSE_ERROR        0x00002003
+#define STLINK_TCP_SS_TCP_BUSY               0x00002004
 #define STLINK_TCP_SS_WIN32_ERROR            0x00010000
 
 /*
@@ -971,6 +973,11 @@ static int stlink_tcp_send_cmd(void *handle, int 
send_size, int recv_size, bool
        if (check_tcp_status) {
                uint32_t tcp_ss = le_to_h_u32(h->tcp_backend_priv.recv_buf);
                if (tcp_ss != STLINK_TCP_SS_OK) {
+                       if (tcp_ss == STLINK_TCP_SS_TCP_BUSY) {
+                               LOG_DEBUG("TCP busy");
+                               return ERROR_WAIT;
+                       }
+
                        LOG_ERROR("TCP error status 0x%X", tcp_ss);
                        return ERROR_FAIL;
                }

-- 

Reply via email to