diff --git a/LinkScope.pro b/LinkScope.pro
new file mode 100644
index 0000000..ad6076c
--- /dev/null
+++ b/LinkScope.pro
@@ -0,0 +1,37 @@
+QT += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+CONFIG += c++11
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+ graphwindow.cpp \
+ main.cpp \
+ mainwindow.cpp
+
+HEADERS += \
+ graphwindow.h \
+ mainwindow.h \
+ vartype.h
+
+FORMS += \
+ graphwindow.ui \
+ mainwindow.ui
+
+RC_ICONS = icon.ico
+
+# Default rules for deployment.
+qnx: target.path = /tmp/$${TARGET}/bin
+else: unix:!android: target.path = /opt/$${TARGET}/bin
+!isEmpty(target.path): INSTALLS += target
diff --git a/LinkScope.pro.user b/LinkScope.pro.user
new file mode 100644
index 0000000..1921fb4
--- /dev/null
+++ b/LinkScope.pro.user
@@ -0,0 +1,319 @@
+
+
+
+
+
+ EnvironmentId
+ {f00ace1e-3608-4ace-b35a-ef2e60010534}
+
+
+ ProjectExplorer.Project.ActiveTarget
+ 0
+
+
+ ProjectExplorer.Project.EditorSettings
+
+ true
+ false
+ true
+
+ Cpp
+
+ CppGlobal
+
+
+
+ QmlJS
+
+ QmlJSGlobal
+
+
+ 2
+ UTF-8
+ false
+ 4
+ false
+ 80
+ true
+ true
+ 1
+ true
+ false
+ 0
+ true
+ true
+ 0
+ 8
+ true
+ 1
+ true
+ true
+ true
+ false
+
+
+
+ ProjectExplorer.Project.PluginSettings
+
+
+ -fno-delayed-template-parsing
+
+ true
+
+
+
+ ProjectExplorer.Project.Target.0
+
+ Desktop Qt 5.9.9 MinGW 32bit
+ Desktop Qt 5.9.9 MinGW 32bit
+ qt.qt5.599.win32_mingw53_kit
+ 0
+ 0
+ 0
+
+ F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Debug
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ false
+ false
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+ false
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+ false
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Debug
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 2
+
+
+ F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Release
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ false
+
+ false
+ false
+ false
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+ false
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+ false
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Release
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+
+
+ F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Profile
+
+
+ true
+ QtProjectManager.QMakeBuildStep
+ true
+
+ false
+ true
+ false
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ false
+
+
+ false
+
+ 2
+ Build
+ Build
+ ProjectExplorer.BuildSteps.Build
+
+
+
+ true
+ Qt4ProjectManager.MakeStep
+
+ true
+ clean
+
+ false
+
+ 1
+ Clean
+ Clean
+ ProjectExplorer.BuildSteps.Clean
+
+ 2
+ false
+
+ Profile
+ Qt4ProjectManager.Qt4BuildConfiguration
+ 0
+
+ 3
+
+
+ 0
+ Deploy
+ Deploy
+ ProjectExplorer.BuildSteps.Deploy
+
+ 1
+ ProjectExplorer.DefaultDeployConfiguration
+
+ 1
+
+
+ dwarf
+
+ cpu-cycles
+
+
+ 250
+
+ -e
+ cpu-cycles
+ --call-graph
+ dwarf,4096
+ -F
+ 250
+
+ -F
+ true
+ 4096
+ false
+ false
+ 1000
+
+ true
+
+ false
+ false
+ false
+ false
+ true
+ 0.01
+ 10
+ true
+ kcachegrind
+ 1
+ 25
+
+ 1
+ true
+ false
+ true
+ valgrind
+
+ 0
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+
+ 2
+
+ Qt4ProjectManager.Qt4RunConfiguration:F:/Sketches/Qt/LinkScope/LinkScope/LinkScope.pro
+ F:/Sketches/Qt/LinkScope/LinkScope/LinkScope.pro
+
+ false
+
+ false
+ true
+ true
+ false
+ false
+ true
+
+ F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Debug
+
+ 1
+
+
+
+ ProjectExplorer.Project.TargetCount
+ 1
+
+
+ ProjectExplorer.Project.Updater.FileVersion
+ 22
+
+
+ Version
+ 22
+
+
diff --git a/README.en.md b/README.en.md
deleted file mode 100644
index 9291910..0000000
--- a/README.en.md
+++ /dev/null
@@ -1,36 +0,0 @@
-# LinkScope
-
-#### Description
-使用QT编写,基于OpenOCD和GDB,用于硬件设备的调试,可以实时查看并修改变量值,有波形绘制和数据导出功能
-
-#### Software Architecture
-Software architecture description
-
-#### Installation
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### Instructions
-
-1. xxxx
-2. xxxx
-3. xxxx
-
-#### Contribution
-
-1. Fork the repository
-2. Create Feat_xxx branch
-3. Commit your code
-4. Create Pull Request
-
-
-#### Gitee Feature
-
-1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
-2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
-3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
-4. The most valuable open source project [GVP](https://gitee.com/gvp)
-5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
-6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
diff --git a/README.md b/README.md
index b2b0ee5..17ae990 100644
--- a/README.md
+++ b/README.md
@@ -1,37 +1,95 @@
# LinkScope
-#### 介绍
-使用QT编写,基于OpenOCD和GDB,用于硬件设备的调试,可以实时查看并修改变量值,有波形绘制和数据导出功能
+---
-#### 软件架构
-软件架构说明
+## 项目简介
+本程序使用QT编写,基于OpenOCD和GDB,用于硬件设备的调试,有以下几个功能
-#### 安装教程
+* **实时查看**和**修改**变量值
-1. xxxx
-2. xxxx
-3. xxxx
+* 变量值**波形实时绘制**
-#### 使用说明
+* 采样数据导出到CSV表格
-1. xxxx
-2. xxxx
-3. xxxx
+* 采样频率约100Hz
-#### 参与贡献
+程序理论上支持OpenOCD所支持的各种调试器及硬件芯片,如STLink、JLink、CMSIS-DAP等以及STM32全系列等
-1. Fork 本仓库
-2. 新建 Feat_xxx 分支
-3. 提交代码
-4. 新建 Pull Request
+目前已测试STLink和CMSIS-DAP对STM32F103RCT6芯片的调试,未发现问题
+![运行演示](imgs/run-demo.png)
-#### 特技
+---
-1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
-2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
-3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
-4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
-5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
-6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
+## 使用方法
+
+1. 在下拉框中选择调试器和芯片类型,选择Axf文件路径,点击连接即可尝试连接芯片
+
+2. 在表格最后一行变量名处填写变量名可以添加查看变量,选中变量名按Del键可以删除变量
+
+> 注:变量名不仅可以填入单个变量名,还可以填入合法的C语言表达式(GDB支持即可);复合类型不能修改和绘图,只能实时查看
+
+1. 编辑`修改变量`列可以修改变量值,双击`图线颜色`列可以选择绘图颜色
+
+![基本操作](imgs/simp-oper.gif)
+
+4. 单击`变量名`列选中对应的变量,绘图窗口会加粗绘制波形,左下角会显示当前值和查看值(拖动鼠标进行查看)
+
+5. 绘图界面说明可以在绘图窗口点击操作说明查看,滚轮配合`Ctrl`、`Shift`、`Alt`可以实现画面的缩放和移动
+
+![绘图操作](imgs/graph-oper.gif)
+
+---
+
+## 菜单项说明
+
+* `显示绘图窗口`:手动关闭绘图窗口后可以通过这个菜单项重新打开绘图窗口并显示到前台
+
+* `刷新连接配置`:连接配置文件位于`openocd/share/openocd/scripts`下的`target`和`interface`中,用户可按照OpenOCD语法编写配置脚本,放入对应目录下,然后点击该菜单项将配置文件加载到下拉选框中
+
+* `保存配置`:软件中所配置的调试器型号、芯片型号、Axf文件路径和各变量的配置都可以通过该菜单项保存到一个配置文件中
+
+* `导入配置`:将上述保存的配置文件重新载入软件中
+
+* `导出数据`:将获取到的各变量采样数据导出到CSV表格文件
+
+---
+
+## 使用注意事项
+
+* 若不指定Axf文件,无法使用变量名,只能通过绝对地址进行查看
+
+* 修改Axf路径后需要重新连接
+
+* 本程序不带下载功能,连接目标前请确认已为目标芯片下载过指定程序;若更换为不同类型的调试器,即使芯片程序没有变动,也应使用更换后的调试器再次下载程序
+
+---
+
+## 已知问题及解决方法
+
+* 若程序发生错误闪退,可能在下次运行时无法成功连接目标,可以尝试手动查找`openocd.exe`进程并强制结束
+
+---
+
+## TODO
+
+* 将采样频率提升至约1kHz
+
+* 优化界面样式
+
+---
+
+## 运行过程简介
+
+* 连接目标时,程序会在后台启动OpenOCD进程进行连接,并命令GDB进程连接到OpenOCD
+
+* 运行过程中程序会不断模拟与GDB进程进行命令行交互,在用户添加变量时使用`display expr`指令将变量添加到GDB的查看表中,同时定时10ms发送`display`指令并进行正则解码,更新用户界面
+
+* 程序开有一个微秒级定时器,每收到一个变量采样数据时,会从该定时器获取当前的时间戳并与数据一起记录下来,同时绘图窗口会不断对历史数据进行更新绘图
+
+---
+
+## 仓库文件说明
+
+* 编译程序后需要将`gdb`和`openocd`复制到可执行文件同级目录下
diff --git a/gdb/gdb.exe b/gdb/gdb.exe
new file mode 100644
index 0000000..0ef6c7e
Binary files /dev/null and b/gdb/gdb.exe differ
diff --git a/gdb/libgcc_s_dw2-1.dll b/gdb/libgcc_s_dw2-1.dll
new file mode 100644
index 0000000..a98ce46
Binary files /dev/null and b/gdb/libgcc_s_dw2-1.dll differ
diff --git a/gdb/zlib1.dll b/gdb/zlib1.dll
new file mode 100644
index 0000000..bb11610
Binary files /dev/null and b/gdb/zlib1.dll differ
diff --git a/graphwindow.cpp b/graphwindow.cpp
new file mode 100644
index 0000000..e1eb713
--- /dev/null
+++ b/graphwindow.cpp
@@ -0,0 +1,323 @@
+#include "graphwindow.h"
+#include "ui_graphwindow.h"
+
+GraphWindow::GraphWindow(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::GraphWindow)
+{
+ ui->setupUi(this);
+ setWindowTitle("LinkScope - Graph");
+ ui->txt_graph->installEventFilter(this);
+ updateCursor();
+ //设定触发定时器
+ trigTimer=new QTimer(this);
+ trigTimer->setInterval(30); //30ms绘制一帧图像
+ trigTimer->start();
+ connect(trigTimer,SIGNAL(timeout()),this,SLOT(onTrig()));
+}
+
+GraphWindow::~GraphWindow()
+{
+ delete trigTimer;
+ delete ui;
+}
+
+//绘图事件,进行图像重绘
+void GraphWindow::paintGraph(QWidget *canvas)
+{
+ //绘图部分在窗口上的位置
+ float offsetx=ui->txt_graph->pos().x(),offsety=ui->txt_graph->pos().y();
+ //绘图部分宽高
+ float hei=ui->txt_graph->height(),wid=ui->txt_graph->width();
+ float posx=0,posy=0;//绘图偏移
+
+ QPainter painter(canvas); //画笔
+
+ painter.setBrush(QBrush(QColor(Qt::white)));//填充背景
+ painter.drawRect(posx,posy,wid,hei);
+
+ //绘制标记线
+ painter.setPen(QPen(QColor(184,184,184),2,Qt::DotLine));
+ for(int i=1;isize();varIndex++)
+ if(varList->at(varIndex).samples.size()>0 && varList->at(varIndex).samples.last().timestamp>totalTime*1000000)
+ totalTime=varList->at(varIndex).samples.last().timestamp/1000000.0;
+ double timeRange=ui->sb_hori_rsv->value()*HORI_DIV;
+
+ if(dragging)//若正在拖拽则根据鼠标位移移动图像
+ {
+ double vertDist=(mousePos.y()-lastMousePos.y())*1.0/hei*ui->sb_vert_rsv->value()*VERT_DIV;
+ ui->sb_vert_offset->setValue(ui->sb_vert_offset->value()-vertDist);
+ double horiDist=(mousePos.x()-lastMousePos.x())*1.0/wid*timeRange*1000;
+ ui->bar_hori->setValue(ui->bar_hori->value()-horiDist);
+ lastMousePos=mousePos;
+ }
+
+ //设定水平拖动条范围
+ if(totalTime>timeRange)
+ ui->bar_hori->setMaximum(totalTime*1000-timeRange*1000);
+ else
+ ui->bar_hori->setMaximum(1);
+ //若勾选实时更新则设定拖动条到末端
+ if(ui->cb_update->checkState()==Qt::Checked)
+ ui->bar_hori->setValue(ui->bar_hori->maximum());
+
+ double startTime=ui->bar_hori->value()*1.0/ui->bar_hori->maximum()*(totalTime-timeRange);//需显示部分的开始时间
+ double endTime=startTime+timeRange;//需显示部分的结束时间
+ double valueRange=ui->sb_vert_rsv->value()*VERT_DIV;//界面能显示的值的范围
+ double minValue=-valueRange/2-ui->sb_vert_offset->value();//界面能显示的最小值
+
+ //依次绘制曲线
+ for(int varIndex=0;varIndexsize();varIndex++)
+ {
+ VarInfo &var=(*varList)[varIndex];
+ if(!var.enableScope || var.samples.size()<2)//若不使能绘制或采样点太少则跳过
+ continue;
+ painter.setPen(QPen(var.lineColor,varIndex==chosenVarIndex?4:2,Qt::SolidLine));//设置笔刷(若是被选中的曲线则加粗)
+ SamplePoint lastSamp=var.samples.at(0);//用于记录线段的上一个点
+ for(int sampIndex=1;sampIndexstartTime&&lastTimestartTime&&thisTimeposy+hei && thisPoint.y()>posy+hei) ))
+ painter.drawLine(lastPoint,thisPoint);
+ }
+ lastSamp=thisSamp;
+ }
+ }
+
+ if(looking)//若正在查看变量则绘制查看线
+ {
+ painter.setPen(QPen(QColor(184,184,184),3,Qt::SolidLine));
+ painter.drawLine(mousePos.x()-offsetx,posy,mousePos.x()-offsetx,posy+hei);
+ }
+
+ //计算并显示选中变量的变量名、当前值、查看值
+ if(chosenVarIndex>=0 && chosenVarIndexsize() && varList->at(chosenVarIndex).samples.size()>=2)
+ {
+ const VarInfo *chosenVar=&varList->at(chosenVarIndex);
+ ui->lab_name->setText("变量名:"+chosenVar->name);
+ ui->lab_curval->setText(QString("当前值:%1").arg(chosenVar->samples.last().value));
+ if(looking)//计算查看位置
+ {
+ double lookTime=(mousePos.x()-posx-offsetx)*1.0/wid*timeRange+startTime;
+ for(int sampIndex=0;sampIndexsamples.size()-1;sampIndex++)//依次检查采样点找到时间戳与查看位置最接近的点
+ {
+ if(chosenVar->samples.at(sampIndex).timestamp/1000000.0<=lookTime&&
+ chosenVar->samples.at(sampIndex+1).timestamp/1000000.0>=lookTime)
+ {
+ ui->lab_lookval->setText(QString("查看值:%1").arg(chosenVar->samples.at(sampIndex).value));
+ break;
+ }
+ if(sampIndex==chosenVar->samples.size()-2)
+ ui->lab_lookval->setText("");
+ }
+ }
+ else
+ {
+ ui->lab_lookval->setText("");
+ }
+ }
+ else
+ {
+ ui->lab_name->setText("");
+ ui->lab_curval->setText("");
+ ui->lab_lookval->setText("");
+ }
+}
+
+//重写事件过滤器,用于触发绘图label的绘图事件
+bool GraphWindow::eventFilter(QObject *watched, QEvent *event)
+{
+ if(watched==ui->txt_graph && event->type()==QEvent::Paint)
+ {
+ paintGraph(ui->txt_graph);
+ return true;
+ }
+ return QDialog::eventFilter(watched,event);
+}
+
+//滚轮事件
+void GraphWindow::wheelEvent(QWheelEvent *event)
+{
+ if(shiftFlag) //shift按下则竖直缩放
+ {
+ float dist=ui->sb_vert_rsv->value()*0.01; //最大/最小值增减量
+ if(event->delta()>0)
+ {
+ ui->sb_vert_rsv->setValue(ui->sb_vert_rsv->value()-dist);
+ }
+ else if(event->delta()<0)
+ {
+ ui->sb_vert_rsv->setValue(ui->sb_vert_rsv->value()+dist);
+ }
+ }
+ if(ctrlFlag) //ctrl按下则水平伸缩
+ {
+ float dist=ui->sb_hori_rsv->value()*0.01; //横向分辨率增减量
+ int barDist=dist*1000*HORI_DIV/2;
+ if(event->delta()>0)
+ {
+ if(ui->sb_hori_rsv->value()>0.001)
+ {
+ ui->sb_hori_rsv->setValue(ui->sb_hori_rsv->value()-dist);
+ if(ui->bar_hori->value()bar_hori->maximum()-barDist)
+ ui->bar_hori->setValue(ui->bar_hori->value()+barDist);
+ }
+ }
+ if(event->delta()<0)
+ {
+ ui->sb_hori_rsv->setValue(ui->sb_hori_rsv->value()+dist);
+ if(ui->bar_hori->value()>ui->bar_hori->minimum()+barDist)
+ ui->bar_hori->setValue(ui->bar_hori->value()-barDist);
+ }
+ }
+ if(!ctrlFlag && !shiftFlag && !altFlag) //无任何组合键按下则时间轴左右滚动
+ {
+ float dist=ui->sb_hori_rsv->value()*100; //水平拖动条位置增减量
+ if(event->delta()>0 && ui->bar_hori->value()>0)
+ {
+ if(ui->bar_hori->value()>dist)
+ ui->bar_hori->setValue(ui->bar_hori->value()-dist);
+ else
+ ui->bar_hori->setValue(0);
+ }
+ else if(event->delta()<0 && ui->bar_hori->value()bar_hori->maximum())
+ {
+ if(ui->bar_hori->maximum()-ui->bar_hori->value()>dist)
+ ui->bar_hori->setValue(ui->bar_hori->value()+dist);
+ else
+ ui->bar_hori->setValue(ui->bar_hori->maximum());
+ }
+
+ }
+}
+
+//按键按下事件
+void GraphWindow::keyPressEvent(QKeyEvent *event)
+{
+ //三种组合键按下时对应标记置true
+ if(event->key()==Qt::Key_Control)
+ ctrlFlag=true;
+ else if(event->key()==Qt::Key_Shift)
+ shiftFlag=true;
+ else if(event->key()==Qt::Key_Alt)
+ altFlag=true;
+ updateCursor();
+}
+
+//按键松开事件
+void GraphWindow::keyReleaseEvent(QKeyEvent *event)
+{
+ //三种组合键松开时对应标记置false
+ if(event->key()==Qt::Key_Control)
+ ctrlFlag=false;
+ else if(event->key()==Qt::Key_Shift)
+ shiftFlag=false;
+ else if(event->key()==Qt::Key_Alt)
+ altFlag=false;
+ updateCursor();
+}
+
+//鼠标按下事件
+void GraphWindow::mousePressEvent(QMouseEvent *event)
+{
+ if(event->button()==Qt::LeftButton) //如果左键按下则开启查看(ALT未按下)或拖拽(ALT按下)
+ {
+ if(altFlag)
+ dragging=true;
+ else
+ looking=true;
+ mousePos.setX(event->x()); //记录鼠标坐标
+ mousePos.setY(event->y());
+ lastMousePos=mousePos;
+ }
+}
+
+//鼠标松开事件
+void GraphWindow::mouseReleaseEvent(QMouseEvent *event)
+{
+ if(event->button()==Qt::LeftButton) //如果左键松开则关闭查看和拖拽
+ looking=dragging=false;
+}
+
+//鼠标移动事件(仅按下时触发)
+void GraphWindow::mouseMoveEvent(QMouseEvent *event)
+{
+ if(looking||dragging) //若在查看或拖拽状态则记录鼠标位置
+ {
+ mousePos.setX(event->x());
+ mousePos.setY(event->y());
+ }
+}
+
+//定时器槽函数,触发绘图
+void GraphWindow::onTrig()
+{
+ ui->txt_graph->update();
+}
+
+//用于外部设置变量列表
+void GraphWindow::setVarList(QList *list)
+{
+ varList=list;
+}
+
+//用于外部设置选中的变量
+void GraphWindow::setChosenIndex(int varIndex)
+{
+ chosenVarIndex=varIndex;
+}
+
+//点击按钮时弹出说明界面
+void GraphWindow::on_btn_help_clicked()
+{
+ //弹出messagebox显示帮助信息
+ QString str="设置说明\n"
+ "水平分辨率:水平方向每两根标线间表示的秒数\n"
+ "竖直分辨率:竖直方向每两根标线间表示的范围\n"
+ "实时更新:始终显示时间轴末端,跟随采样值的更新而变化\n\n"
+ "快捷操作\n"
+ "1.无按键+滚轮:时间轴左右滚动\n"
+ "2.Ctrl+滚轮:图像水平缩放\n"
+ "3.Shift+滚轮:图像竖直缩放\n"
+ "4.Alt+左键拖拽:移动图像\n\n"
+ "查看操作\n"
+ "按住鼠标左键并拖动可以查看所选变量曲线的值(主界面单击变量名可选中变量)";
+ QMessageBox box;
+ box.setWindowTitle("绘图界面说明");
+ box.setText(str);
+ box.exec();
+}
+
+//根据各标志更新光标形状
+void GraphWindow::updateCursor()
+{
+ if(ctrlFlag&&shiftFlag)//ctrl和shift同时按下,水平竖直方向同步缩放,显示斜向缩放箭头
+ ui->txt_graph->setCursor(Qt::SizeFDiagCursor);
+ else if(ctrlFlag)//ctrl按下,水平方向缩放,显示横向箭头
+ ui->txt_graph->setCursor(Qt::SizeHorCursor);
+ else if(shiftFlag)//shift按下,纵向缩放,显示纵向箭头
+ ui->txt_graph->setCursor(Qt::SizeVerCursor);
+ else if(altFlag)//alt按下,可以拖拽图像,显示拖动光标
+ ui->txt_graph->setCursor(Qt::SizeAllCursor);
+ else //没有按键按下,显示十字光标
+ ui->txt_graph->setCursor(Qt::CrossCursor);
+}
diff --git a/graphwindow.h b/graphwindow.h
new file mode 100644
index 0000000..badff0d
--- /dev/null
+++ b/graphwindow.h
@@ -0,0 +1,52 @@
+#ifndef GRAPHWINDOW_H
+#define GRAPHWINDOW_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace Ui {
+class GraphWindow;
+}
+
+class GraphWindow : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit GraphWindow(QWidget *parent = nullptr);
+ ~GraphWindow();
+ void setVarList(QList *list);
+ void setChosenIndex(int varIndex);
+ void paintGraph(QWidget *canvas);
+ bool eventFilter(QObject *watched, QEvent *event);
+ void wheelEvent(QWheelEvent *event);
+ void keyPressEvent(QKeyEvent *event);
+ void keyReleaseEvent(QKeyEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+
+private slots:
+ void onTrig();
+ void on_btn_help_clicked();
+
+private:
+ static const int VERT_DIV=6; //纵向划分的格数
+ static const int HORI_DIV=10; //横向划分的格数
+ Ui::GraphWindow *ui;
+ QList *varList; //变量列表指针,需外部设置
+ QTimer *trigTimer; //定时器用于触发图像更新
+ bool ctrlFlag=false,shiftFlag=false,altFlag=false; //组合键按下标志
+ bool looking=false; //当前是否正在查看变量
+ bool dragging=false; //当前是否正在拖动画布
+ QPoint mousePos,lastMousePos; //拖拽时的鼠标坐标
+ int chosenVarIndex=-1; //当前选中的变量在列表中的索引(未选中时-1)
+ void updateCursor();
+};
+
+#endif // GRAPHWINDOW_H
diff --git a/graphwindow.ui b/graphwindow.ui
new file mode 100644
index 0000000..99866ab
--- /dev/null
+++ b/graphwindow.ui
@@ -0,0 +1,226 @@
+
+
+ GraphWindow
+
+
+
+ 0
+ 0
+ 977
+ 680
+
+
+
+ Dialog
+
+
+ -
+
+
+ 画面设置
+
+
+
-
+
+
+ 画面中显示的采样点数
+
+
+ 水平分辨率(sec/Div)
+
+
+
+ -
+
+
+ 3
+
+
+ 0.001000000000000
+
+
+ 100.000000000000000
+
+
+ 0.100000000000000
+
+
+ 1.000000000000000
+
+
+
+ -
+
+
+ 竖直分辨率(/Div)
+
+
+
+ -
+
+
+ 4
+
+
+ -100000.000000000000000
+
+
+ 100000.000000000000000
+
+
+ 50.000000000000000
+
+
+
+ -
+
+
+ 竖直偏移
+
+
+
+ -
+
+
+ 4
+
+
+ -100000.000000000000000
+
+
+ 100000.000000000000000
+
+
+ 0.000000000000000
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 64
+ 20
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 50
+ false
+
+
+
+ 操作说明
+
+
+ false
+
+
+ false
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ 1000
+
+
+ 1
+
+
+ Qt::Horizontal
+
+
+ false
+
+
+ true
+
+
+
+ -
+
+
-
+
+
+ 变量名
+
+
+
+ -
+
+
+ 当前值
+
+
+
+ -
+
+
+ 查看值
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ 实时更新
+
+
+ true
+
+
+
+
+
+
+
+
+
+
diff --git a/icon.ico b/icon.ico
new file mode 100644
index 0000000..dfdab75
Binary files /dev/null and b/icon.ico differ
diff --git a/imgs/graph-oper.gif b/imgs/graph-oper.gif
new file mode 100644
index 0000000..490c054
Binary files /dev/null and b/imgs/graph-oper.gif differ
diff --git a/imgs/run-demo.png b/imgs/run-demo.png
new file mode 100644
index 0000000..95ea519
Binary files /dev/null and b/imgs/run-demo.png differ
diff --git a/imgs/simp-oper.gif b/imgs/simp-oper.gif
new file mode 100644
index 0000000..eac8df3
Binary files /dev/null and b/imgs/simp-oper.gif differ
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..fd3e533
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,11 @@
+#include "mainwindow.h"
+
+#include
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.show();
+ return a.exec();
+}
diff --git a/mainwindow.cpp b/mainwindow.cpp
new file mode 100644
index 0000000..5afafc0
--- /dev/null
+++ b/mainwindow.cpp
@@ -0,0 +1,667 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ : QMainWindow(parent)
+ , ui(new Ui::MainWindow)
+{
+ ui->setupUi(this);
+ setWindowTitle("LinkScope");
+
+ graph=new GraphWindow();//创建并显示绘图窗口
+ graph->setVarList(&varList);
+ graph->show();
+
+ stampTimer=new QElapsedTimer();//创建并运行时间戳定时器
+ stampTimer->start();
+
+ watchTimer=new QTimer(this);//创建watch定时器
+ watchTimer->setInterval(10);
+ watchTimer->stop();
+ connect(watchTimer,SIGNAL(timeout()),this,SLOT(slotWatchTimerTrig()));
+
+ tableTimer=new QTimer(this);//创建表格刷新定时器
+ tableTimer->setInterval(200);
+ tableTimer->stop();
+ connect(tableTimer,SIGNAL(timeout()),this,SLOT(slotTableTimerTrig()));
+
+ tableModel=new QStandardItemModel(this);//创建并初始化表格
+ initTable();
+
+ ocdProcess=new QProcess(0);//创建openocd进程
+ connect(ocdProcess,SIGNAL(readyReadStandardError()),this,SLOT(slotOCDErrorReady()));
+
+ gdbProcess=new QProcess(0);//创建并运行gdb进程
+ setGDBState(true);
+
+ loadConfFileList();//从openocd文件夹中读取配置文件列表
+}
+
+MainWindow::~MainWindow()
+{
+ if(connected)//若处于连接状态则断开连接
+ setConnState(false);
+ setGDBState(false);//结束gdb进程
+ delete ui;
+ delete tableModel;
+ delete ocdProcess;
+ delete gdbProcess;
+ delete stampTimer;
+ delete watchTimer;
+ delete tableTimer;
+ delete graph;
+}
+
+//按键事件,监听DEL键按下,用于删除单个变量
+void MainWindow::keyPressEvent(QKeyEvent *event)
+{
+ if(event->key()==Qt::Key_Delete)//判定是DEL键
+ {
+ if(ui->tb_var->currentIndex().column()==0)//确定已选中某个变量的变量名
+ {
+ int index=ui->tb_var->currentIndex().row();//获取所选变量的下标
+ if(indexclose();
+}
+
+//ocd进程发生错误,自动断开连接
+void MainWindow::slotOCDErrorReady()
+{
+ QString error=ocdProcess->readAllStandardError();
+ if(error.contains("Error:"))//错误信息中含有Error项,则直接断开连接并弹出提示
+ {
+ setConnState(false);
+ QMessageBox::information(this,"连接错误",error);
+ }
+}
+
+//表格被编辑,添加变量或修改变量值
+void MainWindow::slotTableEdit(QModelIndex topleft, QModelIndex bottomright)
+{
+ Q_UNUSED(bottomright);
+ if(topleft.column()==0 && topleft.row()==varList.size())//若编辑的是最后一行的变量名,进行变量添加
+ {
+ QString name=tableModel->item(topleft.row(),0)->text();
+ if(!name.isEmpty())
+ {
+ VarInfo var;//创建一个默认配置的变量并添加到列表
+ var.name=name;
+ var.rawValue="";
+ var.enableScope=true;
+ var.lineColor=QColor(Qt::black);
+ varList.append(var);
+
+ redrawTable();//重绘表格
+
+ if(connected)//若正在连接状态则向gdb发送新的变量列表
+ setGDBDispList();
+ }
+ }
+ else if(topleft.column()==2 && topleft.row()!=varList.size())//若编辑的是第二列,表示需进行变量值修改
+ {
+ QString name=varList.at(topleft.row()).name;
+ QString valueStr=tableModel->item(topleft.row(),2)->text();
+ if(!valueStr.isEmpty())
+ {
+ setVar(name,valueStr.toDouble());//向gdb发送命令写入变量值
+ tableModel->item(topleft.row(),2)->setText("");//清空编辑框
+ }
+ }
+}
+
+//watch定时器触发,进行一次变量查看
+void MainWindow::slotWatchTimerTrig()
+{
+ if(isWatchProcessing)//若上次查看还未完成则直接退出
+ return;
+ isWatchProcessing=true;
+
+ QString rawGDB;
+ getGDBRawDisp(rawGDB);//获取gdb查看得到的原始值
+ parseGDBRawDisp(rawGDB);//进行正则匹配,更新变量列表内容
+
+ isWatchProcessing=false;
+}
+
+//表格刷新定时器触发,刷新各变量当前值
+void MainWindow::slotTableTimerTrig()
+{
+ for(int index=0;indexitem(index,1);
+ if(item->text()!=varList[index].rawValue)//若列表中数据与当前显示的不同,表示变量发生变化
+ {
+ item->setText(varList[index].rawValue);//设置新值
+ item->setBackground(QBrush(QColor("#99CCFF")));//设置单元格背景为淡蓝色
+ }
+ else
+ {
+ item->setBackground(QBrush(QColor(Qt::white)));//若不发生变化则设置单元格背景为白色
+ }
+ }
+}
+
+//连接按钮点击,触发连接状态切换
+void MainWindow::on_bt_conn_clicked()
+{
+ setConnState(!connected);
+}
+
+//设置连接状态(参数true表示进行连接,false表示断开连接)
+void MainWindow::setConnState(bool connect)
+{
+ if(connect)//进行连接
+ {
+ ui->bt_conn->setEnabled(false);//先禁用连接按钮,防止多次点击
+ setOCDState(true);//运行openocd进程进行目标连接
+ sleep(500);//等待500ms
+ if(ocdProcess->state()==QProcess::Running)//若ocd成功启动
+ {
+ setGDBConnState(true);//连接gdb到ocd
+ for(int i=0;irestart();//开启时间戳计时
+ watchTimer->start();//开启定时查看变量值
+ tableTimer->start();//开启表格定时刷新
+ ui->bt_conn->setText("断开连接");
+ ui->bt_reset->setEnabled(true);//使能复位按钮
+ connected=true;//更新连接标志
+ }
+ ui->bt_conn->setEnabled(true);//恢复连接按钮
+ }
+ else//断开连接
+ {
+ watchTimer->stop();//停止定时查看和定时刷新表格
+ tableTimer->stop();
+ setGDBConnState(false);//断开gdb,停止ocd
+ setOCDState(false);
+ ui->bt_conn->setText("连接目标");
+ ui->bt_reset->setEnabled(false);//禁用复位按钮
+ connected=false;//更新连接标志
+ }
+}
+
+//参数true:运行ocd进程并连接目标;参数false:结束ocd进程
+void MainWindow::setOCDState(bool connect)
+{
+ if(connect)
+ {
+ ocdProcess->setWorkingDirectory(QCoreApplication::applicationDirPath()+"/openocd/bin");//设置工作路径
+ ocdProcess->setProgram(QCoreApplication::applicationDirPath()+"/openocd/bin/openocd.exe");//设置程序路径
+ ocdProcess->setNativeArguments(
+ QString("-f interface/%1 -f target/%2")
+ .arg(ui->cb_interface->currentText())
+ .arg(ui->cb_target->currentText()));//设置参数为所选的调试器和目标芯片
+ ocdProcess->start();
+ }
+ else
+ {
+ QProcess killProcess(0);//创建新进程,用taskkill强行结束ocd进程
+ killProcess.setProgram("taskkill");
+ killProcess.setNativeArguments(QString("/F /PID %1").arg(ocdProcess->pid()->dwProcessId));
+ killProcess.start();
+ killProcess.waitForFinished();
+ }
+}
+
+//参数true:运行gdb进程;参数false:结束gdb进程
+void MainWindow::setGDBState(bool run)
+{
+ if(run)
+ {
+ gdbProcess->setProgram(QCoreApplication::applicationDirPath()+"/gdb/gdb.exe");//设置程序路径
+ gdbProcess->setNativeArguments("-q");//设置gdb在安静模式下打开
+ gdbProcess->start();
+ }
+ else
+ {
+ gdbProcess->kill();
+ }
+}
+
+//参数true:gdb连接到本机3333端口,设置调试参数;参数false:断开gdb连接
+void MainWindow::setGDBConnState(bool connect)
+{
+ if(connect)
+ {
+ gdbProcess->write("target remote localhost:3333\r\n");//连接到3333端口
+ gdbProcess->write(QString("symbol-file %1 \r\n").arg(ui->txt_axf_path->text()).toStdString().c_str());//设置符号文件为所选的axf文件
+ gdbProcess->write("set confirm off\r\n");//设置不要手动确认
+ gdbProcess->write("set print pretty on\r\n");//设置结构体规范打印
+ setGDBDispList();//向gdb发送当前的变量列表
+ }
+ else
+ {
+ gdbProcess->write("disconnect\r\n");
+ }
+}
+
+//向gdb发送变量列表
+void MainWindow::setGDBDispList()
+{
+ gdbProcess->write("delete display\r\n");//删除之前发送的变量列表
+ foreach(VarInfo info,varList)
+ gdbProcess->write(QString("display %1 \r\n").arg(info.name).toStdString().c_str());//向display表中依次添加变量名
+}
+
+//向gdb请求读取所有变量,获取返回的原始字符串
+void MainWindow::getGDBRawDisp(QString &raw)
+{
+ if(!connected)
+ return;
+ gdbProcess->readAllStandardOutput();
+ gdbProcess->write("display\r\n");//向gdb发送display指令
+ raw="";
+ do{
+ gdbProcess->waitForReadyRead();
+ raw+=gdbProcess->readAllStandardOutput();
+ }while(!raw.endsWith("(gdb) "));//不断读取直到读到字符串"gdb ",表示指令执行完成
+}
+
+//解析由gdb返回的display原始字符串,更新变量值
+void MainWindow::parseGDBRawDisp(QString &raw)
+{
+ qint64 timestamp=stampTimer->nsecsElapsed()/1000;//获取时间戳
+
+ for(int index=0;indexcb_interface->clear();
+ ui->cb_target->clear();
+ QDir interfaceDir(QCoreApplication::applicationDirPath()+"/openocd/share/openocd/scripts/interface");
+ interfaceDir.setFilter(QDir::Files);
+ foreach(QFileInfo fileInfo,interfaceDir.entryInfoList())
+ ui->cb_interface->addItem(fileInfo.fileName());
+ QDir targetDir(QCoreApplication::applicationDirPath()+"/openocd/share/openocd/scripts/target");
+ targetDir.setFilter(QDir::Files);
+ foreach(QFileInfo fileInfo,targetDir.entryInfoList())
+ ui->cb_target->addItem(fileInfo.fileName());
+}
+
+//设置axf文件按钮点击,弹出文件选框,读取用户选择的路径
+void MainWindow::on_bt_set_axf_clicked()
+{
+ QFileDialog *fileDialog = new QFileDialog(this);//弹出文件选择框
+ fileDialog->setWindowTitle(QStringLiteral("选中文件"));
+ fileDialog->setDirectory(".");
+ fileDialog->setNameFilter(tr("AXF File (*.axf)"));//设置文件过滤器为axf
+ fileDialog->setFileMode(QFileDialog::ExistingFile);
+ fileDialog->setViewMode(QFileDialog::Detail);
+ if(fileDialog->exec())
+ {
+ QStringList fileList=fileDialog->selectedFiles();
+ QString fileName=fileList.at(0);
+ QFileInfo info(fileName);
+ ui->txt_axf_path->setText(info.filePath());
+ }
+}
+
+//初始化表格
+void MainWindow::initTable()
+{
+ redrawTable();
+ connect(tableModel,SIGNAL(dataChanged(QModelIndex,QModelIndex)),this,SLOT(slotTableEdit(QModelIndex,QModelIndex)));
+ ui->tb_var->setModel(tableModel);
+}
+
+//重绘表格,设置表头并添加各变量信息
+void MainWindow::redrawTable()
+{
+ tableModel->clear();
+ tableModel->setColumnCount(5);//设置表格为5列
+ tableModel->setHeaderData(0,Qt::Horizontal,"变量名");//设置表头
+ tableModel->setHeaderData(1,Qt::Horizontal,"当前值");
+ tableModel->setHeaderData(2,Qt::Horizontal,"修改变量");
+ tableModel->setHeaderData(3,Qt::Horizontal,"使能绘图");
+ tableModel->setHeaderData(4,Qt::Horizontal,"图线颜色");
+
+ for(int i=0;isetItem(i,0,new QStandardItem(varList.at(i).name));
+ tableModel->setItem(i,1,new QStandardItem(varList.at(i).rawValue));
+ tableModel->setItem(i,2,new QStandardItem(""));
+ QStandardItem *checkItem=new QStandardItem();
+ checkItem->setCheckable(true);
+ checkItem->setCheckState(varList.at(i).enableScope?Qt::Checked:Qt::Unchecked);
+ tableModel->setItem(i,3,checkItem);
+ tableModel->setItem(i,4,new QStandardItem(varList.at(i).lineColor.name()));
+ tableModel->item(i,4)->setForeground(QBrush(varList.at(i).lineColor));
+ tableModel->item(i,0)->setFlags(Qt::ItemIsEnabled);
+ tableModel->item(i,1)->setFlags(Qt::ItemIsEnabled);
+ tableModel->item(i,4)->setFlags(Qt::ItemIsEnabled);
+ }
+ int lastRow=varList.size();
+ tableModel->setItem(lastRow,0,new QStandardItem(""));//末尾添加空行,用于用户添加变量
+}
+
+//发送gdb指令,修改变量值
+void MainWindow::setVar(const QString &name, double value)
+{
+ if(!connected)
+ return;
+ gdbProcess->write(QString("set %1=%2\r\n").arg(name).arg(value).toStdString().c_str());
+}
+
+//尝试从变量值原始字符串中解析出double值,返回是否解析成功
+bool MainWindow::getValueFromRaw(const QString &rawValue,double &value)
+{
+ if(rawValue.isEmpty())
+ return false;
+ if(rawValue.contains('{')||rawValue.contains('(')
+ ||rawValue.contains('<')||rawValue.contains('['))//若含有这些符号,表示该变量可能为复合类型,不能被解析
+ return false;
+ value=rawValue.mid(0,rawValue.indexOf(' ')).toDouble();
+ return true;
+}
+
+//保存配置到指定路径的文件
+void MainWindow::saveToFile(const QString &filename)
+{
+ QSettings settings(filename,QSettings::IniFormat);
+ settings.setIniCodec("GBK");
+
+ settings.beginGroup("Global");//写入全局配置
+ settings.setValue("Interface",ui->cb_interface->currentText());
+ settings.setValue("Target",ui->cb_target->currentText());
+ settings.setValue("AxfPath",ui->txt_axf_path->text());
+ settings.setValue("VarNum",varList.size());
+ settings.endGroup();
+
+ for(int index=0;indexname);
+ settings.setValue("EnableScope",varInfo->enableScope);
+ settings.setValue("LineColor",varInfo->lineColor.name());
+ settings.endGroup();
+ }
+}
+
+//从指定路径的文件中读取配置
+void MainWindow::loadFromFile(const QString &filename)
+{
+ QSettings settings(filename,QSettings::IniFormat);
+ settings.setIniCodec("GBK");
+
+ settings.beginGroup("Global");//读取全局配置
+ ui->cb_interface->setCurrentText(settings.value("Interface").toString());
+ ui->cb_target->setCurrentText(settings.value("Target").toString());
+ ui->txt_axf_path->setText(settings.value("AxfPath").toString());
+ int varNum=settings.value("VarNum").toInt();
+ settings.endGroup();
+
+ varList.clear();
+ for(int index=0;indexmaxSampleNum)
+ maxSampleNum=varList.at(i).samples.size();
+
+ for(int index=0;indexwrite("monitor reset\r\n");
+}
+
+//表格双击事件,进行图线颜色修改
+void MainWindow::on_tb_var_doubleClicked(const QModelIndex &index)
+{
+ if(index.column()==4&&index.row()item(index.row(),index.column());
+ QColorDialog colorDialog(this);//弹出颜色选择框,请求用户选择颜色
+ colorDialog.setWindowTitle("请选择颜色");
+ colorDialog.setCurrentColor(QColor(item->text()));
+ if(colorDialog.exec()==QColorDialog::Accepted)//用户确定了颜色选择
+ {
+ QColor color=colorDialog.selectedColor();//获取用户选择的颜色
+ varList[index.row()].lineColor=color;
+ item->setForeground(QBrush(color));
+ item->setText(color.name());
+ }
+ }
+}
+
+//表格单击事件
+void MainWindow::on_tb_var_clicked(const QModelIndex &index)
+{
+ if(index.column()==3&&index.row()item(index.row(),index.column())->checkState()==Qt::Checked);
+ }
+
+ if(index.column()==0&&index.row()setChosenIndex(index.row());//设置绘图界面关注该变量
+ }
+ else //若点击其他列则取消选择
+ {
+ graph->setChosenIndex(-1);
+ }
+}
+
+//保存配置菜单点击
+void MainWindow::on_action_save_triggered()
+{
+ //弹出文件选择框
+ QFileDialog *fileDialog = new QFileDialog(this);
+ fileDialog->setWindowTitle(QStringLiteral("选中文件"));
+ fileDialog->setDirectory(".");
+ fileDialog->setNameFilter(tr("Ini File (*.ini)"));
+ fileDialog->setFileMode(QFileDialog::AnyFile);
+ fileDialog->setViewMode(QFileDialog::Detail);
+ if(fileDialog->exec())//等待用户选择文件
+ {
+ QStringList fileList=fileDialog->selectedFiles();
+ QString fileName=fileList.at(0);
+ if(!fileName.endsWith(".ini"))//若用户输入的文件名不以ini结尾则加上后缀
+ fileName.append(".ini");
+ QFileInfo file(fileName);//判断是否已经存在文件,若存在则弹出覆盖警告框
+ if(file.exists())
+ {
+ QMessageBox messageBox(QMessageBox::NoIcon,"警告", "文件已存在,是否覆盖?",QMessageBox::Yes | QMessageBox::No, NULL);
+ if(messageBox.exec()!=QMessageBox::Yes)
+ return;
+ }
+ saveToFile(fileName);//将配置写入文件
+ }
+}
+
+//导入配置菜单点击
+void MainWindow::on_action_load_triggered()
+{
+ //弹出文件选择框
+ QFileDialog *fileDialog = new QFileDialog(this);
+ fileDialog->setWindowTitle(QStringLiteral("选中文件"));
+ fileDialog->setDirectory(".");
+ fileDialog->setNameFilter(tr("Ini File (*.ini)"));
+ fileDialog->setFileMode(QFileDialog::ExistingFile);
+ fileDialog->setViewMode(QFileDialog::Detail);
+ if(fileDialog->exec())//等待用户选择文件
+ {
+ QStringList fileList=fileDialog->selectedFiles();
+ QString fileName=fileList.at(0);
+ loadFromFile(fileName);//从文件中读取配置
+ }
+}
+
+//导出数据菜单点击
+void MainWindow::on_action_export_triggered()
+{
+ //弹出文件选择框
+ QFileDialog *fileDialog = new QFileDialog(this);
+ fileDialog->setWindowTitle(QStringLiteral("选中文件"));
+ fileDialog->setDirectory(".");
+ fileDialog->setNameFilter(tr("CSV File (*.csv)"));
+ fileDialog->setFileMode(QFileDialog::AnyFile);
+ fileDialog->setViewMode(QFileDialog::Detail);
+ if(fileDialog->exec())//等待用户选择文件
+ {
+ QStringList fileList=fileDialog->selectedFiles();
+ QString fileName=fileList.at(0);
+ if(!fileName.endsWith(".csv"))//若用户输入的文件名不以csv结尾则加上后缀
+ fileName.append(".csv");
+ QFileInfo file(fileName);//判断是否已经存在文件,若存在则弹出覆盖警告框
+ if(file.exists())
+ {
+ QMessageBox messageBox(QMessageBox::NoIcon,"警告", "文件已存在,是否覆盖?",QMessageBox::Yes | QMessageBox::No, NULL);
+ if(messageBox.exec()!=QMessageBox::Yes)
+ return;
+ }
+ if(!exportCSV(fileName))//将数据写入文件
+ {
+ QMessageBox::information(this,"错误","文件打开失败,请检查文件是否被占用");
+ }
+ }
+}
+
+//关于菜单栏点击
+void MainWindow::on_action_about_triggered()
+{
+ //弹出messagebox显示关于信息
+ QString str="LinkScope 版本号:V1.0.0\n\n"
+ "Developed by Skythinker";
+ QMessageBox box;
+ box.setWindowTitle("关于 LinkScope");
+ box.setText(str);
+ box.exec();
+}
+
+//帮助菜单栏点击
+void MainWindow::on_action_help_triggered()
+{
+ //弹出messagebox显示帮助信息
+ QString str="LinkScope简介\n"
+ "本程序使用QT编写,基于OpenOCD和GDB,用于硬件设备的调试,可以实时查看并修改变量值,有波形绘制和数据导出功能\n"
+ "程序支持OpenOCD支持的各种调试器及硬件芯片,如STLink、JLink、CMSIS-DAP等以及STM32全系列等\n\n"
+ "使用方法\n"
+ "1.在下拉框中选择调试器和芯片类型,选择Axf文件路径,点击连接即可尝试连接芯片\n"
+ "2.在表格最后一行变量名处填写变量名可以添加查看变量,选中变量名按Del键可以删除变量\n"
+ "3.编辑【修改变量】列可以修改变量值,双击【图线颜色】列可以选择绘图颜色\n"
+ "4.单击【变量名】列选中对应的变量,可以在绘图窗口查看历史数据,并会加粗绘制\n"
+ "5.绘图界面说明请到绘图窗口点击操作说明\n"
+ "6.点击菜单中的保存/导入配置可以将当前配置保存到INI文件或从文件中恢复配置,点击导出数据可以将获取到的采样数据导出到CSV表格文件\n\n"
+ "注意事项\n"
+ "1.修改Axf路径后需要重新连接\n"
+ "2.在【变量名】列不仅能填写单个变量名,还可以填入任何合法的C语言表达式\n"
+ "3.连接目标前请确认已使用该调试器为目标芯片下载过指定程序\n"
+ "4.若程序闪退后发现下一次运行时无法连接目标,请尝试手动结束openocd.exe进程\n"
+ "5.连接配置文件位于openocd/share/openocd/scripts下的target和interface中,用户可按照openocd语法编写配置脚本,放入对应目录下后点击“刷新连接配置”菜单项\n";
+ QMessageBox box;
+ box.setWindowTitle("LinkScope 帮助");
+ box.setText(str);
+ box.exec();
+}
+
+//显示绘图窗口菜单点击
+void MainWindow::on_action_show_graph_triggered()
+{
+ graph->show();
+ graph->activateWindow();
+}
+
+//刷新连接配置菜单点击
+void MainWindow::on_action_refresh_conf_triggered()
+{
+ loadConfFileList();
+}
+
+//转到主页菜单点击
+void MainWindow::on_action_homepage_triggered()
+{
+ QDesktopServices::openUrl(QUrl("https://gitee.com/skythinker/link-scope"));//打开仓库主页
+}
diff --git a/mainwindow.h b/mainwindow.h
new file mode 100644
index 0000000..ae34c9d
--- /dev/null
+++ b/mainwindow.h
@@ -0,0 +1,83 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+namespace Ui { class MainWindow; }
+QT_END_NAMESPACE
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = nullptr);
+ ~MainWindow();
+ void keyPressEvent(QKeyEvent *event);
+ void closeEvent(QCloseEvent *event);
+
+private slots:
+ void slotOCDErrorReady();
+ void slotTableEdit(QModelIndex topleft, QModelIndex bottomright);
+ void slotWatchTimerTrig();
+ void slotTableTimerTrig();
+ void on_bt_conn_clicked();
+ void on_bt_set_axf_clicked();
+ void on_bt_reset_clicked();
+ void on_tb_var_doubleClicked(const QModelIndex &index);
+ void on_tb_var_clicked(const QModelIndex &index);
+ void on_action_save_triggered();
+ void on_action_load_triggered();
+ void on_action_export_triggered();
+ void on_action_about_triggered();
+ void on_action_help_triggered();
+ void on_action_show_graph_triggered();
+ void on_action_refresh_conf_triggered();
+ void on_action_homepage_triggered();
+
+private:
+ Ui::MainWindow *ui;
+ QProcess *ocdProcess,*gdbProcess;//ocd和gdb进程指针
+ bool connected=false;//标记当前是否已连接
+ QStandardItemModel *tableModel;//表格数据
+ QList varList;//变量列表
+ QTimer *watchTimer,*tableTimer;//定时器,用于查看变量值和刷新表格
+ QElapsedTimer *stampTimer;//时间戳定时器指针
+ GraphWindow *graph;//绘图窗口指针
+ bool isWatchProcessing=false;//标记当前是否正在处理变量值查看
+ void setConnState(bool connect);
+ void setOCDState(bool connect);
+ void setGDBState(bool run);
+ void setGDBConnState(bool connect);
+ void setGDBDispList();
+ void getGDBRawDisp(QString &raw);
+ void parseGDBRawDisp(QString &raw);
+ void sleep(uint32_t ms);
+ void loadConfFileList();
+ void initTable();
+ void redrawTable();
+ void setVar(const QString &name,double value);
+ bool getValueFromRaw(const QString &rawValue,double &value);
+ void saveToFile(const QString &filename);
+ void loadFromFile(const QString &filename);
+ bool exportCSV(const QString &filename);
+};
+#endif // MAINWINDOW_H
diff --git a/mainwindow.ui b/mainwindow.ui
new file mode 100644
index 0000000..f7cf1da
--- /dev/null
+++ b/mainwindow.ui
@@ -0,0 +1,204 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 918
+ 727
+
+
+
+ MainWindow
+
+
+
+ -
+
+
+ -
+
+
+ 连接设置
+
+
+
-
+
+
+ 调试器
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ 目标芯片
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ -
+
+
+ 连接目标
+
+
+
+ -
+
+
+ false
+
+
+ 复位并运行
+
+
+
+
+
+
+ -
+
+
+ 工程设置
+
+
+
-
+
+
+ Axf文件路径
+
+
+
+ -
+
+
+ 请选择axf文件
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 557
+ 20
+
+
+
+
+ -
+
+
+ 设置Axf路径
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存配置
+
+
+
+
+ 导入配置
+
+
+
+
+ 导出数据
+
+
+
+
+ 帮助
+
+
+
+
+ 关于
+
+
+
+
+ 显示绘图窗口
+
+
+
+
+ 刷新连接配置
+
+
+
+
+ 转到主页
+
+
+
+
+
+
diff --git a/openocd/bin/ftd2xx.dll b/openocd/bin/ftd2xx.dll
new file mode 100644
index 0000000..b8e823b
Binary files /dev/null and b/openocd/bin/ftd2xx.dll differ
diff --git a/openocd/bin/libusb0.dll b/openocd/bin/libusb0.dll
new file mode 100644
index 0000000..28122e1
Binary files /dev/null and b/openocd/bin/libusb0.dll differ
diff --git a/openocd/bin/openocd.exe b/openocd/bin/openocd.exe
new file mode 100644
index 0000000..360247b
Binary files /dev/null and b/openocd/bin/openocd.exe differ
diff --git a/openocd/bin/openocd_hla_multicore.exe b/openocd/bin/openocd_hla_multicore.exe
new file mode 100644
index 0000000..ae1beb8
Binary files /dev/null and b/openocd/bin/openocd_hla_multicore.exe differ
diff --git a/openocd/bin/openocd_rp2040.exe b/openocd/bin/openocd_rp2040.exe
new file mode 100644
index 0000000..839fce9
Binary files /dev/null and b/openocd/bin/openocd_rp2040.exe differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/Static/amd64/ftd2xx.lib b/openocd/drivers/FTDI CDM v2.08.28 Certified/Static/amd64/ftd2xx.lib
new file mode 100644
index 0000000..aefb26b
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/Static/amd64/ftd2xx.lib differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/Static/i386/ftd2xx.lib b/openocd/drivers/FTDI CDM v2.08.28 Certified/Static/i386/ftd2xx.lib
new file mode 100644
index 0000000..adc7321
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/Static/i386/ftd2xx.lib differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftbusui.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftbusui.dll
new file mode 100644
index 0000000..b9e2858
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftbusui.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftcserco.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftcserco.dll
new file mode 100644
index 0000000..f292915
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftcserco.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx.lib b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx.lib
new file mode 100644
index 0000000..0d68cf7
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx.lib differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx64.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx64.dll
new file mode 100644
index 0000000..9044b42
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftd2xx64.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftdibus.sys b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftdibus.sys
new file mode 100644
index 0000000..f13ca47
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftdibus.sys differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftlang.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftlang.dll
new file mode 100644
index 0000000..66de070
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftlang.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftser2k.sys b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftser2k.sys
new file mode 100644
index 0000000..9b90f5d
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftser2k.sys differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftserui2.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftserui2.dll
new file mode 100644
index 0000000..fe73f25
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/amd64/ftserui2.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/driver.xml b/openocd/drivers/FTDI CDM v2.08.28 Certified/driver.xml
new file mode 100644
index 0000000..b643ff6
--- /dev/null
+++ b/openocd/drivers/FTDI CDM v2.08.28 Certified/driver.xml
@@ -0,0 +1,8 @@
+
+
+
+ FTDI CDM
+ ftdibus.inf
+ com.sysprogs.ftdi
+
+
\ No newline at end of file
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/ftd2xx.h b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftd2xx.h
new file mode 100644
index 0000000..3c901d8
--- /dev/null
+++ b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftd2xx.h
@@ -0,0 +1,1341 @@
+/*++
+
+Copyright 2001-2011 Future Technology Devices International Limited
+
+THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
+
+FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
+
+IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE
+RESPONSIBILITY OF THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL
+RE-CERTIFICATION AS A RESULT OF MAKING THESE CHANGES.
+
+
+Module Name:
+
+ftd2xx.h
+
+Abstract:
+
+Native USB device driver for FTDI FT232x, FT245x, FT2232x and FT4232x devices
+FTD2XX library definitions
+
+Environment:
+
+kernel & user mode
+
+
+--*/
+
+
+#ifndef FTD2XX_H
+#define FTD2XX_H
+
+// The following ifdef block is the standard way of creating macros
+// which make exporting from a DLL simpler. All files within this DLL
+// are compiled with the FTD2XX_EXPORTS symbol defined on the command line.
+// This symbol should not be defined on any project that uses this DLL.
+// This way any other project whose source files include this file see
+// FTD2XX_API functions as being imported from a DLL, whereas this DLL
+// sees symbols defined with this macro as being exported.
+
+#ifdef FTD2XX_EXPORTS
+#define FTD2XX_API __declspec(dllexport)
+#else
+#define FTD2XX_API __declspec(dllimport)
+#endif
+
+
+typedef PVOID FT_HANDLE;
+typedef ULONG FT_STATUS;
+
+//
+// Device status
+//
+enum {
+ FT_OK,
+ FT_INVALID_HANDLE,
+ FT_DEVICE_NOT_FOUND,
+ FT_DEVICE_NOT_OPENED,
+ FT_IO_ERROR,
+ FT_INSUFFICIENT_RESOURCES,
+ FT_INVALID_PARAMETER,
+ FT_INVALID_BAUD_RATE,
+
+ FT_DEVICE_NOT_OPENED_FOR_ERASE,
+ FT_DEVICE_NOT_OPENED_FOR_WRITE,
+ FT_FAILED_TO_WRITE_DEVICE,
+ FT_EEPROM_READ_FAILED,
+ FT_EEPROM_WRITE_FAILED,
+ FT_EEPROM_ERASE_FAILED,
+ FT_EEPROM_NOT_PRESENT,
+ FT_EEPROM_NOT_PROGRAMMED,
+ FT_INVALID_ARGS,
+ FT_NOT_SUPPORTED,
+ FT_OTHER_ERROR,
+ FT_DEVICE_LIST_NOT_READY,
+};
+
+
+#define FT_SUCCESS(status) ((status) == FT_OK)
+
+//
+// FT_OpenEx Flags
+//
+
+#define FT_OPEN_BY_SERIAL_NUMBER 1
+#define FT_OPEN_BY_DESCRIPTION 2
+#define FT_OPEN_BY_LOCATION 4
+
+//
+// FT_ListDevices Flags (used in conjunction with FT_OpenEx Flags
+//
+
+#define FT_LIST_NUMBER_ONLY 0x80000000
+#define FT_LIST_BY_INDEX 0x40000000
+#define FT_LIST_ALL 0x20000000
+
+#define FT_LIST_MASK (FT_LIST_NUMBER_ONLY|FT_LIST_BY_INDEX|FT_LIST_ALL)
+
+//
+// Baud Rates
+//
+
+#define FT_BAUD_300 300
+#define FT_BAUD_600 600
+#define FT_BAUD_1200 1200
+#define FT_BAUD_2400 2400
+#define FT_BAUD_4800 4800
+#define FT_BAUD_9600 9600
+#define FT_BAUD_14400 14400
+#define FT_BAUD_19200 19200
+#define FT_BAUD_38400 38400
+#define FT_BAUD_57600 57600
+#define FT_BAUD_115200 115200
+#define FT_BAUD_230400 230400
+#define FT_BAUD_460800 460800
+#define FT_BAUD_921600 921600
+
+//
+// Word Lengths
+//
+
+#define FT_BITS_8 (UCHAR) 8
+#define FT_BITS_7 (UCHAR) 7
+
+//
+// Stop Bits
+//
+
+#define FT_STOP_BITS_1 (UCHAR) 0
+#define FT_STOP_BITS_2 (UCHAR) 2
+
+//
+// Parity
+//
+
+#define FT_PARITY_NONE (UCHAR) 0
+#define FT_PARITY_ODD (UCHAR) 1
+#define FT_PARITY_EVEN (UCHAR) 2
+#define FT_PARITY_MARK (UCHAR) 3
+#define FT_PARITY_SPACE (UCHAR) 4
+
+//
+// Flow Control
+//
+
+#define FT_FLOW_NONE 0x0000
+#define FT_FLOW_RTS_CTS 0x0100
+#define FT_FLOW_DTR_DSR 0x0200
+#define FT_FLOW_XON_XOFF 0x0400
+
+//
+// Purge rx and tx buffers
+//
+#define FT_PURGE_RX 1
+#define FT_PURGE_TX 2
+
+//
+// Events
+//
+
+typedef void (*PFT_EVENT_HANDLER)(DWORD,DWORD);
+
+#define FT_EVENT_RXCHAR 1
+#define FT_EVENT_MODEM_STATUS 2
+#define FT_EVENT_LINE_STATUS 4
+
+//
+// Timeouts
+//
+
+#define FT_DEFAULT_RX_TIMEOUT 300
+#define FT_DEFAULT_TX_TIMEOUT 300
+
+//
+// Device types
+//
+
+typedef ULONG FT_DEVICE;
+
+enum {
+ FT_DEVICE_BM,
+ FT_DEVICE_AM,
+ FT_DEVICE_100AX,
+ FT_DEVICE_UNKNOWN,
+ FT_DEVICE_2232C,
+ FT_DEVICE_232R,
+ FT_DEVICE_2232H,
+ FT_DEVICE_4232H,
+ FT_DEVICE_232H,
+ FT_DEVICE_X_SERIES
+};
+
+//
+// Bit Modes
+//
+
+#define FT_BITMODE_RESET 0x00
+#define FT_BITMODE_ASYNC_BITBANG 0x01
+#define FT_BITMODE_MPSSE 0x02
+#define FT_BITMODE_SYNC_BITBANG 0x04
+#define FT_BITMODE_MCU_HOST 0x08
+#define FT_BITMODE_FAST_SERIAL 0x10
+#define FT_BITMODE_CBUS_BITBANG 0x20
+#define FT_BITMODE_SYNC_FIFO 0x40
+
+//
+// FT232R CBUS Options EEPROM values
+//
+
+#define FT_232R_CBUS_TXDEN 0x00 // Tx Data Enable
+#define FT_232R_CBUS_PWRON 0x01 // Power On
+#define FT_232R_CBUS_RXLED 0x02 // Rx LED
+#define FT_232R_CBUS_TXLED 0x03 // Tx LED
+#define FT_232R_CBUS_TXRXLED 0x04 // Tx and Rx LED
+#define FT_232R_CBUS_SLEEP 0x05 // Sleep
+#define FT_232R_CBUS_CLK48 0x06 // 48MHz clock
+#define FT_232R_CBUS_CLK24 0x07 // 24MHz clock
+#define FT_232R_CBUS_CLK12 0x08 // 12MHz clock
+#define FT_232R_CBUS_CLK6 0x09 // 6MHz clock
+#define FT_232R_CBUS_IOMODE 0x0A // IO Mode for CBUS bit-bang
+#define FT_232R_CBUS_BITBANG_WR 0x0B // Bit-bang write strobe
+#define FT_232R_CBUS_BITBANG_RD 0x0C // Bit-bang read strobe
+
+//
+// FT232H CBUS Options EEPROM values
+//
+
+#define FT_232H_CBUS_TRISTATE 0x00 // Tristate
+#define FT_232H_CBUS_TXLED 0x01 // Tx LED
+#define FT_232H_CBUS_RXLED 0x02 // Rx LED
+#define FT_232H_CBUS_TXRXLED 0x03 // Tx and Rx LED
+#define FT_232H_CBUS_PWREN 0x04 // Power Enable
+#define FT_232H_CBUS_SLEEP 0x05 // Sleep
+#define FT_232H_CBUS_DRIVE_0 0x06 // Drive pin to logic 0
+#define FT_232H_CBUS_DRIVE_1 0x07 // Drive pin to logic 1
+#define FT_232H_CBUS_IOMODE 0x08 // IO Mode for CBUS bit-bang
+#define FT_232H_CBUS_TXDEN 0x09 // Tx Data Enable
+#define FT_232H_CBUS_CLK30 0x0A // 30MHz clock
+#define FT_232H_CBUS_CLK15 0x0B // 15MHz clock
+#define FT_232H_CBUS_CLK7_5 0x0C // 7.5MHz clock
+
+//
+// FT X Series CBUS Options EEPROM values
+//
+
+#define FT_X_SERIES_CBUS_TRISTATE 0x00 // Tristate
+#define FT_X_SERIES_CBUS_RXLED 0x01 // Tx LED
+#define FT_X_SERIES_CBUS_TXLED 0x02 // Rx LED
+#define FT_X_SERIES_CBUS_TXRXLED 0x03 // Tx and Rx LED
+#define FT_X_SERIES_CBUS_PWREN 0x04 // Power Enable
+#define FT_X_SERIES_CBUS_SLEEP 0x05 // Sleep
+#define FT_X_SERIES_CBUS_DRIVE_0 0x06 // Drive pin to logic 0
+#define FT_X_SERIES_CBUS_DRIVE_1 0x07 // Drive pin to logic 1
+#define FT_X_SERIES_CBUS_IOMODE 0x08 // IO Mode for CBUS bit-bang
+#define FT_X_SERIES_CBUS_TXDEN 0x09 // Tx Data Enable
+#define FT_X_SERIES_CBUS_CLK24 0x0A // 24MHz clock
+#define FT_X_SERIES_CBUS_CLK12 0x0B // 12MHz clock
+#define FT_X_SERIES_CBUS_CLK6 0x0C // 6MHz clock
+#define FT_X_SERIES_CBUS_BCD_CHARGER 0x0D // Battery charger detected
+#define FT_X_SERIES_CBUS_BCD_CHARGER_N 0x0E // Battery charger detected inverted
+#define FT_X_SERIES_CBUS_I2C_TXE 0x0F // I2C Tx empty
+#define FT_X_SERIES_CBUS_I2C_RXF 0x10 // I2C Rx full
+#define FT_X_SERIES_CBUS_VBUS_SENSE 0x11 // Detect VBUS
+#define FT_X_SERIES_CBUS_BITBANG_WR 0x12 // Bit-bang write strobe
+#define FT_X_SERIES_CBUS_BITBANG_RD 0x13 // Bit-bang read strobe
+#define FT_X_SERIES_CBUS_TIMESTAMP 0x14 // Toggle output when a USB SOF token is received
+#define FT_X_SERIES_CBUS_KEEP_AWAKE 0x15 //
+
+
+// Driver types
+#define FT_DRIVER_TYPE_D2XX 0
+#define FT_DRIVER_TYPE_VCP 1
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Open(
+ int deviceNumber,
+ FT_HANDLE *pHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_OpenEx(
+ PVOID pArg1,
+ DWORD Flags,
+ FT_HANDLE *pHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_ListDevices(
+ PVOID pArg1,
+ PVOID pArg2,
+ DWORD Flags
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Close(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Read(
+ FT_HANDLE ftHandle,
+ LPVOID lpBuffer,
+ DWORD dwBytesToRead,
+ LPDWORD lpBytesReturned
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Write(
+ FT_HANDLE ftHandle,
+ LPVOID lpBuffer,
+ DWORD dwBytesToWrite,
+ LPDWORD lpBytesWritten
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_IoCtl(
+ FT_HANDLE ftHandle,
+ DWORD dwIoControlCode,
+ LPVOID lpInBuf,
+ DWORD nInBufSize,
+ LPVOID lpOutBuf,
+ DWORD nOutBufSize,
+ LPDWORD lpBytesReturned,
+ LPOVERLAPPED lpOverlapped
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetBaudRate(
+ FT_HANDLE ftHandle,
+ ULONG BaudRate
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetDivisor(
+ FT_HANDLE ftHandle,
+ USHORT Divisor
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetDataCharacteristics(
+ FT_HANDLE ftHandle,
+ UCHAR WordLength,
+ UCHAR StopBits,
+ UCHAR Parity
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetFlowControl(
+ FT_HANDLE ftHandle,
+ USHORT FlowControl,
+ UCHAR XonChar,
+ UCHAR XoffChar
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_ResetDevice(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetDtr(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_ClrDtr(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetRts(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_ClrRts(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetModemStatus(
+ FT_HANDLE ftHandle,
+ ULONG *pModemStatus
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetChars(
+ FT_HANDLE ftHandle,
+ UCHAR EventChar,
+ UCHAR EventCharEnabled,
+ UCHAR ErrorChar,
+ UCHAR ErrorCharEnabled
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Purge(
+ FT_HANDLE ftHandle,
+ ULONG Mask
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetTimeouts(
+ FT_HANDLE ftHandle,
+ ULONG ReadTimeout,
+ ULONG WriteTimeout
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetQueueStatus(
+ FT_HANDLE ftHandle,
+ DWORD *dwRxBytes
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetEventNotification(
+ FT_HANDLE ftHandle,
+ DWORD Mask,
+ PVOID Param
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetStatus(
+ FT_HANDLE ftHandle,
+ DWORD *dwRxBytes,
+ DWORD *dwTxBytes,
+ DWORD *dwEventDWord
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetBreakOn(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetBreakOff(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetWaitMask(
+ FT_HANDLE ftHandle,
+ DWORD Mask
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_WaitOnMask(
+ FT_HANDLE ftHandle,
+ DWORD *Mask
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetEventStatus(
+ FT_HANDLE ftHandle,
+ DWORD *dwEventDWord
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_ReadEE(
+ FT_HANDLE ftHandle,
+ DWORD dwWordOffset,
+ LPWORD lpwValue
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_WriteEE(
+ FT_HANDLE ftHandle,
+ DWORD dwWordOffset,
+ WORD wValue
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EraseEE(
+ FT_HANDLE ftHandle
+ );
+
+ //
+ // structure to hold program data for FT_EE_Program, FT_EE_ProgramEx, FT_EE_Read
+ // and FT_EE_ReadEx functions
+ //
+ typedef struct ft_program_data {
+
+ DWORD Signature1; // Header - must be 0x00000000
+ DWORD Signature2; // Header - must be 0xffffffff
+ DWORD Version; // Header - FT_PROGRAM_DATA version
+ // 0 = original
+ // 1 = FT2232 extensions
+ // 2 = FT232R extensions
+ // 3 = FT2232H extensions
+ // 4 = FT4232H extensions
+ // 5 = FT232H extensions
+
+ WORD VendorId; // 0x0403
+ WORD ProductId; // 0x6001
+ char *Manufacturer; // "FTDI"
+ char *ManufacturerId; // "FT"
+ char *Description; // "USB HS Serial Converter"
+ char *SerialNumber; // "FT000001" if fixed, or NULL
+ WORD MaxPower; // 0 < MaxPower <= 500
+ WORD PnP; // 0 = disabled, 1 = enabled
+ WORD SelfPowered; // 0 = bus powered, 1 = self powered
+ WORD RemoteWakeup; // 0 = not capable, 1 = capable
+ //
+ // Rev4 (FT232B) extensions
+ //
+ UCHAR Rev4; // non-zero if Rev4 chip, zero otherwise
+ UCHAR IsoIn; // non-zero if in endpoint is isochronous
+ UCHAR IsoOut; // non-zero if out endpoint is isochronous
+ UCHAR PullDownEnable; // non-zero if pull down enabled
+ UCHAR SerNumEnable; // non-zero if serial number to be used
+ UCHAR USBVersionEnable; // non-zero if chip uses USBVersion
+ WORD USBVersion; // BCD (0x0200 => USB2)
+ //
+ // Rev 5 (FT2232) extensions
+ //
+ UCHAR Rev5; // non-zero if Rev5 chip, zero otherwise
+ UCHAR IsoInA; // non-zero if in endpoint is isochronous
+ UCHAR IsoInB; // non-zero if in endpoint is isochronous
+ UCHAR IsoOutA; // non-zero if out endpoint is isochronous
+ UCHAR IsoOutB; // non-zero if out endpoint is isochronous
+ UCHAR PullDownEnable5; // non-zero if pull down enabled
+ UCHAR SerNumEnable5; // non-zero if serial number to be used
+ UCHAR USBVersionEnable5; // non-zero if chip uses USBVersion
+ WORD USBVersion5; // BCD (0x0200 => USB2)
+ UCHAR AIsHighCurrent; // non-zero if interface is high current
+ UCHAR BIsHighCurrent; // non-zero if interface is high current
+ UCHAR IFAIsFifo; // non-zero if interface is 245 FIFO
+ UCHAR IFAIsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR IFAIsFastSer; // non-zero if interface is Fast serial
+ UCHAR AIsVCP; // non-zero if interface is to use VCP drivers
+ UCHAR IFBIsFifo; // non-zero if interface is 245 FIFO
+ UCHAR IFBIsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR IFBIsFastSer; // non-zero if interface is Fast serial
+ UCHAR BIsVCP; // non-zero if interface is to use VCP drivers
+ //
+ // Rev 6 (FT232R) extensions
+ //
+ UCHAR UseExtOsc; // Use External Oscillator
+ UCHAR HighDriveIOs; // High Drive I/Os
+ UCHAR EndpointSize; // Endpoint size
+ UCHAR PullDownEnableR; // non-zero if pull down enabled
+ UCHAR SerNumEnableR; // non-zero if serial number to be used
+ UCHAR InvertTXD; // non-zero if invert TXD
+ UCHAR InvertRXD; // non-zero if invert RXD
+ UCHAR InvertRTS; // non-zero if invert RTS
+ UCHAR InvertCTS; // non-zero if invert CTS
+ UCHAR InvertDTR; // non-zero if invert DTR
+ UCHAR InvertDSR; // non-zero if invert DSR
+ UCHAR InvertDCD; // non-zero if invert DCD
+ UCHAR InvertRI; // non-zero if invert RI
+ UCHAR Cbus0; // Cbus Mux control
+ UCHAR Cbus1; // Cbus Mux control
+ UCHAR Cbus2; // Cbus Mux control
+ UCHAR Cbus3; // Cbus Mux control
+ UCHAR Cbus4; // Cbus Mux control
+ UCHAR RIsD2XX; // non-zero if using D2XX driver
+ //
+ // Rev 7 (FT2232H) Extensions
+ //
+ UCHAR PullDownEnable7; // non-zero if pull down enabled
+ UCHAR SerNumEnable7; // non-zero if serial number to be used
+ UCHAR ALSlowSlew; // non-zero if AL pins have slow slew
+ UCHAR ALSchmittInput; // non-zero if AL pins are Schmitt input
+ UCHAR ALDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR AHSlowSlew; // non-zero if AH pins have slow slew
+ UCHAR AHSchmittInput; // non-zero if AH pins are Schmitt input
+ UCHAR AHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR BLSlowSlew; // non-zero if BL pins have slow slew
+ UCHAR BLSchmittInput; // non-zero if BL pins are Schmitt input
+ UCHAR BLDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR BHSlowSlew; // non-zero if BH pins have slow slew
+ UCHAR BHSchmittInput; // non-zero if BH pins are Schmitt input
+ UCHAR BHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR IFAIsFifo7; // non-zero if interface is 245 FIFO
+ UCHAR IFAIsFifoTar7; // non-zero if interface is 245 FIFO CPU target
+ UCHAR IFAIsFastSer7; // non-zero if interface is Fast serial
+ UCHAR AIsVCP7; // non-zero if interface is to use VCP drivers
+ UCHAR IFBIsFifo7; // non-zero if interface is 245 FIFO
+ UCHAR IFBIsFifoTar7; // non-zero if interface is 245 FIFO CPU target
+ UCHAR IFBIsFastSer7; // non-zero if interface is Fast serial
+ UCHAR BIsVCP7; // non-zero if interface is to use VCP drivers
+ UCHAR PowerSaveEnable; // non-zero if using BCBUS7 to save power for self-powered designs
+ //
+ // Rev 8 (FT4232H) Extensions
+ //
+ UCHAR PullDownEnable8; // non-zero if pull down enabled
+ UCHAR SerNumEnable8; // non-zero if serial number to be used
+ UCHAR ASlowSlew; // non-zero if A pins have slow slew
+ UCHAR ASchmittInput; // non-zero if A pins are Schmitt input
+ UCHAR ADriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR BSlowSlew; // non-zero if B pins have slow slew
+ UCHAR BSchmittInput; // non-zero if B pins are Schmitt input
+ UCHAR BDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR CSlowSlew; // non-zero if C pins have slow slew
+ UCHAR CSchmittInput; // non-zero if C pins are Schmitt input
+ UCHAR CDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR DSlowSlew; // non-zero if D pins have slow slew
+ UCHAR DSchmittInput; // non-zero if D pins are Schmitt input
+ UCHAR DDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR ARIIsTXDEN; // non-zero if port A uses RI as RS485 TXDEN
+ UCHAR BRIIsTXDEN; // non-zero if port B uses RI as RS485 TXDEN
+ UCHAR CRIIsTXDEN; // non-zero if port C uses RI as RS485 TXDEN
+ UCHAR DRIIsTXDEN; // non-zero if port D uses RI as RS485 TXDEN
+ UCHAR AIsVCP8; // non-zero if interface is to use VCP drivers
+ UCHAR BIsVCP8; // non-zero if interface is to use VCP drivers
+ UCHAR CIsVCP8; // non-zero if interface is to use VCP drivers
+ UCHAR DIsVCP8; // non-zero if interface is to use VCP drivers
+ //
+ // Rev 9 (FT232H) Extensions
+ //
+ UCHAR PullDownEnableH; // non-zero if pull down enabled
+ UCHAR SerNumEnableH; // non-zero if serial number to be used
+ UCHAR ACSlowSlewH; // non-zero if AC pins have slow slew
+ UCHAR ACSchmittInputH; // non-zero if AC pins are Schmitt input
+ UCHAR ACDriveCurrentH; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR ADSlowSlewH; // non-zero if AD pins have slow slew
+ UCHAR ADSchmittInputH; // non-zero if AD pins are Schmitt input
+ UCHAR ADDriveCurrentH; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR Cbus0H; // Cbus Mux control
+ UCHAR Cbus1H; // Cbus Mux control
+ UCHAR Cbus2H; // Cbus Mux control
+ UCHAR Cbus3H; // Cbus Mux control
+ UCHAR Cbus4H; // Cbus Mux control
+ UCHAR Cbus5H; // Cbus Mux control
+ UCHAR Cbus6H; // Cbus Mux control
+ UCHAR Cbus7H; // Cbus Mux control
+ UCHAR Cbus8H; // Cbus Mux control
+ UCHAR Cbus9H; // Cbus Mux control
+ UCHAR IsFifoH; // non-zero if interface is 245 FIFO
+ UCHAR IsFifoTarH; // non-zero if interface is 245 FIFO CPU target
+ UCHAR IsFastSerH; // non-zero if interface is Fast serial
+ UCHAR IsFT1248H; // non-zero if interface is FT1248
+ UCHAR FT1248CpolH; // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
+ UCHAR FT1248LsbH; // FT1248 data is LSB (1) or MSB (0)
+ UCHAR FT1248FlowControlH; // FT1248 flow control enable
+ UCHAR IsVCPH; // non-zero if interface is to use VCP drivers
+ UCHAR PowerSaveEnableH; // non-zero if using ACBUS7 to save power for self-powered designs
+
+ } FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_Program(
+ FT_HANDLE ftHandle,
+ PFT_PROGRAM_DATA pData
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_ProgramEx(
+ FT_HANDLE ftHandle,
+ PFT_PROGRAM_DATA pData,
+ char *Manufacturer,
+ char *ManufacturerId,
+ char *Description,
+ char *SerialNumber
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_Read(
+ FT_HANDLE ftHandle,
+ PFT_PROGRAM_DATA pData
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_ReadEx(
+ FT_HANDLE ftHandle,
+ PFT_PROGRAM_DATA pData,
+ char *Manufacturer,
+ char *ManufacturerId,
+ char *Description,
+ char *SerialNumber
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_UASize(
+ FT_HANDLE ftHandle,
+ LPDWORD lpdwSize
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_UAWrite(
+ FT_HANDLE ftHandle,
+ PUCHAR pucData,
+ DWORD dwDataLen
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_UARead(
+ FT_HANDLE ftHandle,
+ PUCHAR pucData,
+ DWORD dwDataLen,
+ LPDWORD lpdwBytesRead
+ );
+
+
+ typedef struct ft_eeprom_header {
+ FT_DEVICE deviceType; // FTxxxx device type to be programmed
+ // Device descriptor options
+ WORD VendorId; // 0x0403
+ WORD ProductId; // 0x6001
+ UCHAR SerNumEnable; // non-zero if serial number to be used
+ // Config descriptor options
+ WORD MaxPower; // 0 < MaxPower <= 500
+ UCHAR SelfPowered; // 0 = bus powered, 1 = self powered
+ UCHAR RemoteWakeup; // 0 = not capable, 1 = capable
+ // Hardware options
+ UCHAR PullDownEnable; // non-zero if pull down in suspend enabled
+ } FT_EEPROM_HEADER, *PFT_EEPROM_HEADER;
+
+
+ // FT232B EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_232b {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ } FT_EEPROM_232B, *PFT_EEPROM_232B;
+
+
+ // FT2232 EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_2232 {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ // Drive options
+ UCHAR AIsHighCurrent; // non-zero if interface is high current
+ UCHAR BIsHighCurrent; // non-zero if interface is high current
+ // Hardware options
+ UCHAR AIsFifo; // non-zero if interface is 245 FIFO
+ UCHAR AIsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR AIsFastSer; // non-zero if interface is Fast serial
+ UCHAR BIsFifo; // non-zero if interface is 245 FIFO
+ UCHAR BIsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR BIsFastSer; // non-zero if interface is Fast serial
+ // Driver option
+ UCHAR ADriverType; //
+ UCHAR BDriverType; //
+ } FT_EEPROM_2232, *PFT_EEPROM_2232;
+
+
+ // FT232R EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_232r {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ // Drive options
+ UCHAR IsHighCurrent; // non-zero if interface is high current
+ // Hardware options
+ UCHAR UseExtOsc; // Use External Oscillator
+ UCHAR InvertTXD; // non-zero if invert TXD
+ UCHAR InvertRXD; // non-zero if invert RXD
+ UCHAR InvertRTS; // non-zero if invert RTS
+ UCHAR InvertCTS; // non-zero if invert CTS
+ UCHAR InvertDTR; // non-zero if invert DTR
+ UCHAR InvertDSR; // non-zero if invert DSR
+ UCHAR InvertDCD; // non-zero if invert DCD
+ UCHAR InvertRI; // non-zero if invert RI
+ UCHAR Cbus0; // Cbus Mux control
+ UCHAR Cbus1; // Cbus Mux control
+ UCHAR Cbus2; // Cbus Mux control
+ UCHAR Cbus3; // Cbus Mux control
+ UCHAR Cbus4; // Cbus Mux control
+ // Driver option
+ UCHAR DriverType; //
+ } FT_EEPROM_232R, *PFT_EEPROM_232R;
+
+
+ // FT2232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_2232h {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ // Drive options
+ UCHAR ALSlowSlew; // non-zero if AL pins have slow slew
+ UCHAR ALSchmittInput; // non-zero if AL pins are Schmitt input
+ UCHAR ALDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR AHSlowSlew; // non-zero if AH pins have slow slew
+ UCHAR AHSchmittInput; // non-zero if AH pins are Schmitt input
+ UCHAR AHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR BLSlowSlew; // non-zero if BL pins have slow slew
+ UCHAR BLSchmittInput; // non-zero if BL pins are Schmitt input
+ UCHAR BLDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR BHSlowSlew; // non-zero if BH pins have slow slew
+ UCHAR BHSchmittInput; // non-zero if BH pins are Schmitt input
+ UCHAR BHDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ // Hardware options
+ UCHAR AIsFifo; // non-zero if interface is 245 FIFO
+ UCHAR AIsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR AIsFastSer; // non-zero if interface is Fast serial
+ UCHAR BIsFifo; // non-zero if interface is 245 FIFO
+ UCHAR BIsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR BIsFastSer; // non-zero if interface is Fast serial
+ UCHAR PowerSaveEnable; // non-zero if using BCBUS7 to save power for self-powered designs
+ // Driver option
+ UCHAR ADriverType; //
+ UCHAR BDriverType; //
+ } FT_EEPROM_2232H, *PFT_EEPROM_2232H;
+
+
+ // FT4232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_4232h {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ // Drive options
+ UCHAR ASlowSlew; // non-zero if A pins have slow slew
+ UCHAR ASchmittInput; // non-zero if A pins are Schmitt input
+ UCHAR ADriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR BSlowSlew; // non-zero if B pins have slow slew
+ UCHAR BSchmittInput; // non-zero if B pins are Schmitt input
+ UCHAR BDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR CSlowSlew; // non-zero if C pins have slow slew
+ UCHAR CSchmittInput; // non-zero if C pins are Schmitt input
+ UCHAR CDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR DSlowSlew; // non-zero if D pins have slow slew
+ UCHAR DSchmittInput; // non-zero if D pins are Schmitt input
+ UCHAR DDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ // Hardware options
+ UCHAR ARIIsTXDEN; // non-zero if port A uses RI as RS485 TXDEN
+ UCHAR BRIIsTXDEN; // non-zero if port B uses RI as RS485 TXDEN
+ UCHAR CRIIsTXDEN; // non-zero if port C uses RI as RS485 TXDEN
+ UCHAR DRIIsTXDEN; // non-zero if port D uses RI as RS485 TXDEN
+ // Driver option
+ UCHAR ADriverType; //
+ UCHAR BDriverType; //
+ UCHAR CDriverType; //
+ UCHAR DDriverType; //
+ } FT_EEPROM_4232H, *PFT_EEPROM_4232H;
+
+
+ // FT232H EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_232h {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ // Drive options
+ UCHAR ACSlowSlew; // non-zero if AC bus pins have slow slew
+ UCHAR ACSchmittInput; // non-zero if AC bus pins are Schmitt input
+ UCHAR ACDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR ADSlowSlew; // non-zero if AD bus pins have slow slew
+ UCHAR ADSchmittInput; // non-zero if AD bus pins are Schmitt input
+ UCHAR ADDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ // CBUS options
+ UCHAR Cbus0; // Cbus Mux control
+ UCHAR Cbus1; // Cbus Mux control
+ UCHAR Cbus2; // Cbus Mux control
+ UCHAR Cbus3; // Cbus Mux control
+ UCHAR Cbus4; // Cbus Mux control
+ UCHAR Cbus5; // Cbus Mux control
+ UCHAR Cbus6; // Cbus Mux control
+ UCHAR Cbus7; // Cbus Mux control
+ UCHAR Cbus8; // Cbus Mux control
+ UCHAR Cbus9; // Cbus Mux control
+ // FT1248 options
+ UCHAR FT1248Cpol; // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
+ UCHAR FT1248Lsb; // FT1248 data is LSB (1) or MSB (0)
+ UCHAR FT1248FlowControl; // FT1248 flow control enable
+ // Hardware options
+ UCHAR IsFifo; // non-zero if interface is 245 FIFO
+ UCHAR IsFifoTar; // non-zero if interface is 245 FIFO CPU target
+ UCHAR IsFastSer; // non-zero if interface is Fast serial
+ UCHAR IsFT1248 ; // non-zero if interface is FT1248
+ UCHAR PowerSaveEnable; //
+ // Driver option
+ UCHAR DriverType; //
+ } FT_EEPROM_232H, *PFT_EEPROM_232H;
+
+
+ // FT X Series EEPROM structure for use with FT_EEPROM_Read and FT_EEPROM_Program
+ typedef struct ft_eeprom_x_series {
+ // Common header
+ FT_EEPROM_HEADER common; // common elements for all device EEPROMs
+ // Drive options
+ UCHAR ACSlowSlew; // non-zero if AC bus pins have slow slew
+ UCHAR ACSchmittInput; // non-zero if AC bus pins are Schmitt input
+ UCHAR ACDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ UCHAR ADSlowSlew; // non-zero if AD bus pins have slow slew
+ UCHAR ADSchmittInput; // non-zero if AD bus pins are Schmitt input
+ UCHAR ADDriveCurrent; // valid values are 4mA, 8mA, 12mA, 16mA
+ // CBUS options
+ UCHAR Cbus0; // Cbus Mux control
+ UCHAR Cbus1; // Cbus Mux control
+ UCHAR Cbus2; // Cbus Mux control
+ UCHAR Cbus3; // Cbus Mux control
+ UCHAR Cbus4; // Cbus Mux control
+ UCHAR Cbus5; // Cbus Mux control
+ UCHAR Cbus6; // Cbus Mux control
+ // UART signal options
+ UCHAR InvertTXD; // non-zero if invert TXD
+ UCHAR InvertRXD; // non-zero if invert RXD
+ UCHAR InvertRTS; // non-zero if invert RTS
+ UCHAR InvertCTS; // non-zero if invert CTS
+ UCHAR InvertDTR; // non-zero if invert DTR
+ UCHAR InvertDSR; // non-zero if invert DSR
+ UCHAR InvertDCD; // non-zero if invert DCD
+ UCHAR InvertRI; // non-zero if invert RI
+ // Battery Charge Detect options
+ UCHAR BCDEnable; // Enable Battery Charger Detection
+ UCHAR BCDForceCbusPWREN; // asserts the power enable signal on CBUS when charging port detected
+ UCHAR BCDDisableSleep; // forces the device never to go into sleep mode
+ // I2C options
+ WORD I2CSlaveAddress; // I2C slave device address
+ DWORD I2CDeviceId; // I2C device ID
+ UCHAR I2CDisableSchmitt; // Disable I2C Schmitt trigger
+ // FT1248 options
+ UCHAR FT1248Cpol; // FT1248 clock polarity - clock idle high (1) or clock idle low (0)
+ UCHAR FT1248Lsb; // FT1248 data is LSB (1) or MSB (0)
+ UCHAR FT1248FlowControl; // FT1248 flow control enable
+ // Hardware options
+ UCHAR RS485EchoSuppress; //
+ UCHAR PowerSaveEnable; //
+ // Driver option
+ UCHAR DriverType; //
+ } FT_EEPROM_X_SERIES, *PFT_EEPROM_X_SERIES;
+
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EEPROM_Read(
+ FT_HANDLE ftHandle,
+ void *eepromData,
+ DWORD eepromDataSize,
+ char *Manufacturer,
+ char *ManufacturerId,
+ char *Description,
+ char *SerialNumber
+ );
+
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EEPROM_Program(
+ FT_HANDLE ftHandle,
+ void *eepromData,
+ DWORD eepromDataSize,
+ char *Manufacturer,
+ char *ManufacturerId,
+ char *Description,
+ char *SerialNumber
+ );
+
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetLatencyTimer(
+ FT_HANDLE ftHandle,
+ UCHAR ucLatency
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetLatencyTimer(
+ FT_HANDLE ftHandle,
+ PUCHAR pucLatency
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetBitMode(
+ FT_HANDLE ftHandle,
+ UCHAR ucMask,
+ UCHAR ucEnable
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetBitMode(
+ FT_HANDLE ftHandle,
+ PUCHAR pucMode
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetUSBParameters(
+ FT_HANDLE ftHandle,
+ ULONG ulInTransferSize,
+ ULONG ulOutTransferSize
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetDeadmanTimeout(
+ FT_HANDLE ftHandle,
+ ULONG ulDeadmanTimeout
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetDeviceInfo(
+ FT_HANDLE ftHandle,
+ FT_DEVICE *lpftDevice,
+ LPDWORD lpdwID,
+ PCHAR SerialNumber,
+ PCHAR Description,
+ LPVOID Dummy
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_StopInTask(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_RestartInTask(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_SetResetPipeRetryCount(
+ FT_HANDLE ftHandle,
+ DWORD dwCount
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_ResetPort(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_CyclePort(
+ FT_HANDLE ftHandle
+ );
+
+
+ //
+ // Win32-type functions
+ //
+
+ FTD2XX_API
+ FT_HANDLE WINAPI FT_W32_CreateFile(
+ LPCTSTR lpszName,
+ DWORD dwAccess,
+ DWORD dwShareMode,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+ DWORD dwCreate,
+ DWORD dwAttrsAndFlags,
+ HANDLE hTemplate
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_CloseHandle(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_ReadFile(
+ FT_HANDLE ftHandle,
+ LPVOID lpBuffer,
+ DWORD nBufferSize,
+ LPDWORD lpBytesReturned,
+ LPOVERLAPPED lpOverlapped
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_WriteFile(
+ FT_HANDLE ftHandle,
+ LPVOID lpBuffer,
+ DWORD nBufferSize,
+ LPDWORD lpBytesWritten,
+ LPOVERLAPPED lpOverlapped
+ );
+
+ FTD2XX_API
+ DWORD WINAPI FT_W32_GetLastError(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_GetOverlappedResult(
+ FT_HANDLE ftHandle,
+ LPOVERLAPPED lpOverlapped,
+ LPDWORD lpdwBytesTransferred,
+ BOOL bWait
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_CancelIo(
+ FT_HANDLE ftHandle
+ );
+
+
+ //
+ // Win32 COMM API type functions
+ //
+ typedef struct _FTCOMSTAT {
+ DWORD fCtsHold : 1;
+ DWORD fDsrHold : 1;
+ DWORD fRlsdHold : 1;
+ DWORD fXoffHold : 1;
+ DWORD fXoffSent : 1;
+ DWORD fEof : 1;
+ DWORD fTxim : 1;
+ DWORD fReserved : 25;
+ DWORD cbInQue;
+ DWORD cbOutQue;
+ } FTCOMSTAT, *LPFTCOMSTAT;
+
+ typedef struct _FTDCB {
+ DWORD DCBlength; /* sizeof(FTDCB) */
+ DWORD BaudRate; /* Baudrate at which running */
+ DWORD fBinary: 1; /* Binary Mode (skip EOF check) */
+ DWORD fParity: 1; /* Enable parity checking */
+ DWORD fOutxCtsFlow:1; /* CTS handshaking on output */
+ DWORD fOutxDsrFlow:1; /* DSR handshaking on output */
+ DWORD fDtrControl:2; /* DTR Flow control */
+ DWORD fDsrSensitivity:1; /* DSR Sensitivity */
+ DWORD fTXContinueOnXoff: 1; /* Continue TX when Xoff sent */
+ DWORD fOutX: 1; /* Enable output X-ON/X-OFF */
+ DWORD fInX: 1; /* Enable input X-ON/X-OFF */
+ DWORD fErrorChar: 1; /* Enable Err Replacement */
+ DWORD fNull: 1; /* Enable Null stripping */
+ DWORD fRtsControl:2; /* Rts Flow control */
+ DWORD fAbortOnError:1; /* Abort all reads and writes on Error */
+ DWORD fDummy2:17; /* Reserved */
+ WORD wReserved; /* Not currently used */
+ WORD XonLim; /* Transmit X-ON threshold */
+ WORD XoffLim; /* Transmit X-OFF threshold */
+ BYTE ByteSize; /* Number of bits/byte, 4-8 */
+ BYTE Parity; /* 0-4=None,Odd,Even,Mark,Space */
+ BYTE StopBits; /* 0,1,2 = 1, 1.5, 2 */
+ char XonChar; /* Tx and Rx X-ON character */
+ char XoffChar; /* Tx and Rx X-OFF character */
+ char ErrorChar; /* Error replacement char */
+ char EofChar; /* End of Input character */
+ char EvtChar; /* Received Event character */
+ WORD wReserved1; /* Fill for now. */
+ } FTDCB, *LPFTDCB;
+
+ typedef struct _FTTIMEOUTS {
+ DWORD ReadIntervalTimeout; /* Maximum time between read chars. */
+ DWORD ReadTotalTimeoutMultiplier; /* Multiplier of characters. */
+ DWORD ReadTotalTimeoutConstant; /* Constant in milliseconds. */
+ DWORD WriteTotalTimeoutMultiplier; /* Multiplier of characters. */
+ DWORD WriteTotalTimeoutConstant; /* Constant in milliseconds. */
+ } FTTIMEOUTS,*LPFTTIMEOUTS;
+
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_ClearCommBreak(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_ClearCommError(
+ FT_HANDLE ftHandle,
+ LPDWORD lpdwErrors,
+ LPFTCOMSTAT lpftComstat
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_EscapeCommFunction(
+ FT_HANDLE ftHandle,
+ DWORD dwFunc
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_GetCommModemStatus(
+ FT_HANDLE ftHandle,
+ LPDWORD lpdwModemStatus
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_GetCommState(
+ FT_HANDLE ftHandle,
+ LPFTDCB lpftDcb
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_GetCommTimeouts(
+ FT_HANDLE ftHandle,
+ FTTIMEOUTS *pTimeouts
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_PurgeComm(
+ FT_HANDLE ftHandle,
+ DWORD dwMask
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_SetCommBreak(
+ FT_HANDLE ftHandle
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_SetCommMask(
+ FT_HANDLE ftHandle,
+ ULONG ulEventMask
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_GetCommMask(
+ FT_HANDLE ftHandle,
+ LPDWORD lpdwEventMask
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_SetCommState(
+ FT_HANDLE ftHandle,
+ LPFTDCB lpftDcb
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_SetCommTimeouts(
+ FT_HANDLE ftHandle,
+ FTTIMEOUTS *pTimeouts
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_SetupComm(
+ FT_HANDLE ftHandle,
+ DWORD dwReadBufferSize,
+ DWORD dwWriteBufferSize
+ );
+
+ FTD2XX_API
+ BOOL WINAPI FT_W32_WaitCommEvent(
+ FT_HANDLE ftHandle,
+ PULONG pulEvent,
+ LPOVERLAPPED lpOverlapped
+ );
+
+
+ //
+ // Device information
+ //
+
+ typedef struct _ft_device_list_info_node {
+ ULONG Flags;
+ ULONG Type;
+ ULONG ID;
+ DWORD LocId;
+ char SerialNumber[16];
+ char Description[64];
+ FT_HANDLE ftHandle;
+ } FT_DEVICE_LIST_INFO_NODE;
+
+ // Device information flags
+ enum {
+ FT_FLAGS_OPENED = 1,
+ FT_FLAGS_HISPEED = 2
+ };
+
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_CreateDeviceInfoList(
+ LPDWORD lpdwNumDevs
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetDeviceInfoList(
+ FT_DEVICE_LIST_INFO_NODE *pDest,
+ LPDWORD lpdwNumDevs
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetDeviceInfoDetail(
+ DWORD dwIndex,
+ LPDWORD lpdwFlags,
+ LPDWORD lpdwType,
+ LPDWORD lpdwID,
+ LPDWORD lpdwLocId,
+ LPVOID lpSerialNumber,
+ LPVOID lpDescription,
+ FT_HANDLE *pftHandle
+ );
+
+
+ //
+ // Version information
+ //
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetDriverVersion(
+ FT_HANDLE ftHandle,
+ LPDWORD lpdwVersion
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetLibraryVersion(
+ LPDWORD lpdwVersion
+ );
+
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Rescan(
+ void
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_Reload(
+ WORD wVid,
+ WORD wPid
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetComPortNumber(
+ FT_HANDLE ftHandle,
+ LPLONG lpdwComPortNumber
+ );
+
+
+ //
+ // FT232H additional EEPROM functions
+ //
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_ReadConfig(
+ FT_HANDLE ftHandle,
+ UCHAR ucAddress,
+ PUCHAR pucValue
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_WriteConfig(
+ FT_HANDLE ftHandle,
+ UCHAR ucAddress,
+ UCHAR ucValue
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_EE_ReadECC(
+ FT_HANDLE ftHandle,
+ UCHAR ucOption,
+ LPWORD lpwValue
+ );
+
+ FTD2XX_API
+ FT_STATUS WINAPI FT_GetQueueStatusEx(
+ FT_HANDLE ftHandle,
+ DWORD *dwRxBytes
+ );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* FTD2XX_H */
+
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdibus.cat b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdibus.cat
new file mode 100644
index 0000000..41c6519
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdibus.cat differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdibus.inf b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdibus.inf
new file mode 100644
index 0000000..516bafb
--- /dev/null
+++ b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdibus.inf
@@ -0,0 +1,131 @@
+; FTDIBUS.INF
+;
+; Copyright 2000-2013 Future Technology Devices International Limited
+;
+; USB serial converter driver installation file for Windows 2000, XP, Server 2003, Vista, Server 2008,
+; Windows 7, Server 2008 R2 and Windows 8 (x86 and x64).
+;
+;
+; THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED ``AS IS'' AND ANY EXPRESS
+; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED
+; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+; THE POSSIBILITY OF SUCH DAMAGE.
+
+; FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
+
+; FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
+
+; IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE RESPONSIBILITY OF
+; THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL RE-CERTIFICATION AS A RESULT OF
+; MAKING THESE CHANGES.
+;
+
+
+[Version]
+Signature="$Windows NT$"
+DriverPackageType=PlugAndPlay
+DriverPackageDisplayName=%DESC%
+Class=USB
+ClassGUID={36fc9e60-c465-11cf-8056-444553540000}
+Provider=%FTDI%
+CatalogFile=ftdibus.cat
+DriverVer=01/18/2013,2.08.28
+
+[SourceDisksNames]
+1=%DriversDisk%,,,
+
+[SourceDisksFiles]
+ftdibus.sys = 1,i386
+ftbusui.dll = 1,i386
+ftd2xx.dll = 1,i386
+FTLang.Dll = 1,i386
+
+[SourceDisksFiles.amd64]
+ftdibus.sys = 1,amd64
+ftbusui.dll = 1,amd64
+ftd2xx64.dll = 1,amd64
+ftd2xx.dll = 1,i386
+FTLang.Dll = 1,amd64
+
+[DestinationDirs]
+FtdiBus.NT.Copy = 10,system32\drivers
+FtdiBus.NT.Copy2 = 10,system32
+FtdiBus.NTamd64.Copy = 10,system32\drivers
+FtdiBus.NTamd64.Copy2 = 10,system32
+FtdiBus.NTamd64.Copy3 = 10,syswow64
+
+
+[Manufacturer]
+%Ftdi%=FtdiHw,NTamd64
+
+[FtdiHw]
+$$DEVICE_NAME$$=FtdiBus.NT,$$HARDWARE_ID$$
+
+[FtdiHw.NTamd64]
+$$DEVICE_NAME$$=FtdiBus.NTamd64,$$HARDWARE_ID$$
+
+[ControlFlags]
+ExcludeFromSelect=*
+
+[FtdiBus.NT]
+CopyFiles=FtdiBus.NT.Copy,FtdiBus.NT.Copy2
+AddReg=FtdiBus.NT.AddReg
+
+[FtdiBus.NTamd64]
+CopyFiles=FtdiBus.NTamd64.Copy,FtdiBus.NTamd64.Copy2,FtdiBus.NTamd64.Copy3
+AddReg=FtdiBus.NT.AddReg
+
+[FtdiBus.NT.Services]
+AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
+
+[FtdiBus.NTamd64.Services]
+AddService = FTDIBUS, 0x00000002, FtdiBus.NT.AddService
+
+[FtdiBus.NT.AddService]
+DisplayName = %SvcDesc%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %10%\system32\drivers\ftdibus.sys
+LoadOrderGroup = Base
+AddReg = FtdiBus.NT.AddService.AddReg
+
+[FtdiBus.NT.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,ftdibus.sys
+HKR,,EnumPropPages32,,"ftbusui.dll,FTBUSUIPropPageProvider"
+
+[FtdiBus.NT.AddService.AddReg]
+;HKR,Parameters,"LocIds",1,31,00,00,00,32,00,00,00,00
+;HKR,Parameters,"RetryResetCount",0x10001,50
+
+
+[FtdiBus.NT.Copy]
+ftdibus.sys
+
+[FtdiBus.NT.Copy2]
+ftbusui.dll
+ftd2xx.dll
+FTLang.dll
+
+[FtdiBus.NTamd64.Copy]
+ftdibus.sys
+
+[FtdiBus.NTamd64.Copy2]
+ftbusui.dll
+ftd2xx.dll,ftd2xx64.dll
+FTLang.dll
+
+[FtdiBus.NTamd64.Copy3]
+ftd2xx.dll
+
+[Strings]
+Ftdi="$$PROVIDER_NAME$$"
+DESC="CDM Driver Package - Bus/D2XX Driver"
+DriversDisk="FTDI USB Drivers Disk"
+SvcDesc="USB Serial Converter Driver"
+ClassName="USB"
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdiport.cat b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdiport.cat
new file mode 100644
index 0000000..63cfe1b
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdiport.cat differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdiport.inf b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdiport.inf
new file mode 100644
index 0000000..1271400
--- /dev/null
+++ b/openocd/drivers/FTDI CDM v2.08.28 Certified/ftdiport.inf
@@ -0,0 +1,167 @@
+; FTDIPORT.INF
+;
+; Copyright 2000-2013 Future Technology Devices International Limited
+;
+; USB serial port driver installation file for Windows 2000, XP, Server 2003, Vista, Server 2008,
+; Windows 7, Server 2008 R2 and Windows 8 (x86 and x64).
+;
+;
+; THIS SOFTWARE IS PROVIDED BY FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED ``AS IS'' AND ANY EXPRESS
+; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+; FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FUTURE TECHNOLOGY DEVICES INTERNATIONAL LIMITED
+; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+; BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+; THE POSSIBILITY OF SUCH DAMAGE.
+
+; FTDI DRIVERS MAY BE USED ONLY IN CONJUNCTION WITH PRODUCTS BASED ON FTDI PARTS.
+
+; FTDI DRIVERS MAY BE DISTRIBUTED IN ANY FORM AS LONG AS LICENSE INFORMATION IS NOT MODIFIED.
+
+; IF A CUSTOM VENDOR ID AND/OR PRODUCT ID OR DESCRIPTION STRING ARE USED, IT IS THE RESPONSIBILITY OF
+; THE PRODUCT MANUFACTURER TO MAINTAIN ANY CHANGES AND SUBSEQUENT WHQL RE-CERTIFICATION AS A RESULT OF
+; MAKING THESE CHANGES.
+;
+
+
+[Version]
+Signature="$Windows NT$"
+DriverPackageType=PlugAndPlay
+DriverPackageDisplayName=%DESC%
+Class=Ports
+ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318}
+Provider=%FTDI%
+CatalogFile=ftdiport.cat
+DriverVer=01/18/2013,2.08.28
+
+[SourceDisksNames]
+1=%DriversDisk%,,,
+
+[SourceDisksFiles]
+ftser2k.sys=1,i386
+ftserui2.dll=1,i386
+ftcserco.dll = 1,i386
+
+[SourceDisksFiles.amd64]
+ftser2k.sys=1,amd64
+ftserui2.dll=1,amd64
+ftcserco.dll = 1,amd64
+
+[DestinationDirs]
+FtdiPort.NT.Copy=10,system32\drivers
+FtdiPort.NT.CopyUI=10,system32
+FtdiPort.NT.CopyCoInst=10,system32
+
+[ControlFlags]
+ExcludeFromSelect=*
+
+[Manufacturer]
+%FTDI%=FtdiHw,NTamd64
+
+[FtdiHw]
+%VID_0403&PID_6001.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6001
+%VID_0403&PID_6010.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6010
+%VID_0403&PID_6011.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6011
+%VID_0403&PID_6014.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6014
+%VID_0403&PID_6015.DeviceDesc%=FtdiPort.NT,FTDIBUS\COMPORT&VID_0403&PID_6015
+
+[FtdiHw.NTamd64]
+%VID_0403&PID_6001.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6001
+%VID_0403&PID_6010.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6010
+%VID_0403&PID_6011.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6011
+%VID_0403&PID_6014.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6014
+%VID_0403&PID_6015.DeviceDesc%=FtdiPort.NTamd64,FTDIBUS\COMPORT&VID_0403&PID_6015
+
+[FtdiPort.NT.AddService]
+DisplayName = %SvcDesc%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %10%\system32\drivers\ftser2k.sys
+LoadOrderGroup = Base
+
+
+; -------------- Serenum Driver install section
+[SerEnum_AddService]
+DisplayName = %SerEnum.SvcDesc%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %12%\serenum.sys
+LoadOrderGroup = PNP Filter
+
+[FtdiPort.NT.AddReg]
+HKR,,EnumPropPages32,,"ftserui2.dll,SerialPortPropPageProvider"
+
+[FtdiPort.NT.Copy]
+ftser2k.sys
+
+[FtdiPort.NT.CopyUI]
+ftserui2.dll
+
+[FtdiPort.NT.CopyCoInst]
+ftcserco.dll
+
+[FtdiPort.NT]
+CopyFiles=FtdiPort.NT.Copy,FtdiPort.NT.CopyUI
+AddReg=FtdiPort.NT.AddReg
+
+[FtdiPort.NTamd64]
+CopyFiles=FtdiPort.NT.Copy,FtdiPort.NT.CopyUI
+AddReg=FtdiPort.NT.AddReg
+
+[FtdiPort.NT.HW]
+AddReg=FtdiPort.NT.HW.AddReg
+
+[FtdiPort.NTamd64.HW]
+AddReg=FtdiPort.NT.HW.AddReg
+
+
+[FtdiPort.NT.Services]
+AddService = FTSER2K, 0x00000002, FtdiPort.NT.AddService
+AddService = Serenum,,SerEnum_AddService
+DelService = FTSERIAL
+
+[FtdiPort.NTamd64.Services]
+AddService = FTSER2K, 0x00000002, FtdiPort.NT.AddService
+AddService = Serenum,,SerEnum_AddService
+DelService = FTSERIAL
+
+
+[FtdiPort.NT.HW.AddReg]
+HKR,,"UpperFilters",0x00010000,"serenum"
+HKR,,"ConfigData",1,11,00,3F,3F,10,27,00,00,88,13,00,00,C4,09,00,00,E2,04,00,00,71,02,00,00,38,41,00,00,9C,80,00,00,4E,C0,00,00,34,00,00,00,1A,00,00,00,0D,00,00,00,06,40,00,00,03,80,00,00,00,00,00,00,D0,80,00,00
+HKR,,"MinReadTimeout",0x00010001,0
+HKR,,"MinWriteTimeout",0x00010001,0
+HKR,,"LatencyTimer",0x00010001,16
+
+
+[FtdiPort.NT.CoInstallers]
+AddReg=FtdiPort.NT.CoInstallers.AddReg
+CopyFiles=FtdiPort.NT.CopyCoInst
+
+[FtdiPort.NTamd64.CoInstallers]
+AddReg=FtdiPort.NT.CoInstallers.AddReg
+CopyFiles=FtdiPort.NT.CopyCoInst
+
+[FtdiPort.NT.CoInstallers.AddReg]
+HKR,,CoInstallers32,0x00010000,"ftcserco.Dll,FTCSERCoInstaller"
+
+
+;---------------------------------------------------------------;
+
+[Strings]
+FTDI="FTDI"
+DESC="CDM Driver Package - VCP Driver"
+DriversDisk="FTDI USB Drivers Disk"
+PortsClassName = "Ports (COM & LPT)"
+VID_0403&PID_6001.DeviceDesc="USB Serial Port"
+VID_0403&PID_6010.DeviceDesc="USB Serial Port"
+VID_0403&PID_6011.DeviceDesc="USB Serial Port"
+VID_0403&PID_6014.DeviceDesc="USB Serial Port"
+VID_0403&PID_6015.DeviceDesc="USB Serial Port"
+SvcDesc="USB Serial Port Driver"
+SerEnum.SvcDesc="Serenum Filter Driver"
+
+
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftbusui.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftbusui.dll
new file mode 100644
index 0000000..98659a1
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftbusui.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftcserco.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftcserco.dll
new file mode 100644
index 0000000..3a28269
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftcserco.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.dll
new file mode 100644
index 0000000..ebd11b5
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.lib b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.lib
new file mode 100644
index 0000000..10cce73
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftd2xx.lib differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftdibus.sys b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftdibus.sys
new file mode 100644
index 0000000..9538b1a
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftdibus.sys differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftlang.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftlang.dll
new file mode 100644
index 0000000..a7b5fa5
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftlang.dll differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftser2k.sys b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftser2k.sys
new file mode 100644
index 0000000..ff7c63a
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftser2k.sys differ
diff --git a/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftserui2.dll b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftserui2.dll
new file mode 100644
index 0000000..3e1a5a3
Binary files /dev/null and b/openocd/drivers/FTDI CDM v2.08.28 Certified/i386/ftserui2.dll differ
diff --git a/openocd/drivers/Interop.CERTENROLLLib.dll b/openocd/drivers/Interop.CERTENROLLLib.dll
new file mode 100644
index 0000000..732156b
Binary files /dev/null and b/openocd/drivers/Interop.CERTENROLLLib.dll differ
diff --git a/openocd/drivers/ST-Link/amd64/WdfCoInstaller01009.dll b/openocd/drivers/ST-Link/amd64/WdfCoInstaller01009.dll
new file mode 100644
index 0000000..1731b96
Binary files /dev/null and b/openocd/drivers/ST-Link/amd64/WdfCoInstaller01009.dll differ
diff --git a/openocd/drivers/ST-Link/amd64/winusbcoinstaller2.dll b/openocd/drivers/ST-Link/amd64/winusbcoinstaller2.dll
new file mode 100644
index 0000000..30e5502
Binary files /dev/null and b/openocd/drivers/ST-Link/amd64/winusbcoinstaller2.dll differ
diff --git a/openocd/drivers/ST-Link/dpinst_amd64.exe b/openocd/drivers/ST-Link/dpinst_amd64.exe
new file mode 100644
index 0000000..1a09e67
Binary files /dev/null and b/openocd/drivers/ST-Link/dpinst_amd64.exe differ
diff --git a/openocd/drivers/ST-Link/dpinst_x86.exe b/openocd/drivers/ST-Link/dpinst_x86.exe
new file mode 100644
index 0000000..abe47e7
Binary files /dev/null and b/openocd/drivers/ST-Link/dpinst_x86.exe differ
diff --git a/openocd/drivers/ST-Link/driver.xml b/openocd/drivers/ST-Link/driver.xml
new file mode 100644
index 0000000..914e49d
--- /dev/null
+++ b/openocd/drivers/ST-Link/driver.xml
@@ -0,0 +1,12 @@
+
+
+
+ ST-Link Driver
+ stlink_dbg_winusb.inf
+ com.sysprogs.libusb.stlink
+
+ STMicroelectronics
+ STMicroelectronics STLink dongle
+
+
+
\ No newline at end of file
diff --git a/openocd/drivers/ST-Link/stlink_VCP.inf b/openocd/drivers/ST-Link/stlink_VCP.inf
new file mode 100644
index 0000000..209c3c2
--- /dev/null
+++ b/openocd/drivers/ST-Link/stlink_VCP.inf
@@ -0,0 +1,74 @@
+
+;
+; Installs the Virtual COM port interface of ST-Link based composite devices.
+;
+
+[Version]
+Signature = "$Windows NT$"
+Class = Ports
+ClassGUID = {4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider = %ManufacturerName%
+CatalogFile.NTx86 = STLinkVCP_x86.cat
+CatalogFile.NTAMD64 = STLinkVCP_x64.cat
+DriverVer=12/10/2013,1.0
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%ManufacturerName% = Standard,NTx86,NTamd64
+
+; List of devices supporting the Virtual COM port (with the corresponding interface ID)
+[Standard.NTx86]
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374A&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374B&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374C&MI_01
+
+[Standard.NTamd64]
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374A&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374B&MI_02
+%DeviceNameVCP% =USB_InstallVCP, USB\VID_0483&PID_374C&MI_01
+
+; ========== Class definition ===========
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,%ClassName%
+HKR,,NoInstallClass,,1
+HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
+HKR,,LowerLogoVersion,,5.2
+
+; =================== Installation ===================
+
+[USB_InstallVCP]
+Include = mdmcpq.inf
+CopyFiles = FakeModemCopyFileSection
+AddReg = USB_InstallVCP.AddReg
+
+[USB_InstallVCP.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[USB_InstallVCP.Services]
+AddService=usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName=%DeviceNameVCP%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\usbser.sys
+
+; [DestinationDirs]
+; If your INF needs to copy files, you must not use the DefaultDestDir directive here.
+; You must explicitly reference all file-list-section names in this section.
+
+; =================== Strings ===================
+
+[Strings]
+ManufacturerName="STMicroelectronics"
+ClassName="Universal Serial Bus devices"
+DeviceNameVCP="STMicroelectronics STLink Virtual COM Port"
+REG_MULTI_SZ = 0x00010000
diff --git a/openocd/drivers/ST-Link/stlink_dbg_winusb.inf b/openocd/drivers/ST-Link/stlink_dbg_winusb.inf
new file mode 100644
index 0000000..740e0c8
--- /dev/null
+++ b/openocd/drivers/ST-Link/stlink_dbg_winusb.inf
@@ -0,0 +1,135 @@
+;
+; Installation INF for the STMicroelectronics STLINK for Windows XP SP2 or later.
+;
+
+[Version]
+Signature = "$Windows NT$"
+Class = STLinkWinUSB
+ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
+Provider = %ManufacturerName%
+CatalogFile.NTx86 = STLinkDbgWinUSB_x86.cat
+CatalogFile.NTAMD64 = STLinkDbgWinUSB_x64.cat
+DriverVer=01/21/2013,1.01
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%ManufacturerName% = Standard,NTx86,NTamd64
+
+[Standard.NTx86]
+%DeviceName% =USB_Install, USB\VID_0483&PID_3748
+%DeviceName% =USB_Install, USB\VID_0483&PID_374A&MI_00
+%DeviceName% =USB_Install, USB\VID_0483&PID_374B&MI_00
+%DeviceNameRW% =USB_InstallRW, USB\VID_0483&PID_374A&MI_01
+
+[Standard.NTamd64]
+%DeviceName% =USB_Install, USB\VID_0483&PID_3748
+%DeviceName% =USB_Install, USB\VID_0483&PID_374A&MI_00
+%DeviceName% =USB_Install, USB\VID_0483&PID_374B&MI_00
+%DeviceNameRW% =USB_InstallRW, USB\VID_0483&PID_374A&MI_01
+
+; ========== Class definition ===========
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,%ClassName%
+HKR,,NoInstallClass,,1
+HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
+HKR,,LowerLogoVersion,,5.2
+
+; =================== Installation ===================
+
+[USB_Install]
+Include = winusb.inf
+Needs = WINUSB.NT
+
+[USB_InstallRW]
+Include = winusb.inf
+Needs = WINUSB.NT
+
+[USB_Install.Services]
+Include =winusb.inf
+Addservice = WinUSB, 0x00000002, WinUSB_ServiceInstall
+
+[USB_InstallRW.Services]
+Include =winusb.inf
+Addservice = WinUSB, 0x00000002, WinUSB_ServiceInstall
+
+[WinUSB_ServiceInstall]
+DisplayName = %WinUSB_SvcDesc%
+ServiceType = 1 ; SERVICE_KERNEL_DRIVER
+StartType = 3 ; SERVICE_DEMAND_START
+ErrorControl = 1 ; SERVICE_ERROR_NORMAL
+ServiceBinary = %12%\WinUSB.sys
+
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[USB_InstallRW.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUsb_Install]
+KmdfLibraryVersion=1.9
+
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[USB_InstallRW.HW]
+AddReg=Dev_AddRegRW
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%STLink_GUID%
+
+[Dev_AddRegRW]
+HKR,,DeviceInterfaceGUIDs,0x10000,%STLink_GUID_RW%
+
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[USB_InstallRW.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[DestinationDirs]
+; If your INF needs to copy files, you must not use the DefaultDestDir directive here.
+; You must explicitly reference all file-list-section names in this section.
+CoInstallers_CopyFiles=11
+
+; ================= Source Media Section =====================
+
+[SourceDisksNames]
+1 = %DISK_NAME%,,,\x86
+2 = %DISK_NAME%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+
+; =================== Strings ===================
+
+[Strings]
+ManufacturerName="STMicroelectronics"
+ClassName="Universal Serial Bus devices"
+DeviceName="STMicroelectronics STLink dongle"
+DeviceNameRW="STMicroelectronics STLink dongle RW"
+WinUSB_SvcDesc="WinUSB Driver for STLink"
+REG_MULTI_SZ = 0x00010000
+DISK_NAME="WinUSB coinstallers sources on disk"
+
+;------------Replace GUID below with custom GUID-------------;
+STLink_GUID="{DBCE1CD9-A320-4b51-A365-A0C3F3C5FB29}"
+STLink_GUID_RW="{8326506F-7260-4854-9C03-26E416F04494}"
diff --git a/openocd/drivers/ST-Link/stlink_winusb_install.bat b/openocd/drivers/ST-Link/stlink_winusb_install.bat
new file mode 100644
index 0000000..392c448
--- /dev/null
+++ b/openocd/drivers/ST-Link/stlink_winusb_install.bat
@@ -0,0 +1,7 @@
+@echo off
+if "%PROCESSOR_ARCHITECTURE%"=="x86" goto X86
+dpinst_amd64.exe
+goto END
+:X86
+dpinst_x86.exe
+:END
diff --git a/openocd/drivers/ST-Link/stlinkdbgwinusb_x64.cat b/openocd/drivers/ST-Link/stlinkdbgwinusb_x64.cat
new file mode 100644
index 0000000..b4e9064
Binary files /dev/null and b/openocd/drivers/ST-Link/stlinkdbgwinusb_x64.cat differ
diff --git a/openocd/drivers/ST-Link/stlinkdbgwinusb_x86.cat b/openocd/drivers/ST-Link/stlinkdbgwinusb_x86.cat
new file mode 100644
index 0000000..3d7e801
Binary files /dev/null and b/openocd/drivers/ST-Link/stlinkdbgwinusb_x86.cat differ
diff --git a/openocd/drivers/ST-Link/stlinkvcp_x64.cat b/openocd/drivers/ST-Link/stlinkvcp_x64.cat
new file mode 100644
index 0000000..e7252bd
Binary files /dev/null and b/openocd/drivers/ST-Link/stlinkvcp_x64.cat differ
diff --git a/openocd/drivers/ST-Link/stlinkvcp_x86.cat b/openocd/drivers/ST-Link/stlinkvcp_x86.cat
new file mode 100644
index 0000000..c76a573
Binary files /dev/null and b/openocd/drivers/ST-Link/stlinkvcp_x86.cat differ
diff --git a/openocd/drivers/ST-Link/x86/WdfCoInstaller01009.dll b/openocd/drivers/ST-Link/x86/WdfCoInstaller01009.dll
new file mode 100644
index 0000000..30e81af
Binary files /dev/null and b/openocd/drivers/ST-Link/x86/WdfCoInstaller01009.dll differ
diff --git a/openocd/drivers/ST-Link/x86/winusbcoinstaller2.dll b/openocd/drivers/ST-Link/x86/winusbcoinstaller2.dll
new file mode 100644
index 0000000..fc450d2
Binary files /dev/null and b/openocd/drivers/ST-Link/x86/winusbcoinstaller2.dll differ
diff --git a/openocd/drivers/UsbDriverTool.exe b/openocd/drivers/UsbDriverTool.exe
new file mode 100644
index 0000000..3f61809
Binary files /dev/null and b/openocd/drivers/UsbDriverTool.exe differ
diff --git a/openocd/drivers/UsbDriverTool.exe.config b/openocd/drivers/UsbDriverTool.exe.config
new file mode 100644
index 0000000..da9f33c
--- /dev/null
+++ b/openocd/drivers/UsbDriverTool.exe.config
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/openocd/drivers/WinUSB/amd64/WdfCoInstaller01009.dll b/openocd/drivers/WinUSB/amd64/WdfCoInstaller01009.dll
new file mode 100644
index 0000000..1731b96
Binary files /dev/null and b/openocd/drivers/WinUSB/amd64/WdfCoInstaller01009.dll differ
diff --git a/openocd/drivers/WinUSB/amd64/winusbcoinstaller2.dll b/openocd/drivers/WinUSB/amd64/winusbcoinstaller2.dll
new file mode 100644
index 0000000..30e5502
Binary files /dev/null and b/openocd/drivers/WinUSB/amd64/winusbcoinstaller2.dll differ
diff --git a/openocd/drivers/WinUSB/driver.xml b/openocd/drivers/WinUSB/driver.xml
new file mode 100644
index 0000000..1001fed
--- /dev/null
+++ b/openocd/drivers/WinUSB/driver.xml
@@ -0,0 +1,8 @@
+
+
+
+ Libusb - WinUSB
+ libusb_device.inf
+ com.sysprogs.libusb.original
+
+
\ No newline at end of file
diff --git a/openocd/drivers/WinUSB/libusb_device.inf b/openocd/drivers/WinUSB/libusb_device.inf
new file mode 100644
index 0000000..1337bf1
--- /dev/null
+++ b/openocd/drivers/WinUSB/libusb_device.inf
@@ -0,0 +1,129 @@
+[Strings]
+
+DeviceName = "$$DEVICE_NAME$$"
+DeviceGUID = "$$DEVICE_GUID$$"
+DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
+Date = "$$TODAY_DATE$$"
+
+ProviderName = "$$PROVIDER_NAME$$"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+DiskName = "libusb (WinUSB) Device Install Disk"
+ClassName = "libusb (WinUSB) devices"
+
+; ====================== Version ======================
+
+[Version]
+DriverVer = %Date%
+Signature = "$Windows NT$"
+Class = %ClassName%
+ClassGuid = %DeviceClassGUID%
+Provider = %ProviderName%
+CatalogFile = libusb_device.cat
+
+; =================== Class section ===================
+
+; Since the device is not a standard USB device, we define a new class for it.
+[ClassInstall32]
+Addreg = WinUSBDeviceClassReg
+
+[WinUSBDeviceClassReg]
+HKR,,,0,%ClassName%
+; -20 is for the USB icon
+HKR,,Icon,,-20
+
+; =========== Manufacturer/Models sections ============
+
+[Manufacturer]
+%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
+
+[libusbDevice_WinUSB.NTx86]
+%DeviceName% = USB_Install, $$HARDWARE_ID$$
+
+[libusbDevice_WinUSB.NTamd64]
+%DeviceName% = USB_Install, $$HARDWARE_ID$$
+
+; ==================== Installation ===================
+
+; The Include and Needs directives in the USB_Install section are required for
+; installing WinUSB on Windows Vista systems. Windows XP systems ignore these
+; directives. These directives should not be modified.
+[USB_Install]
+Include=winusb.inf
+Needs=WINUSB.NT
+
+; The Include directive in the USB_Install.Services section includes the system-
+; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if
+; it is not already on the target system. The AddService directive specifies
+; WinUsb.sys as the devices function driver. These directives should not be
+; modified.
+[USB_Install.Services]
+Include=winusb.inf
+AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
+
+; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys
+; as a service. This section should not be modified.
+[WinUSB_ServiceInstall]
+DisplayName = %WinUSB_SvcDesc%
+ServiceType = 1
+StartType = 3
+ErrorControl = 1
+ServiceBinary = %12%\WinUSB.sys
+
+; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The
+; referenced WinUSB_Install section specifies the KMDF library version.
+; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with
+; xx = major, yyy = minor
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion=1.9
+
+; USB_Install.HW is the key section in the INF. It specifies the device
+; interface globally unique identifier (GUID) for your device. The AddReg
+; directive puts the interface GUID in a standard registry value. When
+; WinUsb.sys is loaded as the devices function driver, it reads the registry
+; value and uses the specified GUID to represent the device interface. You
+; should replace the GUID in this example with one that you create specifically
+; for your device. If the protocols for the device change, you should create a
+; new device interface GUID.
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
+
+; The USB_Install.CoInstallers section, including the referenced AddReg and
+; CopyFiles sections, contains data and instructions to install the WinUSB and
+; KMDF co installers and associate them with the device. Most USB devices can
+; use these sections and directives without modification.
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+CoInstallers_CopyFiles=11
+
+; =============== Source Media Section ================
+
+; The x86 and x64 versions of Windows have separate co installers. This example
+; stores them on the installation disk in folders that are named x86 and amd64
+[SourceDisksNames]
+1 = %DiskName%,,,\x86
+2 = %DiskName%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+
diff --git a/openocd/drivers/WinUSB/libusb_device_multiple_interfaces_0.inf b/openocd/drivers/WinUSB/libusb_device_multiple_interfaces_0.inf
new file mode 100644
index 0000000..b831714
--- /dev/null
+++ b/openocd/drivers/WinUSB/libusb_device_multiple_interfaces_0.inf
@@ -0,0 +1,180 @@
+; ======== libusb 1.0 (WinUSB) device driver ==========
+;
+; To customize this inf file for your own device
+;
+; 1. Change "DeviceName" with the name you want your device to appear with
+; on your system.
+;
+; 2. Change "VendorID" and "ProductID" according to those of your device.
+; If your device is plugged in, you can retrieve these values through the
+; Device Manager (regardless of whether the driver is installed or not).
+;
+; 3. Change "DeviceGUID" to a value that is unique on your system. For more
+; information and tools to help you generate your own GUIDs, see
+; http://en.wikipedia.org/wiki/Universally_Unique_Identifier.
+;
+; 4. Change "DeviceClassGUID" to reflect your USB Device Class.
+; The following Device Classes are listed for reference:
+; {745a17a0-74d3-11d0-b6fe-00a0c90f57da} : HID device
+; {78a1c341-4539-11d3-b88d-00c04fad5171} : Generic WinUSB device
+;
+; 5. (Optional) For a composite device (hardware ID with an MI_## part),
+; change the empty "InterfaceID" string with the "MI_##" string of
+; your device
+;
+; 6. (Optional) Change the "Date" string.
+;
+; Note 1: if you need to create a matching cat file for this inf, you can use
+; the inf2cat utility from the WinDDK, with the the following command:
+; inf2cat /driver:"path_to_your inf" /os:7_X86,7_X64,Vista_X86,Vista_X64
+;
+; Note 2: The co-installers provided in these files are version 1.9.
+; Please refer to:
+; http://blogs.msdn.com/iliast/archive/2008/03/10/why-do-we-need-wdf-coinstallers.aspx and
+; http://blogs.msdn.com/iliast/archive/2009/08/13/wdf-logo-requirements-regarding-coinstallers.aspx
+; for more information about co-installers and their versioning
+
+; ===================== Strings =======================
+
+[Strings]
+
+; =====================================================
+; ========= START USER CONFIGURABLE SECTION ===========
+; =====================================================
+
+DeviceName = "Olimex ARM-USB-TINY (Channel A)"
+; Make sure "VID_" and "PID_" are always part of the strings below
+VendorID = "VID_15ba"
+ProductID = "PID_0004"
+InterfaceID = "MI_00"
+DeviceGUID = "{d35924d6-3e16-4a9e-9782-5524a4b79ba0}"
+DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
+; Date MUST be in MM/DD/YYYY format
+Date = "01/08/2010"
+
+; =====================================================
+; ========== END USER CONFIGURABLE SECTION ============
+; =====================================================
+
+ProviderName = "libusb 1.0"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+DiskName = "libusb (WinUSB) Device Install Disk"
+ClassName = "libusb (WinUSB) devices"
+
+; ====================== Version ======================
+
+[Version]
+DriverVer = %Date%
+Signature = "$Windows NT$"
+Class = %ClassName%
+ClassGuid = %DeviceClassGUID%
+Provider = %ProviderName%
+CatalogFile = libusb_device.cat
+
+; =================== Class section ===================
+
+; Since the device is not a standard USB device, we define a new class for it.
+[ClassInstall32]
+Addreg = WinUSBDeviceClassReg
+
+[WinUSBDeviceClassReg]
+HKR,,,0,%ClassName%
+; -20 is for the USB icon
+HKR,,Icon,,-20
+
+; =========== Manufacturer/Models sections ============
+
+[Manufacturer]
+%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
+
+[libusbDevice_WinUSB.NTx86]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+[libusbDevice_WinUSB.NTamd64]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+; ==================== Installation ===================
+
+; The Include and Needs directives in the USB_Install section are required for
+; installing WinUSB on Windows Vista systems. Windows XP systems ignore these
+; directives. These directives should not be modified.
+[USB_Install]
+Include=winusb.inf
+Needs=WINUSB.NT
+
+; The Include directive in the USB_Install.Services section includes the system-
+; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if
+; it is not already on the target system. The AddService directive specifies
+; WinUsb.sys as the devices function driver. These directives should not be
+; modified.
+[USB_Install.Services]
+Include=winusb.inf
+AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
+
+; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys
+; as a service. This section should not be modified.
+[WinUSB_ServiceInstall]
+DisplayName = %WinUSB_SvcDesc%
+ServiceType = 1
+StartType = 3
+ErrorControl = 1
+ServiceBinary = %12%\WinUSB.sys
+
+; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The
+; referenced WinUSB_Install section specifies the KMDF library version.
+; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with
+; xx = major, yyy = minor
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion=1.9
+
+; USB_Install.HW is the key section in the INF. It specifies the device
+; interface globally unique identifier (GUID) for your device. The AddReg
+; directive puts the interface GUID in a standard registry value. When
+; WinUsb.sys is loaded as the devices function driver, it reads the registry
+; value and uses the specified GUID to represent the device interface. You
+; should replace the GUID in this example with one that you create specifically
+; for your device. If the protocols for the device change, you should create a
+; new device interface GUID.
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
+
+; The USB_Install.CoInstallers section, including the referenced AddReg and
+; CopyFiles sections, contains data and instructions to install the WinUSB and
+; KMDF co installers and associate them with the device. Most USB devices can
+; use these sections and directives without modification.
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+CoInstallers_CopyFiles=11
+
+; =============== Source Media Section ================
+
+; The x86 and x64 versions of Windows have separate co installers. This example
+; stores them on the installation disk in folders that are named x86 and amd64
+[SourceDisksNames]
+1 = %DiskName%,,,\x86
+2 = %DiskName%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+
diff --git a/openocd/drivers/WinUSB/libusb_device_multiple_interfaces_1.inf b/openocd/drivers/WinUSB/libusb_device_multiple_interfaces_1.inf
new file mode 100644
index 0000000..bb09257
--- /dev/null
+++ b/openocd/drivers/WinUSB/libusb_device_multiple_interfaces_1.inf
@@ -0,0 +1,180 @@
+; ======== libusb 1.0 (WinUSB) device driver ==========
+;
+; To customize this inf file for your own device
+;
+; 1. Change "DeviceName" with the name you want your device to appear with
+; on your system.
+;
+; 2. Change "VendorID" and "ProductID" according to those of your device.
+; If your device is plugged in, you can retrieve these values through the
+; Device Manager (regardless of whether the driver is installed or not).
+;
+; 3. Change "DeviceGUID" to a value that is unique on your system. For more
+; information and tools to help you generate your own GUIDs, see
+; http://en.wikipedia.org/wiki/Universally_Unique_Identifier.
+;
+; 4. Change "DeviceClassGUID" to reflect your USB Device Class.
+; The following Device Classes are listed for reference:
+; {745a17a0-74d3-11d0-b6fe-00a0c90f57da} : HID device
+; {78a1c341-4539-11d3-b88d-00c04fad5171} : Generic WinUSB device
+;
+; 5. (Optional) For a composite device (hardware ID with an MI_## part),
+; change the empty "InterfaceID" string with the "MI_##" string of
+; your device
+;
+; 6. (Optional) Change the "Date" string.
+;
+; Note 1: if you need to create a matching cat file for this inf, you can use
+; the inf2cat utility from the WinDDK, with the the following command:
+; inf2cat /driver:"path_to_your inf" /os:7_X86,7_X64,Vista_X86,Vista_X64
+;
+; Note 2: The co-installers provided in these files are version 1.9.
+; Please refer to:
+; http://blogs.msdn.com/iliast/archive/2008/03/10/why-do-we-need-wdf-coinstallers.aspx and
+; http://blogs.msdn.com/iliast/archive/2009/08/13/wdf-logo-requirements-regarding-coinstallers.aspx
+; for more information about co-installers and their versioning
+
+; ===================== Strings =======================
+
+[Strings]
+
+; =====================================================
+; ========= START USER CONFIGURABLE SECTION ===========
+; =====================================================
+
+DeviceName = "Olimex ARM-USB-TINY (Channel B)"
+; Make sure "VID_" and "PID_" are always part of the strings below
+VendorID = "VID_15ba"
+ProductID = "PID_0004"
+InterfaceID = "MI_01"
+DeviceGUID = "{d35924d6-3e16-4a9e-9782-5524a4b79ba1}"
+DeviceClassGUID = "{78a1c341-4539-11d3-b88d-00c04fad5171}"
+; Date MUST be in MM/DD/YYYY format
+Date = "01/08/2010"
+
+; =====================================================
+; ========== END USER CONFIGURABLE SECTION ============
+; =====================================================
+
+ProviderName = "libusb 1.0"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+DiskName = "libusb (WinUSB) Device Install Disk"
+ClassName = "libusb (WinUSB) devices"
+
+; ====================== Version ======================
+
+[Version]
+DriverVer = %Date%
+Signature = "$Windows NT$"
+Class = %ClassName%
+ClassGuid = %DeviceClassGUID%
+Provider = %ProviderName%
+CatalogFile = libusb_device.cat
+
+; =================== Class section ===================
+
+; Since the device is not a standard USB device, we define a new class for it.
+[ClassInstall32]
+Addreg = WinUSBDeviceClassReg
+
+[WinUSBDeviceClassReg]
+HKR,,,0,%ClassName%
+; -20 is for the USB icon
+HKR,,Icon,,-20
+
+; =========== Manufacturer/Models sections ============
+
+[Manufacturer]
+%ProviderName% = libusbDevice_WinUSB,NTx86,NTamd64
+
+[libusbDevice_WinUSB.NTx86]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+[libusbDevice_WinUSB.NTamd64]
+%DeviceName% = USB_Install, USB\%VendorID%&%ProductID%&%InterfaceID%
+
+; ==================== Installation ===================
+
+; The Include and Needs directives in the USB_Install section are required for
+; installing WinUSB on Windows Vista systems. Windows XP systems ignore these
+; directives. These directives should not be modified.
+[USB_Install]
+Include=winusb.inf
+Needs=WINUSB.NT
+
+; The Include directive in the USB_Install.Services section includes the system-
+; supplied INF for WinUSB. This INF is installed by the WinUSB co-installer if
+; it is not already on the target system. The AddService directive specifies
+; WinUsb.sys as the devices function driver. These directives should not be
+; modified.
+[USB_Install.Services]
+Include=winusb.inf
+AddService=WinUSB,0x00000002,WinUSB_ServiceInstall
+
+; The WinUSB_ServiceInstall section contains the data for installing WinUsb.sys
+; as a service. This section should not be modified.
+[WinUSB_ServiceInstall]
+DisplayName = %WinUSB_SvcDesc%
+ServiceType = 1
+StartType = 3
+ErrorControl = 1
+ServiceBinary = %12%\WinUSB.sys
+
+; The KmdfService directive installs WinUsb.sys as a kernel-mode service. The
+; referenced WinUSB_Install section specifies the KMDF library version.
+; Usually, the version can be derived from the WdfCoInstallerxxyyy.dll with
+; xx = major, yyy = minor
+[USB_Install.Wdf]
+KmdfService=WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion=1.9
+
+; USB_Install.HW is the key section in the INF. It specifies the device
+; interface globally unique identifier (GUID) for your device. The AddReg
+; directive puts the interface GUID in a standard registry value. When
+; WinUsb.sys is loaded as the devices function driver, it reads the registry
+; value and uses the specified GUID to represent the device interface. You
+; should replace the GUID in this example with one that you create specifically
+; for your device. If the protocols for the device change, you should create a
+; new device interface GUID.
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%
+
+; The USB_Install.CoInstallers section, including the referenced AddReg and
+; CopyFiles sections, contains data and instructions to install the WinUSB and
+; KMDF co installers and associate them with the device. Most USB devices can
+; use these sections and directives without modification.
+[USB_Install.CoInstallers]
+AddReg=CoInstallers_AddReg
+CopyFiles=CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+CoInstallers_CopyFiles=11
+
+; =============== Source Media Section ================
+
+; The x86 and x64 versions of Windows have separate co installers. This example
+; stores them on the installation disk in folders that are named x86 and amd64
+[SourceDisksNames]
+1 = %DiskName%,,,\x86
+2 = %DiskName%,,,\amd64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll=1
+WdfCoInstaller01009.dll=1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll=2
+WdfCoInstaller01009.dll=2
+
diff --git a/openocd/drivers/WinUSB/x86/WdfCoInstaller01009.dll b/openocd/drivers/WinUSB/x86/WdfCoInstaller01009.dll
new file mode 100644
index 0000000..30e81af
Binary files /dev/null and b/openocd/drivers/WinUSB/x86/WdfCoInstaller01009.dll differ
diff --git a/openocd/drivers/WinUSB/x86/winusbcoinstaller2.dll b/openocd/drivers/WinUSB/x86/winusbcoinstaller2.dll
new file mode 100644
index 0000000..fc450d2
Binary files /dev/null and b/openocd/drivers/WinUSB/x86/winusbcoinstaller2.dll differ
diff --git a/openocd/drivers/WinUSB_Mini/driver.xml b/openocd/drivers/WinUSB_Mini/driver.xml
new file mode 100644
index 0000000..78d1d23
--- /dev/null
+++ b/openocd/drivers/WinUSB_Mini/driver.xml
@@ -0,0 +1,8 @@
+
+
+
+ WinUSB
+ winusb_device.inf
+ com.sysprogs.libusb.mini
+
+
\ No newline at end of file
diff --git a/openocd/drivers/WinUSB_Mini/winusb_device.inf b/openocd/drivers/WinUSB_Mini/winusb_device.inf
new file mode 100644
index 0000000..51a2d2d
--- /dev/null
+++ b/openocd/drivers/WinUSB_Mini/winusb_device.inf
@@ -0,0 +1,57 @@
+[Version]
+Signature = "$Windows NT$"
+Class = USBDevice
+ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
+Provider = %ManufacturerName%
+DriverVer = "$$TODAY_DATE$$"
+CatalogFile = winusb.cat
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%ManufacturerName% = Standard,NTx86,NTamd64
+
+[Standard.NTx86]
+%DeviceName% =USB_Install, $$HARDWARE_ID$$
+
+[Standard.NTamd64]
+%DeviceName% =USB_Install, $$HARDWARE_ID$$
+
+; ========== Class definition ===========
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,%ClassName%
+HKR,,NoInstallClass,,1
+HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
+HKR,,LowerLogoVersion,,5.2
+
+; =================== Installation ===================
+
+[USB_Install]
+Include = winusb.inf
+Needs = WINUSB.NT
+
+[USB_Install.Services]
+Include =winusb.inf
+Needs = WINUSB.NT.Services
+
+[USB_Install.HW]
+AddReg=Dev_AddReg
+
+[Dev_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,"$$DEVICE_GUID$$"
+
+; [DestinationDirs]
+; If your INF needs to copy files, you must not use the DefaultDestDir directive here.
+; You must explicitly reference all file-list-section names in this section.
+
+; =================== Strings ===================
+
+[Strings]
+ManufacturerName="$$PROVIDER_NAME$$"
+ClassName="Universal Serial Bus devices"
+DeviceName="$$DEVICE_NAME$$"
+REG_MULTI_SZ = 0x00010000
diff --git a/openocd/drivers/xds110/driver.xml b/openocd/drivers/xds110/driver.xml
new file mode 100644
index 0000000..d10ff9d
--- /dev/null
+++ b/openocd/drivers/xds110/driver.xml
@@ -0,0 +1,12 @@
+
+
+
+ TI XDS110 Driver
+ xds110_debug.inf
+ com.sysprogs.ti.xds110
+
+ Texas Instruments Incorporated
+ XDS110 Class Debug Probe
+
+
+
\ No newline at end of file
diff --git a/openocd/drivers/xds110/i386/WdfCoInstaller01009.dll b/openocd/drivers/xds110/i386/WdfCoInstaller01009.dll
new file mode 100644
index 0000000..30e81af
Binary files /dev/null and b/openocd/drivers/xds110/i386/WdfCoInstaller01009.dll differ
diff --git a/openocd/drivers/xds110/i386/winusbcoinstaller2.dll b/openocd/drivers/xds110/i386/winusbcoinstaller2.dll
new file mode 100644
index 0000000..fc450d2
Binary files /dev/null and b/openocd/drivers/xds110/i386/winusbcoinstaller2.dll differ
diff --git a/openocd/drivers/xds110/x64/WdfCoInstaller01009.dll b/openocd/drivers/xds110/x64/WdfCoInstaller01009.dll
new file mode 100644
index 0000000..1731b96
Binary files /dev/null and b/openocd/drivers/xds110/x64/WdfCoInstaller01009.dll differ
diff --git a/openocd/drivers/xds110/x64/winusbcoinstaller2.dll b/openocd/drivers/xds110/x64/winusbcoinstaller2.dll
new file mode 100644
index 0000000..30e5502
Binary files /dev/null and b/openocd/drivers/xds110/x64/winusbcoinstaller2.dll differ
diff --git a/openocd/drivers/xds110/xds110_debug.cat b/openocd/drivers/xds110/xds110_debug.cat
new file mode 100644
index 0000000..453ce80
Binary files /dev/null and b/openocd/drivers/xds110/xds110_debug.cat differ
diff --git a/openocd/drivers/xds110/xds110_debug.inf b/openocd/drivers/xds110/xds110_debug.inf
new file mode 100644
index 0000000..08c8a38
--- /dev/null
+++ b/openocd/drivers/xds110/xds110_debug.inf
@@ -0,0 +1,113 @@
+;-------------------------------------------------------------------------
+;
+; XDS110 USB driver installation file.
+;
+; Copyright (c) 2014-2016 Texas Instruments Incorporated.
+; All rights reserved.
+;
+;-------------------------------------------------------------------------
+
+[Version]
+Signature = "$Windows NT$"
+Class = TI_Debug_Probe
+ClassGuid = {8E84F6AE-7786-4c95-A48A-14CF3B92C002}
+Provider = %MFGNAME%
+CatalogFile = xds110_debug.cat
+DriverVer = 04/05/2016,1.7.0.0
+
+; ================== Class section ===================
+
+[ClassInstall32]
+AddReg = ClassInstall_AddReg
+
+[ClassInstall_AddReg]
+HKR,,,,"%TI_Debug_Probe_Name%"
+HKR,,Icon,,-1
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%MFGNAME% = XDS110Device,NTx86,NTamd64
+
+[XDS110Device.NTx86]
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF1&MI_00
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF2&MI_02
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF2&MI_03
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF3&MI_02
+%DESCRIPTION_2% = USB_Install,USB\VID_0451&PID_BEF3&MI_06
+
+[XDS110Device.NTamd64]
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF1&MI_00
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF2&MI_02
+%DESCRIPTION_1% = USB_Install,USB\VID_0451&PID_BEF2&MI_03
+%DESCRIPTION_0% = USB_Install,USB\VID_0451&PID_BEF3&MI_02
+%DESCRIPTION_2% = USB_Install,USB\VID_0451&PID_BEF3&MI_06
+
+; =================== Installation ===================
+
+[USB_Install]
+Include = winusb.inf
+Needs = WINUSB.NT
+
+[USB_Install.Services]
+Include = winusb.inf
+AddService = WinUSB,0x00000002,WinUSB_ServiceInstall
+
+[WinUSB_ServiceInstall]
+DisplayName = %WinUSB_SvcDesc%
+ServiceType = 1
+StartType = 3
+ErrorControl = 1
+ServiceBinary = %12%\WinUSB.sys
+
+[USB_Install.Wdf]
+KmdfService = WINUSB, WinUsb_Install
+
+[WinUSB_Install]
+KmdfLibraryVersion = 1.9
+
+[USB_Install.HW]
+AddReg = XDS110_AddReg
+
+[XDS110_AddReg]
+HKR,,DeviceInterfaceGUIDs,0x10000,"{70cd8e5b-1a46-4418-a1a5-4489f4b4aa79}"
+
+[USB_Install.CoInstallers]
+AddReg = CoInstallers_AddReg
+CopyFiles = CoInstallers_CopyFiles
+
+[CoInstallers_AddReg]
+HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"
+
+[CoInstallers_CopyFiles]
+WinUSBCoInstaller2.dll
+WdfCoInstaller01009.dll
+
+[DestinationDirs]
+DefaultDestDir = 12
+CoInstallers_CopyFiles = 11
+
+; ================= Source Media Section =====================
+
+[SourceDisksNames]
+1 = %DISKNAME%,,,\i386
+2 = %DISKNAME%,,,\x64
+
+[SourceDisksFiles.x86]
+WinUSBCoInstaller2.dll = 1
+WdfCoInstaller01009.dll = 1
+
+[SourceDisksFiles.amd64]
+WinUSBCoInstaller2.dll = 2
+WdfCoInstaller01009.dll = 2
+
+; =================== Strings ===================
+
+[Strings]
+MFGNAME = "Texas Instruments Incorporated"
+DISKNAME = "XDS110 Debug Probe"
+DESCRIPTION_0 = "XDS110 Class Debug Probe"
+DESCRIPTION_1 = "XDS110 Class DFU Interface"
+DESCRIPTION_2 = "XDS110 Class Data Port"
+WinUSB_SvcDesc = "WinUSB Driver Service"
+TI_Debug_Probe_Name = "Texas Instruments Debug Probes"
diff --git a/openocd/drivers/xds110/xds110_ports.cat b/openocd/drivers/xds110/xds110_ports.cat
new file mode 100644
index 0000000..01c693e
Binary files /dev/null and b/openocd/drivers/xds110/xds110_ports.cat differ
diff --git a/openocd/drivers/xds110/xds110_ports.inf b/openocd/drivers/xds110/xds110_ports.inf
new file mode 100644
index 0000000..67f7c8e
--- /dev/null
+++ b/openocd/drivers/xds110/xds110_ports.inf
@@ -0,0 +1,67 @@
+;-------------------------------------------------------------------------
+;
+; XDS110 USB CDC driver installation file.
+;
+; Copyright (c) 2014-2016 Texas Instruments Incorporated.
+; All rights reserved.
+;
+;-------------------------------------------------------------------------
+
+[Version]
+Signature = "$Windows NT$"
+Class = Ports
+ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider = %MFGNAME%
+LayoutFile = layout.inf
+CatalogFile = xds110_ports.cat
+DriverVer = 04/05/2016,1.7.0.0
+
+; ========== Manufacturer/Models sections ===========
+
+[Manufacturer]
+%MFGNAME% = XDS110Device,NTx86,NTamd64
+
+[XDS110Device.NTx86]
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF2&MI_00
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF3&MI_00
+%DESCRIPTION_1% = DriverInstall,USB\VID_0451&PID_BEF3&MI_03
+
+[XDS110Device.NTamd64]
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF2&MI_00
+%DESCRIPTION_0% = DriverInstall,USB\VID_0451&PID_BEF3&MI_00
+%DESCRIPTION_1% = DriverInstall,USB\VID_0451&PID_BEF3&MI_03
+
+; =================== Installation ===================
+
+[DriverInstall]
+CopyFiles = DriverCopyFiles
+AddReg = DriverInstall.AddReg
+
+[DriverCopyFiles]
+usbser.sys,,,0x20
+
+[DriverInstall.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,usbser.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[DriverInstall.Services]
+AddService = usbser, 0x00000002, DriverService
+
+[DriverService]
+DisplayName = %SERVICE%
+ServiceType = 1
+StartType = 3
+ErrorControl = 1
+ServiceBinary = %12%\usbser.sys
+
+[DestinationDirs]
+DefaultDestDir = 12
+
+; =================== Strings ===================
+
+[Strings]
+MFGNAME = "Texas Instruments Incorporated"
+DESCRIPTION_0 = "XDS110 Class Application/User UART"
+DESCRIPTION_1 = "XDS110 Class Auxiliary Data Port"
+SERVICE = "XDS110 Device Serial Ports"
diff --git a/openocd/share/openocd/OpenULINK/ulink_firmware.hex b/openocd/share/openocd/OpenULINK/ulink_firmware.hex
new file mode 100644
index 0000000..efaea58
--- /dev/null
+++ b/openocd/share/openocd/OpenULINK/ulink_firmware.hex
@@ -0,0 +1,347 @@
+:040000000200713257
+:01000B0032C2
+:0100130032BA
+:01001B0032B2
+:0100230032AA
+:01002B0032A2
+:01003300329A
+:01003B003292
+:01004300328A
+:01004B003282
+:01005300327A
+:01005B003272
+:01006300326A
+:03006B000201107F
+:0300CA0002006EC3
+:03006E000201018B
+:1000CD00907F937404F0907F9C7495F0907F96745C
+:1000DD0090F0907F94E4F0907F9D747FF0907F97E7
+:1000ED00E4F0907F957440F0907F9E7442F0907F85
+:1000FD0098E4F0221200CD1204ADD2AF1208E090B8
+:10010D00000022C021C0E0C0F0C082C083C007C083
+:10011D0006C005C004C003C002C001C000C0D07538
+:10012D00D000AF9174EF5FF59112040C907FAB741A
+:10013D0001F0907FB4E04402F0D0D0D000D001D0D7
+:10014D0002D003D004D005D006D007D083D082D002
+:10015D00F0D0E0D02132323232323232323232C04D
+:10016D00E0C082C083C007C0D075D000D201AF916E
+:10017D0074EF5FF591907FA97404F0D0D0D007D0C3
+:10018D0083D082D0E032C0E0C082C083C007C0D02F
+:10019D0075D000D200AF9174EF5FF591907FAA7486
+:1001AD0004F0D0D0D007D083D082D0E032323232BA
+:1001BD0032323232323232AF82747F5FFE24F850E7
+:1001CD0003020278EE240A83F582EE240C83F58374
+:1001DD00E473EFF306192C3F52650101020202028E
+:1001ED000202907FB422EF30E7067DB67E7F800459
+:1001FD007DC67E7F8D828E8322EF30E7067DB87EB1
+:10020D007F80047DC87E7F8D828E8322EF30E7064E
+:10021D007DBA7E7F80047DCA7E7F8D828E8322EFA4
+:10022D0030E7067DBC7E7F80047DCC7E7F8D828E07
+:10023D008322EF30E7067DBE7E7F80047DCE7E7FFC
+:10024D008D828E8322EF30E7067DC07E7F80047D18
+:10025D00D07E7F8D828E8322EF30E7067EC27F7F38
+:10026D0080047ED27F7F8E828F832290000022AF0A
+:10027D008274105FFE74075F4206907FD7EEF074B4
+:10028D00204EF022907FE8E0C322907FE8E0FF60EF
+:10029D0005BF0246800A907FB4E0FF4401F0803A2A
+:1002AD00907FEAE0FEA3E0FF4E7027907FECE0FE2A
+:1002BD00A3E08E821201C4AE82AF83EE4F7002C3F3
+:1002CD00228E828F83E0FD5305FE8E828F83EDF0AB
+:1002DD008008907FB4E0FF4401F0D322907FE8E0E6
+:1002ED00FF6005BF02468010907FEAE0FEA3E0FFAD
+:1002FD00BE0239BF0036D322907FEAE0FEA3E0FFB5
+:10030D004E7027907FECE0FEA3E08E821201C4AE0A
+:10031D0082AF83EE4F7002C3228E828F83E0FD4346
+:10032D0005018E828F83EDF08002C322D322907F50
+:10033D00EAE0A3E0FF907FEAE0FDA3E07E00BF01CD
+:10034D0002800DBF02028021BF030280340203EC44
+:10035D007ED37F138F06907FD4EEF07ED37F137FF5
+:10036D0000907FD5EEF00203EE7EE57F138F0690B1
+:10037D007FD4EEF07EE57F137F00907FD5EEF08089
+:10038D0060907FECE0FEA3E0FF4E70187E057F14B9
+:10039D008F06907FD4EEF07E057F147F00907FD581
+:1003AD00EEF0803D907FECE0FEA3E0FFBE092EBF96
+:1003BD00042BED1475F002A42459F582741435F054
+:1003CD00F583E493FEA3E493FF8E048F058D0490D3
+:1003DD007FD4ECF07F00907FD5EEF08004C322C374
+:1003ED0022D32275828212027C75820212027C90C7
+:1003FD007FB87402F0907FC8E4F0907FC9F022902E
+:10040D007FE9E0FF24F3500122EFF5F0240B83F593
+:10041D0082E5F0241183F583E473414F5D655D72D0
+:10042D007B73889899A9AC0404040404040404049F
+:10043D0004040404120291500122907FB4E044019F
+:10044D00F022120297500122907FB4E04401F02275
+:10045D00907FB4E04401F0221202E94042907FB453
+:10046D00E04401F02222907FB4E04401F022120317
+:10047D003B402C907FB4E04401F0229013EAE493CA
+:10048D00907F00F0907FB57401F022229013F0E47C
+:10049D0093907F00F0907FB57401F0221203F0224B
+:1004AD00907FDE7404F0907FDF7404F0907FE0E4C1
+:1004BD00F0907FE1F0907FA17401F0907FAFE04468
+:1004CD0001F0907FAEE04401F0907FAD7404F090A8
+:1004DD007FAC7404F0D2E8907FD6740AF09000C817
+:0A04ED0012137C907FD67406F022F3
+:1013D30012011001FFFFFF4051C21027000101025B
+:1013E3000301090220000101048032090400000204
+:1013F300FFFFFF00070582024000000705020240CD
+:1014030000000403090414034F00700065006E001C
+:1014130055004C0049004E004B0014034F00700070
+:1014230065006E0055004C0049004E004B000E0352
+:101433003000300030003000300031001A034A0021
+:101443005400410047002000410064006100700027
+:0E14530074006500720009141D1431143F145A
+:1004F700E5080424C0F582E4347DF583E0FF30E1AC
+:1005070008907F96E0FE54EFF08F06EE30E00890FB
+:100517007F96E0FE547FF0EF30E308907F96E0FE91
+:100527004410F0EF30E208907F96E0FF4480F0221D
+:100537007F00E50824C0F582E4347DF583E0FE24DE
+:10054700D550030208A6EE240A83F582EE242F83F2
+:10055700F583E473B18AD7B0FAD3A6A6A6A6A6A652
+:10056700A6A6A6A6A6A6A6A6A6A6A6A6A6A6A6A624
+:10057700A6A6A6A621FA512A639CD5053493A205FF
+:1005870006050605060808080808080808080808F0
+:1005970008080808080808080808080808080806D6
+:1005A700060607070707080808087E05E508042464
+:1005B700C0F582E4347DF583E0FFE50804F5828524
+:1005C7000927C007C00612091DD006D0070208A8D0
+:1005D700E5080424C0F582E4347DF583E02405FEB4
+:1005E700E50804F582C007C006120BDED006D00767
+:1005F7000208A8E5080424C0F582E4347DF583E009
+:10060700FF2405FEE50804F58285093CC007C006FE
+:10061700120E79D006D0070208A87E02E508042446
+:10062700C0F582E4347DF583E0FD7402250824C01B
+:10063700F582E4347DF583E0F50A8D82C007C006B4
+:1006470012124AD006D0070208A87E02E508042441
+:10065700C0F582E4347DF583E0FC7D007402250853
+:1006670024C0F582E4347DF583E0FAE44204EA42EB
+:10067700058C828D83C007C0061211DDD006D00716
+:100687000208A87E05E5080424C0F582E4347DF558
+:1006970083E0FFE50804F58285092DC007C006122F
+:1006A7000A67D006D0070208A8E5080424C0F58227
+:1006B700E4347DF583E02405FEE50804F582C007F0
+:1006C700C006120D14D006D0070208A8E5080424B6
+:1006D700C0F582E4347DF583E0FF2405FEE50804D8
+:1006E700F582850943C007C006121013D006D0074C
+:1006F7000208A87E02E5080424C0F582E4347DF5EB
+:1007070083E0FB7402250824C0F582E4347DF58379
+:10071700E0F50A8B82C007C006121281D006D00707
+:100727000208A87E02E5080424C0F582E4347DF5BA
+:1007370083E0FC7D007402250824C0F582E4347D43
+:10074700F583E0FAE44204EA42058C828D83C00710
+:10075700C006121207D006D0070208A87E02E508D5
+:100767000424C0F582E4347DF583E0FC7D00740247
+:10077700250824C0F582E4347DF583E0FAE44204D9
+:10078700EA42058C828D83C007C006121349D00642
+:10079700D0070208A87E02E5080424C0F582E434E5
+:1007A7007DF583E0FC7D007402250824C0F582E412
+:1007B700347DF583E0FAE44204EA42058C828D83B6
+:1007C700C007C00612137CD006D0070208A87E0017
+:1007D7007F02C007C0061212CEAC82AD83D006D00E
+:1007E7000785098275837E8D03EBF0E509042400F4
+:1007F700F582E4347EF5837D00ECF00208A87E02E2
+:10080700E5080424C0F582E4347DF583E0FD740235
+:10081700250824C0F582E4347DF583E0F50A8D824E
+:10082700C007C006121311D006D00780747E05E5F5
+:10083700080424C0F582E4347DF583E0FD740225C5
+:100847000824C0F582E4347DF583E0F50A740325B6
+:100857000824C0F582E4347DF583E0F50B740425A4
+:100867000824C0F582E4347DF583E0F50C74052592
+:100877000824C0F582E4347DF583E0F50D8D82C050
+:1008870007C006121329D006D00780157E01C007BE
+:10089700C0061204F7D006D00780067E0180027ECC
+:1008A70000EF2509F509AD087F008E037C00EB2DCD
+:1008B700FDEC3FFF0DBD00010F907FC9E0FC7B0001
+:1008C700C3ED9CEF64808BF063F08095F04002D31A
+:1008D70022EE042508F508C32275080075090010E3
+:1008E700000280FB907F96E0FF547FF0C202200257
+:1008F70007120537920280F6907F96E0FF4480F05A
+:10090700E509600B907FB9E509F010010280FB90C3
+:100917007FC9E4F080C3E582FF24C0F582E4347D1B
+:10092700F583E0F528EF0424C0F582E4347DF583F0
+:10093700E0F52974022FFC24C0F582E4347DF583A9
+:10094700E0C4540FFB53030FEC24C0F582E4347D5D
+:10095700F583E0FC740F5CF52A74032F24C0F5823D
+:10096700E4347DF583E0FA74042F24C0F582E4347F
+:100977007DF583E0F52BEB60078A0A8B8212124A1A
+:10098700907F97E0FB5303F874044BFA7900A8288B
+:100997007C0018B8FF011C89067F00C3EE98EF643E
+:1009A700808CF063F08095F050347F007E00907F5C
+:1009B70097EBF0EFC313FF907F97EAF0907F99E0F2
+:1009C700FC30E5034307800EBE080040E1E5272918
+:1009D7002400F582E4347EF583EFF00980B0892C9A
+:1009E7007F00AC2A7A00C3EA95295040A8297900EC
+:1009F70018B8FF01198A057E00EDB50011EEB501A3
+:100A07000DEC600A4303021CE52BC313F52B907F03
+:100A170097EBF0EFC313FF907F9774044BF0907F31
+:100A270099E0FE30E5034307800A80BAAD297E00CE
+:100A37007408C39DFDE49EFE8DF005F0EF8002C3B0
+:100A470013D5F0FBFFE527252C2400F582E4347E3F
+:100A5700F583EFF0EC6008852B0A8C8202124A229C
+:100A6700E582FF24C0F582E4347DF583E0F52EEFBF
+:100A77000424C0F582E4347DF583E0F52F74022F5A
+:100A8700FC24C0F582E4347DF583E0C4540FFB53A6
+:100A9700030FEC24C0F582E4347DF583E0FC740F8A
+:100AA7005CF53074032F24C0F582E4347DF583E0D0
+:100AB700FA74042F24C0F582E4347DF583E0F53120
+:100AC700EB60078A0A8B82121281907F97E0FB53B3
+:100AD70003F874044BFA753200A82E7C0018B8FF8F
+:100AE700011CA9327E00C3E998EE64808CF063F0A4
+:100AF7008095F0504C7E007C00907F97EBF079005A
+:100B0700C3E9952250030980F7EEC313FE907F9740
+:100B1700EAF07900C3E9952250030980F7907F999D
+:100B2700E0F930E5034306800CBC080040CBE52D17
+:100B370025322400F582E4347EF583EEF005328019
+:100B4700987E00AA307900C3E9952F5056A82F7CCC
+:100B57000018B8FF011C89057F00EDB50011EFB53E
+:100B6700040DEA600A4303021AE531C313F5319015
+:100B77007F97EBF07F00C3EF952250030F80F7EECE
+:100B8700C313FE907F9774044BF07F00C3EF952249
+:100B970050030F80F7907F99E0FF30E5034306800D
+:100BA7000980A4AD2F7F007408C39DFDE49FFF8DCE
+:100BB700F005F0EE8002C313D5F0FBFEE52D2532DC
+:100BC7002400F582E4347EF583EEF0EA600885318F
+:100BD7000A8A8202128122E582FF24C0F582E43468
+:100BE7007DF583E0F533EF0424C0F582E4347DF529
+:100BF70083E0F53474022FFC24C0F582E4347DF5DC
+:100C070083E0C4540FFB53030FEC24C0F582E43494
+:100C17007DF583E0FC740F5CF53574032F24C0F574
+:100C270082E4347DF583E0FA74042F24C0F582E46E
+:100C3700347DF583E0F536EB600B8A0A8B82C007BB
+:100C470012124AD007907F97E0FB5303F97A00A866
+:100C5700337C0018B8FF011C8A017E00C3E998EEB7
+:100C670064808CF063F08095F05039EF2A240524D6
+:100C7700C0F582E4347DF583E0FE7C00EE30E005CC
+:100C870043030180068B0174FE59FB907F97EBF0BD
+:100C9700EEC313FE907F9774044BF00CBC08004022
+:100CA700DB0A80ABEF2A240524C0F582E4347DF506
+:100CB70083E0FEAF357C00C3EC95345044EE30E062
+:100CC7000543030180068B0274FE5AFBA9347A00A0
+:100CD70019B9FF011A8C007D00E8B50111EDB502C5
+:100CE7000DEF600A4303021FE536C313F536907F05
+:100CF70097EBF0EEC313FE907F9774044BF00C80D4
+:100D0700B6EF600885360A8F8202124A22E582F51D
+:100D17003724C0F582E4347DF583E0F538E5370400
+:100D270024C0F582E4347DF583E0F5397402253774
+:100D3700FC24C0F582E4347DF583E0C4540FFB53F3
+:100D4700030FEC24C0F582E4347DF583E0FC740FD7
+:100D57005CF53A7403253724C0F582E4347DF583C6
+:100D6700E0FA7404253724C0F582E4347DF583E086
+:100D7700F53BEB60078A0A8B82121281907F97E01E
+:100D8700FB5303F97A00A8387C0018B8FF011C8AC6
+:100D9700067F00C3EE98EF64808CF063F08095F0D7
+:100DA7005050E5372A240524C0F582E4347DF583C5
+:100DB700E0FF7E00EF30E00543030180068B0474FB
+:100DC700FE5CFB907F97EBF07C00C3EC9523500310
+:100DD7000C80F7EFC313FF907F9774044BF07C00F0
+:100DE700C3EC952350030C80F70EBE080040C50ADC
+:100DF7008094E5372A240524C0F582E4347DF58301
+:100E0700E0FFAE3A7C00C3EC9539505AEF30E0056D
+:100E170043030180068B0274FE5AFBA8397A001837
+:100E2700B8FF011A8C017D00E9B50011EDB5020D7F
+:100E3700EE600A4303021EE53BC313F53B907F9721
+:100E4700EBF07D00C3ED952350030D80F7EFC3133F
+:100E5700FF907F9774044BF07D00C3ED95235003FB
+:100E67000D80F70C80A0EE6008853B0A8E82021287
+:100E77008122E582FF24C0F582E4347DF583E0F525
+:100E87003DEF0424C0F582E4347DF583E0F53E743C
+:100E9700022FFC24C0F582E4347DF583E0C4540FAF
+:100EA700FB53030FEC24C0F582E4347DF583E0FCAB
+:100EB700740F5CF53F74032F24C0F582E4347DF58D
+:100EC70083E0FA74042F24C0F582E4347DF583E0CF
+:100ED700F540EB600B8A0A8B82C00712124AD007D3
+:100EE700907F97E0FB5303F97A00A83D7C0018B880
+:100EF700FF011C8A017E00C3E998EE64808CF063D1
+:100F0700F08095F0505CEF2A240524C0F582E43484
+:100F17007DF583E0F5417C007900E54130E005434C
+:100F2700030180068B0074FE58FB907F97EBF0E57A
+:100F370041C313F541907F9774044BF0ECC313FC46
+:100F4700907F99E0F830E50343048009B908004031
+:100F5700C9E53C2A2400F582E4347EF583ECF00AE7
+:100F670080888A01EF2A240524C0F582E4347DF5C0
+:100F770083E0F5417C00AF3F754200C3E542953EF3
+:100F87005057E54130E00543030180068B0074FEAE
+:100F970058FBA83E7D0018B8FF011DAA427E00EA53
+:100FA700B50011EEB5050DEF600A4303021FE540DA
+:100FB700C313F540907F97EBF0E541C313F54190DC
+:100FC7007F9774044BF0ECC313FC907F99E0FE30DD
+:100FD700E503430480054280A2AD3E7E007408C34A
+:100FE7009DFDE49EFE8DF005F0EC8002C313D5F065
+:100FF700FBFCE53C292400F582E4347EF583ECF024
+:10100700EF600885400A8F8202124A22E582F54482
+:1010170024C0F582E4347DF583E0F545E5440424F6
+:10102700C0F582E4347DF583E0F54674022544FC7F
+:1010370024C0F582E4347DF583E0C4540FFB5303E9
+:101047000FEC24C0F582E4347DF583E0FC740F5C7B
+:10105700F5477403254424C0F582E4347DF583E025
+:10106700FA7404254424C0F582E4347DF583E0F561
+:1010770048EB60078A0A8B82121281907F97E0FB08
+:101087005303F97A00A8457C0018B8FF011C8A06AB
+:101097007F00C3EE98EF64808CF063F08095F0508A
+:1010A70074E5442A240524C0F582E4347DF583E001
+:1010B700F5497E007C00E54930E0054303018006E1
+:1010C7008B0074FE58FB907F97EBF07800C3E89590
+:1010D7002450030880F7E549C313F549907F9774B7
+:1010E700044BF07800C3E8952450030880F7EEC35B
+:1010F70013FE907F99E0F830E5034306800CBC08A7
+:101107000040B3E5432A2400F582E4347EF583EEFC
+:10111700F00A02108C8A04E5442A240524C0F582CB
+:10112700E4347DF583E0F5497E00AA47754A00C39C
+:10113700E54A9546506DE54930E0054303018006D1
+:101147008B0174FE59FBA9467D0019B9FF011DA843
+:101157004A7F00E8B50111EFB5050DEA600A4303C0
+:10116700021AE548C313F548907F97EBF07F00C359
+:10117700EF952450030F80F7E549C313F549907F96
+:101187009774044BF07F00C3EF952450030F80F74B
+:10119700EEC313FE907F99E0FF30E5034306800519
+:1011A7004A808CAD467F007408C39DFDE49FFF8D88
+:1011B700F005F0EE8002C313D5F0FBFEE5432C24C7
+:1011C70000F582E4347EF583EEF0EA600885480A8C
+:1011D7008A8202128122AE82AF83907F97E0FD530D
+:1011E70005FB74044DFC7A007B00C3EA9EEB9F501D
+:1011F7000E907F97EDF0ECF00ABA00EE0B80EB2231
+:10120700AE82AF83907F97E0FD5305FB74044DFCDE
+:101217007A007B00C3EA9EEB9F5027907F97EDF003
+:101227007900C3E9952550030980F7907F97ECF083
+:101237007900C3E9952550030980F70ABA00D50B51
+:1012470080D222AF82907F97E0FE5306FB7D00C3DA
+:10125700ED9F5025E50A30E00543060280068E041F
+:1012670074FD5CFE907F97EEF0E50AC313F50A90D4
+:101277007F9774044EF00D80D622AF82907F97E05F
+:10128700FE5306FB7D00C3ED9F503BE50A30E005AA
+:1012970043060280068E0474FD5CFE907F97EEF095
+:1012A7007C00C3EC952650030C80F7E50AC313F5C1
+:1012B7000A907F9774044EF07C00C3EC9526500388
+:1012C7000C80F70D80C0227F00907F99E0FE30E50B
+:1012D700027F01907F99E0FE30E603430702907F8B
+:1012E7009AE0FE30E703430704907F9BE0FE30E57A
+:1012F70003430708907F9AE0FE53067F8F05E4FFBC
+:10130700FCEE4FF582EC4DF58322E582547FF4FF26
+:10131700907F97E05FF0747F550AFF907F97E04FCB
+:10132700F022858222850A23850B24850C25850DCD
+:10133700262200227E567F021EBEFF011FEE4F703F
+:10134700F722750A05750B001213A6AE82AF837CD0
+:10135700007D00C3EC9EED9F501AC007C006C00574
+:10136700C004121339D004D005D006D0070CBC0036
+:10137700E20D80DF22AE82AF837C007D00C3EC9E4E
+:10138700ED9F501AC007C006C005C00412133BD01A
+:0F13970004D005D006D0070CBC00E20D80DF2289
+:03004300021B009D
+:101B0000020110000201630002016400020165008D
+:101B1000020166000201670002016800020169001B
+:101B200002016A0002016B0002016C0002019300D5
+:101B30000201BA000201BB000201BC000201BD00AB
+:101B40000201BE000201BF000201C0000201C1008B
+:081B50000201C2000201C30002
+:1013A6007A10E4FBFCE58225E0F582E58333F583DC
+:1013B600EB33FBEC33FCEB950AF5F0EC950B4006B2
+:0913C600FCABF0438201DADD22E8
+:0600A000E478FFF6D8FD34
+:10007E007900E94400601B7A009014617800759253
+:10008E0020E493F2A308B800020592D9F4DAF275CF
+:02009E0092FFCF
+:1000A6007800E84400600A7900759220E4F309D8E4
+:1000B600FC7800E84400600C7900902000E4F0A38E
+:0400C600D8FCD9FA8F
+:0D00710075814A1213CFE582600302006E14
+:0413CF007582002201
+:00000001FF
diff --git a/openocd/share/openocd/contrib/60-openocd.rules b/openocd/share/openocd/contrib/60-openocd.rules
new file mode 100644
index 0000000..da760f8
--- /dev/null
+++ b/openocd/share/openocd/contrib/60-openocd.rules
@@ -0,0 +1,145 @@
+# Copy this file to /etc/udev/rules.d/
+
+ACTION!="add|change", GOTO="openocd_rules_end"
+SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
+
+# Please keep this list sorted by VID:PID
+
+# opendous and estick
+ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT232/FT245 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT2232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT4232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Original FT232H VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# DISTORTEC JTAG-lock-pick Tiny 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TUMPA, TUMPA Lite
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# XDS100v2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI/Luminary Stellaris Evaluation Board FTDI (several)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# egnite Turtelizer 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Section5 ICEbear
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Amontec JTAGkey and JTAGkey-tiny
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI ICDI
+ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# STLink v1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# STLink v2
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# STLink v2-1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Cypress KitProg in KitProg mode
+ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f139", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Cypress KitProg in CMSIS-DAP mode
+ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="f138", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Hilscher NXHX Boards
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Hitex STR9-comStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Hitex STM32-PerformanceStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Altera USB Blaster
+ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Amontec JTAGkey-HiSpeed
+ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# SEGGER J-Link
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="660", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Raisonance RLink
+ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Debug Board for Neo1973
+ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD-TINY
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-JTAG-EW
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD-TINY-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Olimex ARM-USB-OCD-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# USBprog with OpenOCD firmware
+ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
+ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Ambiq Micro EVK and Debug boards.
+ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev", TAG+="uaccess"
+ATTRS{idVendor}=="2aec", ATTRS{idProduct}=="1106", MODE="664", GROUP="plugdev", TAG+="uaccess"
+
+# Marvell Sheevaplug
+ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# Keil Software, Inc. ULink
+ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+# CMSIS-DAP compatible adapters
+ATTRS{product}=="*CMSIS-DAP*", MODE="660", GROUP="plugdev", TAG+="uaccess"
+
+LABEL="openocd_rules_end"
diff --git a/openocd/share/openocd/contrib/99-openocd.rules b/openocd/share/openocd/contrib/99-openocd.rules
new file mode 100644
index 0000000..057c4b7
--- /dev/null
+++ b/openocd/share/openocd/contrib/99-openocd.rules
@@ -0,0 +1,134 @@
+# Copy this file to /etc/udev/rules.d/
+
+ACTION!="add|change", GOTO="openocd_rules_end"
+SUBSYSTEM!="usb|tty|hidraw", GOTO="openocd_rules_end"
+
+# Please keep this list sorted by VID:PID
+
+# opendous and estick
+ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="204f", MODE="664", GROUP="plugdev"
+
+# Original FT232/FT245 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="664", GROUP="plugdev"
+
+# Original FT2232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev"
+
+# Original FT4232 VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6011", MODE="664", GROUP="plugdev"
+
+# Original FT232H VID:PID
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", MODE="664", GROUP="plugdev"
+
+# DISTORTEC JTAG-lock-pick Tiny 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8220", MODE="664", GROUP="plugdev"
+
+# TUMPA, TUMPA Lite
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a98", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="8a99", MODE="664", GROUP="plugdev"
+
+# XDS100v2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="a6d0", MODE="664", GROUP="plugdev"
+
+# Xverve Signalyzer Tool (DT-USB-ST), Signalyzer LITE (DT-USB-SLITE)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca0", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bca1", MODE="664", GROUP="plugdev"
+
+# TI/Luminary Stellaris Evaluation Board FTDI (several)
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcd9", MODE="664", GROUP="plugdev"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface FTDI (ICDI) Board
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bcda", MODE="664", GROUP="plugdev"
+
+# egnite Turtelizer 2
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="bdc8", MODE="664", GROUP="plugdev"
+
+# Section5 ICEbear
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c140", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="c141", MODE="664", GROUP="plugdev"
+
+# Amontec JTAGkey and JTAGkey-tiny
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="cff8", MODE="664", GROUP="plugdev"
+
+# TI ICDI
+ATTRS{idVendor}=="0451", ATTRS{idProduct}=="c32a", MODE="664", GROUP="plugdev"
+
+# STLink v1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="664", GROUP="plugdev"
+
+# STLink v2
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="664", GROUP="plugdev"
+
+# STLink v2-1
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE="664", GROUP="plugdev"
+
+# Hilscher NXHX Boards
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="0028", MODE="664", GROUP="plugdev"
+
+# Hitex STR9-comStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002c", MODE="664", GROUP="plugdev"
+
+# Hitex STM32-PerformanceStick
+ATTRS{idVendor}=="0640", ATTRS{idProduct}=="002d", MODE="664", GROUP="plugdev"
+
+# Altera USB Blaster
+ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="664", GROUP="plugdev"
+
+# Amontec JTAGkey-HiSpeed
+ATTRS{idVendor}=="0fbb", ATTRS{idProduct}=="1000", MODE="664", GROUP="plugdev"
+
+# SEGGER J-Link
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0102", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0103", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0104", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0105", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0107", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0108", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1010", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1011", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1012", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1013", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1014", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1015", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1016", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1017", MODE="664", GROUP="plugdev"
+ATTRS{idVendor}=="1366", ATTRS{idProduct}=="1018", MODE="664", GROUP="plugdev"
+
+# Raisonance RLink
+ATTRS{idVendor}=="138e", ATTRS{idProduct}=="9000", MODE="664", GROUP="plugdev"
+
+# Debug Board for Neo1973
+ATTRS{idVendor}=="1457", ATTRS{idProduct}=="5118", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0003", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-TINY
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="0004", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-JTAG-EW
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="001e", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-TINY-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002a", MODE="664", GROUP="plugdev"
+
+# Olimex ARM-USB-OCD-H
+ATTRS{idVendor}=="15ba", ATTRS{idProduct}=="002b", MODE="664", GROUP="plugdev"
+
+# USBprog with OpenOCD firmware
+ATTRS{idVendor}=="1781", ATTRS{idProduct}=="0c63", MODE="664", GROUP="plugdev"
+
+# TI/Luminary Stellaris In-Circuit Debug Interface (ICDI) Board
+ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="664", GROUP="plugdev"
+
+# Marvell Sheevaplug
+ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", MODE="664", GROUP="plugdev"
+
+# Keil Software, Inc. ULink
+ATTRS{idVendor}=="c251", ATTRS{idProduct}=="2710", MODE="664", GROUP="plugdev"
+
+# CMSIS-DAP compatible adapters
+ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"
+
+LABEL="openocd_rules_end"
diff --git a/openocd/share/openocd/contrib/coresight-trace.txt b/openocd/share/openocd/contrib/coresight-trace.txt
new file mode 100644
index 0000000..c093c20
--- /dev/null
+++ b/openocd/share/openocd/contrib/coresight-trace.txt
@@ -0,0 +1,68 @@
++OpenOCD and CoreSight Tracing
++
+Many recent ARM chips (Using e..g. Cortex-M3 and
+Cortex-M4 cores) support CoreSight debug/trace.
+This note sketches an approach currently planned for those cores
+with OpenOCD.
+
+ This tracing data can help debug and tune ARM software, but not
+all cores support tracing. Some support more extensive tracing
+other cores with trace support +should be able to use the same
+approach and maybe some of the same analysis code.
+
++the Cortex-M3 is assumed here to be the
++core in use, for simplicity and to reflect current OpenOCD users.
+
+
+This note summarizes a software model to generate, collect, and
+analyze such trace data . That is not fully implemented as of early
+January 2011, +and thus is not *yet* usable.
++
++
++Some microcontroller cores support a low pin-count Single-wire trace,
+with a mode where +trace data is emitted (usually to a UART. To use
+this mode, +SWD must be in use.
++At this writing, OpenOCD SWD support is not yet complete either.
+
+(There are also multi-wire trace ports requiring more complex debug
+adapters than OpenOCD currently supports, and offering richer data.
++
++
++* ENABLING involves activating SWD and (single wire) trace.
++
++current expectations are that OpenOCD itself will handle enabling;
+activating single wire trace involves a debug adapter interaction, and
+collecting that trace data requires particular (re)wiring.
++
++* CONFIGURATION involves setting up ITM and/or ETM modules to emit the
++desired data from the Cortex core. (This might include dumping
++event counters printf-style messages; code profiling; and more. Not all
++cores offer the same trace capabilities.
++
++current expectations are that Tcl scripts will be used to configure these
++modules for the desired tracing, by direct writes to registers. In some
++cases (as with RTOS event tracking and similar messaging, this might
++be augmented or replaced by user code running on the ARM core.
++
++COLLECTION involves reading that trace data, probably through UART, and
++saving it in a useful format to analyse For now, deferred analysis modes
+are assumed, not than real-time or interactive ones.
++
++
++current expectations are to to dump data in text using contrib/itmdump.c
++or derived tools, and to post-process it into reports. Such reports might
++include program messaging (such as application data streams via ITM, maybe
++using printf type messaging; code coverage analysis or so forth. Recent
++versions of CMSIS software reserve some ITM codespace for RTOS event
+tracing and include ITM messaging support.
+Clearly some of that data would be valuable for interactive debugging.
++
++Should someone get ambitious, GUI reports should be possible. GNU tools
++for simpler reports like gprof may be simpler to support at first.
++In any case, OpenOCD is not currently GUI-oriented. Accordingly, we now
++expect any such graphics to come from postprocessing.
+
+ measurments for RTOS event timings should also be easy to collect.
++Examples include context and message switch times, as well as times
+for application interactions.
++
diff --git a/openocd/share/openocd/contrib/cross-build.sh b/openocd/share/openocd/contrib/cross-build.sh
new file mode 100644
index 0000000..74ab0f4
--- /dev/null
+++ b/openocd/share/openocd/contrib/cross-build.sh
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+# This is an example of how to do a cross-build of OpenOCD using pkg-config.
+# Cross-building with pkg-config is deceptively hard and most guides and
+# tutorials are incomplete or give bad advice. Some of the traps that are easy
+# to fall in but handled by this script are:
+#
+# * Polluting search paths and flags with values from the build system.
+# * Faulty pkg-config wrappers shipped with distribution packaged cross-
+# toolchains.
+# * Build failing because pkg-config discards some paths even though they are
+# correctly listed in the .pc file.
+# * Getting successfully built binaries that cannot find runtime data because
+# paths refer to the build file system.
+#
+# This script is probably more useful as a reference than as a complete build
+# tool but for some configurations it may be usable as-is. It only cross-
+# builds libusb-1.0 from source, but the script can be extended to build other
+# prerequisities in a similar manner.
+#
+# Usage:
+# export LIBUSB1_SRC=/path/to/libusb-1.0
+# export HIDAPI_SRC=/path/to/hidapi
+# export OPENOCD_CONFIG="--enable-..."
+# cd /work/dir
+# /path/to/openocd/contrib/cross-build.sh
+#
+# For static linking, a workaround is to
+# export LIBUSB1_CONFIG="--enable-static --disable-shared"
+#
+# All the paths must not contain any spaces.
+
+set -e -x
+
+WORK_DIR=$PWD
+
+## Source code paths, customize as necessary
+: ${OPENOCD_SRC:="`dirname "$0"`/.."}
+: ${LIBUSB1_SRC:=/path/to/libusb}
+: ${HIDAPI_SRC:=/path/to/hidapi}
+
+OPENOCD_SRC=`readlink -m $OPENOCD_SRC`
+LIBUSB1_SRC=`readlink -m $LIBUSB1_SRC`
+HIDAPI_SRC=`readlink -m $HIDAPI_SRC`
+
+HOST_TRIPLET=$1
+BUILD_DIR=$WORK_DIR/$HOST_TRIPLET-build
+LIBUSB1_BUILD_DIR=$BUILD_DIR/libusb1
+HIDAPI_BUILD_DIR=$BUILD_DIR/hidapi
+OPENOCD_BUILD_DIR=$BUILD_DIR/openocd
+
+## Root of host file tree
+SYSROOT=$WORK_DIR/$HOST_TRIPLET-root
+
+## Install location within host file tree
+: ${PREFIX=/usr}
+
+## OpenOCD-only install dir for packaging
+PACKAGE_DIR=$WORK_DIR/openocd_`git --git-dir=$OPENOCD_SRC/.git describe`_$HOST_TRIPLET
+
+#######
+
+# Create pkg-config wrapper and make sure it's used
+export PKG_CONFIG=$WORK_DIR/$HOST_TRIPLET-pkg-config
+
+cat > $PKG_CONFIG <