This is an automated email from Gerrit.

Mathias K?ster (kes...@freenet.de) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/405

-- gerrit

commit 3cb0ec7af24fac3e79d5460e0ea8761f30e05786
Author: Mathias K <kes...@freenet.de>
Date:   Sun Jan 29 15:18:40 2012 +0100

    STLINK: add check for the supported jtag API version
    
    This patch add a validation for the supported jtag api version.
    
    Change-Id: I0b51350e58e351d6662f4039c0a9e9d0d79ba4ec
    Signed-off-by: Mathias K <kes...@freenet.de>

diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c
index 64d3364..5d727ac 100644
--- a/src/jtag/drivers/stlink_usb.c
+++ b/src/jtag/drivers/stlink_usb.c
@@ -43,6 +43,11 @@
 #define STLINK_TX_SIZE (4*128)
 #define STLINK_RX_SIZE (4*128)
 
+enum stlink_jtag_api_version {
+       STLINK_JTAG_API_V1 = 0,
+       STLINK_JTAG_API_V2,
+};
+
 /** */
 struct stlink_usb_version {
        /** */
@@ -73,6 +78,8 @@ struct stlink_usb_handle_s {
        uint16_t pid;
        /** */
        uint32_t sg_tag;
+       /** */
+       enum stlink_jtag_api_version jtag_api;
 };
 
 #define STLINK_OK                      0x80
@@ -1007,6 +1014,15 @@ static int stlink_usb_open(struct 
stlink_interface_param_s *param, void **fd)
                return err;
        }
 
+       /* set the supported jtag api version
+        * V1 doesn't support API V2 at all
+        * V2 support API V2 since JTAG V13
+        */
+       if ((h->version.stlink == 2) && (h->version.jtag > 12))
+               h->jtag_api = STLINK_JTAG_API_V2;
+       else
+               h->jtag_api = STLINK_JTAG_API_V1;
+
        *fd = h;
 
        return ERROR_OK;

-- 

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to