This is an automated email from Gerrit.

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

-- gerrit

commit b1023485c78b25d95cf402bdf64733bbb6de380f
Author: Bas Vermeulen <[email protected]>
Date:   Tue Nov 21 17:12:24 2017 +0100

    Only call cmsis_dap_cmd_DAP_SWD_Configure when swd_mode is enabled
    
    The CMSIS-DAP used by NXP's LS1012ARDB board only supports JTAG,
    and not SWD. Calling cmsis_dap_cmd_DAP_SWD_Configure returns with an
    error (and doesn't actually do anything in the debugger).
    
    Wrap the call to cmsis_dap_cmd_DAP_SWD_Configure in a check for
    swd_mode, to make sure initialisation doesn't fail needlessly.
    
    Change-Id: Id7e568cb6e36886bd7c5b3699d198a77a51c28c9
    Signed-off-by: Bas Vermeulen <[email protected]>

diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c
index 19c3b19..345c1fd 100644
--- a/src/jtag/drivers/cmsis_dap_usb.c
+++ b/src/jtag/drivers/cmsis_dap_usb.c
@@ -958,11 +958,14 @@ static int cmsis_dap_init(void)
        retval = cmsis_dap_cmd_DAP_TFER_Configure(0, 64, 0);
        if (retval != ERROR_OK)
                return ERROR_FAIL;
-       /* Data Phase (bit 2) must be set to 1 if sticky overrun
-        * detection is enabled */
-       retval = cmsis_dap_cmd_DAP_SWD_Configure(0);    /* 1 TRN, no Data Phase 
*/
-       if (retval != ERROR_OK)
-               return ERROR_FAIL;
+
+       if (swd_mode) {
+               /* Data Phase (bit 2) must be set to 1 if sticky overrun
+                * detection is enabled */
+               retval = cmsis_dap_cmd_DAP_SWD_Configure(0);    /* 1 TRN, no 
Data Phase */
+               if (retval != ERROR_OK)
+                       return ERROR_FAIL;
+       }
 
        retval = cmsis_dap_cmd_DAP_LED(0x03);           /* Both LEDs on */
        if (retval != ERROR_OK)

-- 

------------------------------------------------------------------------------
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