]> git.sur5r.net Git - openocd/commitdiff
drivers: cmsis-dap: Print version info when available
authorKarl Palsson <karlp@tweak.net.au>
Wed, 13 Apr 2016 23:44:14 +0000 (23:44 +0000)
committerTomas Vanek <vanekt@fbl.cz>
Wed, 18 Jul 2018 20:08:20 +0000 (21:08 +0100)
No need to wait until after connecting, might help diagnose part information by
printing earlier.

Change-Id: I51eb0d584be306baa811fbeb1ad6a604773e602c
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
Reviewed-on: http://openocd.zylin.com/3404
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/jtag/drivers/cmsis_dap_usb.c

index a0922d4651ea479b8bce1992acea44877a4195ed..231e7c81b71e92c6ecdf0ea805765590023192cc 100644 (file)
@@ -869,6 +869,10 @@ static int cmsis_dap_init(void)
        if (retval != ERROR_OK)
                return retval;
 
+       retval = cmsis_dap_get_version_info();
+       if (retval != ERROR_OK)
+               return retval;
+
        if (swd_mode) {
                retval = cmsis_dap_swd_open();
                if (retval != ERROR_OK)
@@ -889,10 +893,6 @@ static int cmsis_dap_init(void)
                LOG_INFO("CMSIS-DAP: Interface Initialised (JTAG)");
        }
 
-       retval = cmsis_dap_get_version_info();
-       if (retval != ERROR_OK)
-               return retval;
-
        /* INFO_ID_PKT_SZ - short */
        retval = cmsis_dap_cmd_DAP_Info(INFO_ID_PKT_SZ, &data);
        if (retval != ERROR_OK)