This is an automated email from Gerrit.

Antonio Borneo ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/4571

-- gerrit

commit 5a70288758ea298c0fb186dfd9cd4e2d2f29a259
Author: Antonio Borneo <[email protected]>
Date:   Sat Jun 23 15:12:46 2018 +0200

    jtag/drivers/cmsis-dap: fix connect in cmsis_dap_swd_switch_seq()
    
    The proc cmsis_dap_swd_switch_seq() is part of the SWD API for
    this interface driver. It is valid only when the interface is
    used in SWD mode.
    In this proc there is the need to call, in sequence, first
    cmsis_dap_cmd_DAP_Disconnect() then cmsis_dap_cmd_DAP_Connect().
    The latter call requires the connection mode as parameter, that
    inside cmsis_dap_swd_switch_seq() can only be CONNECT_SWD.
    
    The current implementation is not correct and in some cases can
    pass mode CONNECT_JTAG. Moreover, JTAG is optional in CMSIS-DAP
    and passing mode CONNECT_JTAG triggers an error with SWD-only
    interfaces.
    
    Use mode CONNECT_SWD in SWD specific cmsis_dap_swd_switch_seq().
    
    Change-Id: Ib455bf5b69cb2a2d146a6c8875387b00c27a5690
    Signed-off-by: Antonio Borneo <[email protected]>

diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c
index b8181d6..6b010c1 100644
--- a/src/jtag/drivers/cmsis_dap_usb.c
+++ b/src/jtag/drivers/cmsis_dap_usb.c
@@ -802,8 +802,7 @@ static int cmsis_dap_swd_switch_seq(enum swd_special_seq 
seq)
 
                /* When we are reconnecting, DAP_Connect needs to be rerun, at
                 * least on Keil ULINK-ME */
-               retval = cmsis_dap_cmd_DAP_Connect(seq == LINE_RESET || seq == 
JTAG_TO_SWD ?
-                                          CONNECT_SWD : CONNECT_JTAG);
+               retval = cmsis_dap_cmd_DAP_Connect(CONNECT_SWD);
                if (retval != ERROR_OK)
                        return retval;
        }

-- 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to