This is an automated email from Gerrit.

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

-- gerrit

commit 1992e348815dfc8d698a40a610bbc6303dc88ac6
Author: Karl Palsson <[email protected]>
Date:   Wed Apr 13 23:45:12 2016 +0000

    drivers: cmsis-dap: print serial if available
    
    Helpful for sanity checking connections
    
    Change-Id: Ife0d8b4e12d4c03685aac8115c9739a4c1e994fe
    Signed-off-by: Karl Palsson <[email protected]>

diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c
index ac5e888..c090878 100644
--- a/src/jtag/drivers/cmsis_dap_usb.c
+++ b/src/jtag/drivers/cmsis_dap_usb.c
@@ -652,6 +652,20 @@ static void cmsis_dap_swd_read_reg(uint8_t cmd, uint32_t 
*value, uint32_t ap_del
        cmsis_dap_swd_queue_cmd(cmd, value, 0);
 }
 
+static int cmsis_dap_get_serial_info(void)
+{
+       uint8_t *data;
+
+       int retval = cmsis_dap_cmd_DAP_Info(INFO_ID_SERNUM, &data);
+       if (retval != ERROR_OK)
+               return retval;
+
+       if (data[0]) /* strlen */
+               LOG_INFO("CMSIS-DAP: Serial# = %s", &data[1]);
+
+       return ERROR_OK;
+}
+
 static int cmsis_dap_get_version_info(void)
 {
        uint8_t *data;
@@ -796,6 +810,10 @@ static int cmsis_dap_init(void)
        if (retval != ERROR_OK)
                return retval;
 
+       retval = cmsis_dap_get_serial_info();
+       if (retval != ERROR_OK)
+               return retval;
+
        if (swd_mode) {
                retval = cmsis_dap_swd_open();
                if (retval != ERROR_OK)

-- 

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to