提交V1.0.0版本

This commit is contained in:
skythinker 2022-01-02 00:31:59 +08:00
parent 0e007d521e
commit 4797c462d6
1051 changed files with 53643 additions and 60 deletions

37
LinkScope.pro Normal file
View File

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

319
LinkScope.pro.user Normal file
View File

@ -0,0 +1,319 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.0, 2022-01-02T00:24:35. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{f00ace1e-3608-4ace-b35a-ef2e60010534}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
<value type="QString">-fno-delayed-template-parsing</value>
</valuelist>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.9.9 MinGW 32bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.9.9 MinGW 32bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.599.win32_mingw53_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.BuildTargets"/>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
<value type="bool" key="Qt4ProjectManager.MakeStep.OverrideMakeflags">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<valuelist type="QVariantList" key="Analyzer.Perf.RecordArguments">
<value type="QString">-e</value>
<value type="QString">cpu-cycles</value>
<value type="QString">--call-graph</value>
<value type="QString">dwarf,4096</value>
<value type="QString">-F</value>
<value type="QString">250</value>
</valuelist>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:F:/Sketches/Qt/LinkScope/LinkScope/LinkScope.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">F:/Sketches/Qt/LinkScope/LinkScope/LinkScope.pro</value>
<value type="QString" key="RunConfiguration.Arguments"></value>
<value type="bool" key="RunConfiguration.Arguments.multi">false</value>
<value type="QString" key="RunConfiguration.OverrideDebuggerStartup"></value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">F:/Sketches/Qt/LinkScope/build-LinkScope-Desktop_Qt_5_9_9_MinGW_32bit-Debug</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

View File

@ -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/)

106
README.md
View File

@ -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`复制到可执行文件同级目录下

BIN
gdb/gdb.exe Normal file

Binary file not shown.

BIN
gdb/libgcc_s_dw2-1.dll Normal file

Binary file not shown.

BIN
gdb/zlib1.dll Normal file

Binary file not shown.

323
graphwindow.cpp Normal file
View File

@ -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;i<VERT_DIV;i++)
{
float horiY=hei*i/VERT_DIV+posy;
painter.drawLine(posx,horiY,posx+wid,horiY);
}
for(int i=1;i<HORI_DIV;i++)
{
float vertX=wid*i/HORI_DIV+posx;
painter.drawLine(vertX,posy,vertX,posy+hei);
}
//计算采样点最大时间范围和需要显示的时间范围
double totalTime=0;
for(int varIndex=0;varIndex<varList->size();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;varIndex<varList->size();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;sampIndex<var.samples.size();sampIndex++)//依次连接采样点
{
SamplePoint thisSamp=var.samples.at(sampIndex);
double lastTime=lastSamp.timestamp/1000000.0;
double thisTime=thisSamp.timestamp/1000000.0;
if(lastTime>startTime&&lastTime<endTime && thisTime>startTime&&thisTime<endTime && thisTime-lastTime<0.5)
{
QPoint lastPoint((lastTime-startTime)/timeRange*wid+posx,hei-(lastSamp.value-minValue)/valueRange*hei+posy);
QPoint thisPoint((thisTime-startTime)/timeRange*wid+posx,hei-(thisSamp.value-minValue)/valueRange*hei+posy);
if(!( (lastPoint.y()<posy && thisPoint.y()<posy) || (lastPoint.y()>posy+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 && chosenVarIndex<varList->size() && 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;sampIndex<chosenVar->samples.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()<ui->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()<ui->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<VarInfo> *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);
}

52
graphwindow.h Normal file
View File

@ -0,0 +1,52 @@
#ifndef GRAPHWINDOW_H
#define GRAPHWINDOW_H
#include <QDialog>
#include <vartype.h>
#include <qtimer.h>
#include <QKeyEvent>
#include <QPainter>
#include <qdebug.h>
#include <qmessagebox.h>
namespace Ui {
class GraphWindow;
}
class GraphWindow : public QDialog
{
Q_OBJECT
public:
explicit GraphWindow(QWidget *parent = nullptr);
~GraphWindow();
void setVarList(QList<VarInfo> *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<VarInfo> *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

226
graphwindow.ui Normal file
View File

@ -0,0 +1,226 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>GraphWindow</class>
<widget class="QDialog" name="GraphWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>977</width>
<height>680</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>画面设置</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="toolTip">
<string>画面中显示的采样点数</string>
</property>
<property name="text">
<string>水平分辨率(sec/Div)</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="sb_hori_rsv">
<property name="decimals">
<number>3</number>
</property>
<property name="minimum">
<double>0.001000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>竖直分辨率(/Div)</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="sb_vert_rsv">
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
<property name="value">
<double>50.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>竖直偏移</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="sb_vert_offset">
<property name="decimals">
<number>4</number>
</property>
<property name="minimum">
<double>-100000.000000000000000</double>
</property>
<property name="maximum">
<double>100000.000000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>64</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btn_help">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>操作说明</string>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="txt_graph">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QScrollBar" name="bar_hori">
<property name="maximum">
<number>1000</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="invertedControls">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="lab_name">
<property name="text">
<string>变量名</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lab_curval">
<property name="text">
<string>当前值</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lab_lookval">
<property name="text">
<string>查看值</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cb_update">
<property name="text">
<string>实时更新</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
imgs/graph-oper.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

BIN
imgs/run-demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
imgs/simp-oper.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

11
main.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

667
mainwindow.cpp Normal file
View File

@ -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(index<varList.size())
{
QMessageBox msgBox;
msgBox.setWindowTitle("提示");
msgBox.setText("确认要删除变量 "+varList.at(index).name+" 吗?");
msgBox.setStandardButtons(QMessageBox::Yes|QMessageBox::No);
if(msgBox.exec()==QMessageBox::Yes)//用户确认后移除变量并重绘表格
{
varList.removeAt(index);
redrawTable();
}
}
}
}
}
//窗口关闭事件,在主窗口关闭时自动关闭绘图窗口以退出程序
void MainWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
graph->close();
}
//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;index<varList.size();index++)//遍历每个变量
{
QStandardItem *item=tableModel->item(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;i<varList.size();i++)//清空变量列表历史采样点数据
varList[i].samples.clear();
stampTimer->restart();//开启时间戳计时
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();
}
}
//参数truegdb连接到本机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;index<varList.size();index++)//依次进行每个变量的匹配
{
VarInfo &info=varList[index];
QString regName="";
for(int i=0;i<info.name.length();i++)//将变量名每个转换为16进制格式用于正则匹配
regName+=QString("\\x%1").arg(info.name.at(i).unicode(),0,16);
QRegExp rx(QString("\\d+:\\s%1\\s=\\s(.*)\\r\\n[\\d\\(]").arg(regName));//正则匹配模板,匹配选中的变量名并截取出变量值
rx.setMinimal(true);//使用非贪心模式
if(rx.indexIn(raw)!=-1)
{
info.rawValue=rx.cap(1);//正则中截取出的字符串即为变量当前值
SamplePoint sample;
if(getValueFromRaw(info.rawValue,sample.value))//尝试转换为double生成采样点并写入采样点列表
{
sample.timestamp=timestamp;
info.samples.append(sample);
}
}
}
}
//延时制定毫秒数,进行子任务循环
void MainWindow::sleep(uint32_t ms)
{
QTime untilTime=QTime::currentTime().addMSecs(ms);
while(QTime::currentTime()<untilTime)
QCoreApplication::processEvents(QEventLoop::AllEvents,100);
}
//读取ocd目录下的配置文件列表添加到下拉框
void MainWindow::loadConfFileList()
{
ui->cb_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;i<varList.size();i++)//依次添加各变量信息
{
tableModel->setItem(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;index<varList.size();index++)//写入每个变量的配置信息(不会写入采样点数据)
{
const VarInfo *varInfo=&varList.at(index);
settings.beginGroup(QString("VarInfo%1").arg(index));
settings.setValue("Name",varInfo->name);
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;index<varNum;index++)//依次读取各变量配置
{
VarInfo varInfo;
settings.beginGroup(QString("VarInfo%1").arg(index));
varInfo.name=settings.value("Name").toString();
varInfo.enableScope=settings.value("EnableScope").toBool();
varInfo.lineColor=QColor(settings.value("LineColor").toString());
settings.endGroup();
varList.append(varInfo);
}
redrawTable();//重绘表格
}
//导出变量采样数据到指定CSV文件中
bool MainWindow::exportCSV(const QString &filename)
{
QFile file(filename);
if(!file.open(QFile::WriteOnly))
return false;
QTextStream outStream(&file);//使用流方式输出
int maxSampleNum=0;
for(int i=0;i<varList.size();i++)//计算最大采样点数
if(varList.at(i).samples.size()>maxSampleNum)
maxSampleNum=varList.at(i).samples.size();
for(int index=0;index<varList.size();index++)//写入表头
outStream<<"Timestamp,"<<varList.at(index).name<<',';
outStream<<'\n';
for(int row=0;row<maxSampleNum;row++)//依次写入各变量的采样数据
{
for(int index=0;index<varList.size();index++)
{
const VarInfo &varInfo=varList.at(index);
if(row<varInfo.samples.size())
outStream<<varInfo.samples.at(row).timestamp<<','<<varInfo.samples.at(row).value<<',';
else
outStream<<",,";
}
outStream<<'\n';
}
return true;
}
//复位按钮点击向gdb发送复位指令
void MainWindow::on_bt_reset_clicked()
{
if(connected)
gdbProcess->write("monitor reset\r\n");
}
//表格双击事件,进行图线颜色修改
void MainWindow::on_tb_var_doubleClicked(const QModelIndex &index)
{
if(index.column()==4&&index.row()<varList.size())//点击的是第4列说明要修改颜色
{
QStandardItem *item=tableModel->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()<varList.size())//在第3列上表示用户切换了绘图使能状态
{
varList[index.row()].enableScope=(tableModel->item(index.row(),index.column())->checkState()==Qt::Checked);
}
if(index.column()==0&&index.row()<varList.size())//在变量名列,表示用户选中了该变量
{
graph->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"));//打开仓库主页
}

83
mainwindow.h Normal file
View File

@ -0,0 +1,83 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <vartype.h>
#include <qprocess.h>
#include <qdebug.h>
#include <QTime>
#include <QDir>
#include <qfiledialog.h>
#include <windows.h>
#include <qmessagebox.h>
#include <qstandarditemmodel.h>
#include <qtimer.h>
#include <QKeyEvent>
#include <graphwindow.h>
#include <qelapsedtimer.h>
#include <qcolordialog.h>
#include <qsettings.h>
#include <qregexp.h>
#include <qdesktopservices.h>
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<VarInfo> 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

204
mainwindow.ui Normal file
View File

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>918</width>
<height>727</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableView" name="tb_var"/>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>连接设置</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>调试器</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cb_interface">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>目标芯片</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cb_target">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bt_conn">
<property name="text">
<string>连接目标</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bt_reset">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>复位并运行</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>工程设置</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Axf文件路径</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="txt_axf_path">
<property name="text">
<string>请选择axf文件</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>557</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="bt_set_axf">
<property name="text">
<string>设置Axf路径</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>918</width>
<height>29</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>菜单</string>
</property>
<addaction name="action_show_graph"/>
<addaction name="separator"/>
<addaction name="action_refresh_conf"/>
<addaction name="separator"/>
<addaction name="action_save"/>
<addaction name="action_load"/>
<addaction name="separator"/>
<addaction name="action_export"/>
</widget>
<widget class="QMenu" name="menu_2">
<property name="title">
<string>帮助</string>
</property>
<addaction name="action_help"/>
<addaction name="separator"/>
<addaction name="action_homepage"/>
<addaction name="action_about"/>
</widget>
<addaction name="menu"/>
<addaction name="menu_2"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="action_save">
<property name="text">
<string>保存配置</string>
</property>
</action>
<action name="action_load">
<property name="text">
<string>导入配置</string>
</property>
</action>
<action name="action_export">
<property name="text">
<string>导出数据</string>
</property>
</action>
<action name="action_help">
<property name="text">
<string>帮助</string>
</property>
</action>
<action name="action_about">
<property name="text">
<string>关于</string>
</property>
</action>
<action name="action_show_graph">
<property name="text">
<string>显示绘图窗口</string>
</property>
</action>
<action name="action_refresh_conf">
<property name="text">
<string>刷新连接配置</string>
</property>
</action>
<action name="action_homepage">
<property name="text">
<string>转到主页</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

BIN
openocd/bin/ftd2xx.dll Normal file

Binary file not shown.

BIN
openocd/bin/libusb0.dll Normal file

Binary file not shown.

BIN
openocd/bin/openocd.exe Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UniversalUsbDriver>
<UniversalDriverName>FTDI CDM</UniversalDriverName>
<PrimaryInfFile>ftdibus.inf</PrimaryInfFile>
<UniqueDriverId>com.sysprogs.ftdi</UniqueDriverId>
</UniversalUsbDriver>
</ArrayOfUniversalUsbDriver>

File diff suppressed because it is too large Load Diff

View File

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

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UniversalUsbDriver>
<UniversalDriverName>ST-Link Driver</UniversalDriverName>
<PrimaryInfFile>stlink_dbg_winusb.inf </PrimaryInfFile>
<UniqueDriverId>com.sysprogs.libusb.stlink</UniqueDriverId>
<FixedDriver>
<ManufacturerName>STMicroelectronics</ManufacturerName>
<DeviceNameRegex>STMicroelectronics STLink dongle</DeviceNameRegex>
</FixedDriver>
</UniversalUsbDriver>
</ArrayOfUniversalUsbDriver>

View File

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

View File

@ -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}"

View File

@ -0,0 +1,7 @@
@echo off
if "%PROCESSOR_ARCHITECTURE%"=="x86" goto X86
dpinst_amd64.exe
goto END
:X86
dpinst_x86.exe
:END

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v2.0.50727"/>
<supportedRuntime version="v4.0.30319"/>
</startup>
</configuration>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UniversalUsbDriver>
<UniversalDriverName>Libusb - WinUSB</UniversalDriverName>
<PrimaryInfFile>libusb_device.inf</PrimaryInfFile>
<UniqueDriverId>com.sysprogs.libusb.original</UniqueDriverId>
</UniversalUsbDriver>
</ArrayOfUniversalUsbDriver>

View File

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

View File

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

View File

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

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UniversalUsbDriver>
<UniversalDriverName>WinUSB</UniversalDriverName>
<PrimaryInfFile>winusb_device.inf</PrimaryInfFile>
<UniqueDriverId>com.sysprogs.libusb.mini</UniqueDriverId>
</UniversalUsbDriver>
</ArrayOfUniversalUsbDriver>

View File

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

View File

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<ArrayOfUniversalUsbDriver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UniversalUsbDriver>
<UniversalDriverName>TI XDS110 Driver</UniversalDriverName>
<PrimaryInfFile>xds110_debug.inf</PrimaryInfFile>
<UniqueDriverId>com.sysprogs.ti.xds110</UniqueDriverId>
<FixedDriver>
<ManufacturerName>Texas Instruments Incorporated</ManufacturerName>
<DeviceNameRegex>XDS110 Class Debug Probe</DeviceNameRegex>
</FixedDriver>
</UniversalUsbDriver>
</ArrayOfUniversalUsbDriver>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

View File

@ -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.
+

View File

@ -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 <host-triplet>
#
# 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 <<EOF
#!/bin/sh
SYSROOT=$SYSROOT
export PKG_CONFIG_DIR=
export PKG_CONFIG_LIBDIR=\${SYSROOT}$PREFIX/lib/pkgconfig:\${SYSROOT}$PREFIX/share/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=\${SYSROOT}
# The following have to be set to avoid pkg-config to strip /usr/include and /usr/lib from paths
# before they are prepended with the sysroot path. Feels like a pkg-config bug.
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=
exec pkg-config "\$@"
EOF
chmod +x $PKG_CONFIG
# Clear out work dir
rm -rf $SYSROOT $BUILD_DIR
mkdir -p $SYSROOT
# libusb-1.0 build & install into sysroot
mkdir -p $LIBUSB1_BUILD_DIR
cd $LIBUSB1_BUILD_DIR
$LIBUSB1_SRC/configure --build=`$LIBUSB1_SRC/config.guess` --host=$HOST_TRIPLET \
--with-sysroot=$SYSROOT --prefix=$PREFIX \
$LIBUSB1_CONFIG
make
make install DESTDIR=$SYSROOT
# hidapi build & install into sysroot
if [ -d $HIDAPI_SRC ] ; then
mkdir -p $HIDAPI_BUILD_DIR
cd $HIDAPI_BUILD_DIR
$HIDAPI_SRC/configure --build=`$HIDAPI_SRC/config.guess` --host=$HOST_TRIPLET \
--with-sysroot=$SYSROOT --prefix=$PREFIX \
$HIDAPI_CONFIG
make
make install DESTDIR=$SYSROOT
fi
# OpenOCD build & install into sysroot
mkdir -p $OPENOCD_BUILD_DIR
cd $OPENOCD_BUILD_DIR
$OPENOCD_SRC/configure --build=`$OPENOCD_SRC/config.guess` --host=$HOST_TRIPLET \
--with-sysroot=$SYSROOT --prefix=$PREFIX \
$OPENOCD_CONFIG
make
make install DESTDIR=$SYSROOT
# Separate OpenOCD install w/o dependencies. OpenOCD will have to be linked
# statically or have dependencies packaged/installed separately.
make install DESTDIR=$PACKAGE_DIR

View File

@ -0,0 +1,124 @@
#!/usr/bin/perl
# Automatically generates the StellarisParts struct in src/flash/nor/stellaris.c
# Uses the header files from TI/Luminary's StellarisWare complete Firmware Development Package
# available from: http://www.luminarymicro.com/products/software_updates.html
$comment = "// Autogenerated by contrib/gen-stellaris-part-header.pl
// From Stellaris Firmware Development Package revision";
$struct_header = "static const struct {
uint8_t class;
uint8_t partno;
const char *partname;
} StellarisParts[] = {
";
$struct_footer = "\t{0xFF, 0x00, \"Unknown Part\"}\n};\n";
$#ARGV == 1 || die "Usage: $0 <inc directory> <output file>\n";
-d $ARGV[0] || die $ARGV[0]." is not a directory\n";
$dir = $ARGV[0];
-f $ARGV[1] || die $ARGV[1]." is not a file\n";
$file = $ARGV[1];
print STDERR "Scanning $dir, Updating $file\n";
opendir(DIR, $dir) || die "can't open $dir: $!";
@files = readdir(DIR);
closedir(DIR);
@header_files = sort(grep(/lm.+\.h/, @files));
$ver = 0;
$new_struct = $struct_header;
process_file(@header_files);
$new_struct .= $struct_footer;
$dump = "$comment $ver\n$new_struct";
{
local($/, *INPUT);
open(INPUT, $file) || die "can't open $file: $!";
$contents = <INPUT>;
close(INPUT);
}
$old_struct = qr/((^\/\/.*?\n)*)\Q$struct_header\E.*?$struct_footer/sm;
$contents =~ s/$old_struct/$dump/;
open(OUTPUT, ">$file") || die "can't open file $file for writing: $!";
print OUTPUT $contents;
close(OUTPUT);
sub process_file {
foreach $h_file (@_) {
($base) = ($h_file =~ m/lm..(.{3,7})\.h/ig);
$base = uc($base);
local($/, *FILE);
open(FILE, "$dir/$h_file");
$content = <FILE>;
close(FILE);
$invalid = 0;
if ($content =~ /This is part of revision (\d+) of/) {
if ($ver != 0 and $ver != $1) {
print STDERR "File version mismatch: $ver != $1\n";
$ver = max($ver, $1);
} else {
$ver = $1;
}
}
if ($content =~ /SYSCTL_DID0_CLASS_[^M].+?0x(\S+)/s) {
$class = hex($1) >> 16;
} else {
# attempt another way to get class
if ($content =~ /\s(\S+)-class/) {
$class = getclass($1);
if ($class eq 0xFF) {
print STDERR "$h_file unknown class\n";
$invalid = 1;
}
} else {
print STDERR "$h_file is missing SYSCTL_DID0_CLASS_\n";
$class = 0;
$invalid = 1;
}
}
if ($content =~ /SYSCTL_DID1_PRTNO_$base.+0x(\S+)/) {
$prtno = hex($1);
$base = "LM3S" . $base;
} else {
# LM4F have a changed header
if ($content =~ /SYSCTL_DID1_PRTNO_LM4F$base.+?0x(\S+)/s) {
$prtno = hex($1);
$base = "LM4F" . $base;
} else {
print STDERR "$h_file is missing SYSCTL_DID1_PRTNO\n";
$prtno = 0;
$invalid = 1;
}
}
$new_member = sprintf "{0x%02X, 0x%02X, \"%s\"},", $class, $prtno >> 16, $base;
if ($invalid == 1) {
#$new_struct .= "\t//$new_member\t// Invalid\n";
} else {
$new_struct .= "\t$new_member\n";
}
}
}
sub getclass {
$class = $_[0];
if ($class =~ /Sandstorm/i) {
return 0;
} elsif ($class =~ /Fury/i) {
return 1;
} elsif ($class =~ /DustDevil/i) {
return 3;
} elsif ($class =~ /Tempest/i) {
return 4;
} elsif ($class =~ /Blizzard/i) {
return 5;
} elsif ($class =~ /Firestorm/i) {
return 6;
}
return 0xFF;
}

View File

@ -0,0 +1,459 @@
/*
* Copyright (C) 2010 by David Brownell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Simple utility to parse and dump ARM Cortex-M3 SWO trace output. Once the
* mechanisms work right, this information can be used for various purposes
* including profiling (particularly easy for flat PC-sample profiles) and
* for debugging.
*
* SWO is the Single Wire Output found on some ARM cores, most notably on the
* Cortex-M3. It combines data from several sources:
*
* - Software trace (ITM): so-called "printf-style" application messaging
* using "ITM stimulus ports"; and differential timestamps.
* - Hardware trace (DWT): for profiling counters and comparator matches.
* - TPIU may issue sync packets.
*
* The trace data format is defined in Appendix E, "Debug ITM and DWT packet
* protocol", of the ARMv7-M Architecture Reference Manual (DDI 0403C). It
* is a superset of the ITM data format from the Coresight TRM.
*
* The trace data has two encodings. The working assumption is that data
* gets into this program using the UART encoding.
*/
#include <errno.h>
#include <libgen.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <unistd.h>
unsigned int dump_swit;
/* Example ITM trace word (0xWWXXYYZZ) parsing for task events, sent
* on port 31 (Reserved for "the" RTOS in CMSIS v1.30)
* WWXX: event code (0..3 pre-assigned, 4..15 reserved)
* YY: task priority
* ZZ: task number
*
* NOTE that this specific encoding could be space-optimized; and that
* trace data streams could also be history-sensitive.
*/
static void show_task(int port, unsigned data)
{
unsigned code = data >> 16;
char buf[16];
if (dump_swit)
return;
switch (code) {
case 0:
strcpy(buf, "run");
break;
case 1:
strcpy(buf, "block");
break;
case 2:
strcpy(buf, "create");
break;
case 3:
strcpy(buf, "destroy");
break;
/* 4..15 reserved for other infrastructure ops */
default:
sprintf(buf, "code %d", code);
break;
}
printf("TASK %d, pri %d: %s",
(data >> 0) & 0xff,
(data >> 8) & 0xff,
buf);
}
static void show_reserved(FILE *f, char *label, int c)
{
unsigned i;
if (dump_swit)
return;
printf("%s - %#02x", label, c);
for (i = 0; (c & 0x80) && i < 4; i++) {
c = fgetc(f);
if (c == EOF) {
printf("(ERROR %d - %s) ", errno, strerror(errno));
break;
}
printf(" %#02x", c);
}
printf("\n");
}
static bool read_varlen(FILE *f, int c, unsigned *value)
{
unsigned size;
unsigned char buf[4];
*value = 0;
switch (c & 3) {
case 3:
size = 4;
break;
case 2:
size = 2;
break;
case 1:
size = 1;
break;
default:
printf("INVALID SIZE\n");
return false;
}
memset(buf, 0, sizeof buf);
if (fread(buf, 1, size, f) != size)
goto err;
*value = (buf[3] << 24)
+ (buf[2] << 16)
+ (buf[1] << 8)
+ (buf[0] << 0);
return true;
err:
printf("(ERROR %d - %s)\n", errno, strerror(errno));
return false;
}
static void show_hard(FILE *f, int c)
{
unsigned type = c >> 3;
unsigned value;
char *label;
if (dump_swit)
return;
printf("DWT - ");
if (!read_varlen(f, c, &value))
return;
printf("%#x", value);
switch (type) {
case 0: /* event counter wrapping */
printf("overflow %s%s%s%s%s%s",
(value & (1 << 5)) ? "cyc " : "",
(value & (1 << 4)) ? "fold " : "",
(value & (1 << 3)) ? "lsu " : "",
(value & (1 << 2)) ? "slp " : "",
(value & (1 << 1)) ? "exc " : "",
(value & (1 << 0)) ? "cpi " : "");
break;
case 1: /* exception tracing */
switch (value >> 12) {
case 1:
label = "entry to";
break;
case 2:
label = "exit from";
break;
case 3:
label = "return to";
break;
default:
label = "?";
break;
}
printf("%s exception %d", label, value & 0x1ff);
break;
case 2: /* PC sampling */
if (c == 0x15)
printf("PC - sleep");
else
printf("PC - %#08x", value);
break;
case 8: /* data tracing, pc value */
case 10:
case 12:
case 14:
printf("Data trace %d, PC %#08x", (c >> 4) & 3, value);
/* optionally followed by data value */
break;
case 9: /* data tracing, address offset */
case 11:
case 13:
case 15:
printf("Data trace %d, address offset %#04x",
(c >> 4) & 3, value);
/* always followed by data value */
break;
case 16 ... 23: /* data tracing, data value */
printf("Data trace %d, ", (c >> 4) & 3);
label = (c & 0x8) ? "write" : "read";
switch (c & 3) {
case 3:
printf("word %s, value %#08x", label, value);
break;
case 2:
printf("halfword %s, value %#04x", label, value);
break;
case 1:
printf("byte %s, value %#02x", label, value);
break;
}
break;
default:
printf("UNDEFINED, rawtype: %x", type);
break;
}
printf("\n");
return;
}
/*
* Table of SWIT (SoftWare InstrumentTation) message dump formats, for
* ITM port 0..31 application data.
*
* Eventually this should be customizable; all usage is application defined.
*
* REVISIT there can be up to 256 trace ports, via "ITM Extension" packets
*/
struct {
int port;
void (*show)(int port, unsigned data);
} format[] = {
{ .port = 31, .show = show_task, },
};
static void show_swit(FILE *f, int c)
{
unsigned port = c >> 3;
unsigned value = 0;
unsigned i;
if (port + 1 == dump_swit) {
if (!read_varlen(f, c, &value))
return;
printf("%c", value);
return;
}
if (!read_varlen(f, c, &value))
return;
if (dump_swit)
return;
printf("SWIT %u - ", port);
printf("%#08x", value);
for (i = 0; i < sizeof(format) / sizeof(format[0]); i++) {
if (format[i].port == port) {
printf(", ");
format[i].show(port, value);
break;
}
}
printf("\n");
return;
}
static void show_timestamp(FILE *f, int c)
{
unsigned counter = 0;
char *label = "";
bool delayed = false;
if (dump_swit)
return;
printf("TIMESTAMP - ");
/* Format 2: header only */
if (!(c & 0x80)) {
switch (c) {
case 0: /* sync packet -- coding error! */
case 0x70: /* overflow -- ditto! */
printf("ERROR - %#02x\n", c);
break;
default:
/* synchronous to ITM */
counter = c >> 4;
goto done;
}
return;
}
/* Format 1: one to four bytes of data too */
switch (c >> 4) {
default:
label = ", reserved control\n";
break;
case 0xc:
/* synchronous to ITM */
break;
case 0xd:
label = ", timestamp delayed";
delayed = true;
break;
case 0xe:
label = ", packet delayed";
delayed = true;
break;
case 0xf:
label = ", packet and timetamp delayed";
delayed = true;
break;
}
c = fgetc(f);
if (c == EOF)
goto err;
counter = c & 0x7f;
if (!(c & 0x80))
goto done;
c = fgetc(f);
if (c == EOF)
goto err;
counter |= (c & 0x7f) << 7;
if (!(c & 0x80))
goto done;
c = fgetc(f);
if (c == EOF)
goto err;
counter |= (c & 0x7f) << 14;
if (!(c & 0x80))
goto done;
c = fgetc(f);
if (c == EOF)
goto err;
counter |= (c & 0x7f) << 21;
done:
/* REVISIT should we try to convert from delta values? */
printf("+%u%s\n", counter, label);
return;
err:
printf("(ERROR %d - %s) ", errno, strerror(errno));
goto done;
}
int main(int argc, char **argv)
{
FILE *f = stdin;
int c;
/* parse arguments */
while ((c = getopt(argc, argv, "f:d:")) != EOF) {
switch (c) {
case 'f':
/* e.g. from UART connected to /dev/ttyUSB0 */
f = fopen(optarg, "r");
if (!f) {
perror(optarg);
return 1;
}
break;
case 'd':
dump_swit = atoi(optarg);
break;
default:
fprintf(stderr, "usage: %s [-f input]",
basename(argv[0]));
return 1;
}
}
/* Parse data ... records have a header then data bytes.
* NOTE: we assume getc() deals in 8-bit bytes.
*/
bool overflow = false;
while ((c = getc(f)) != EOF) {
/* Sync packet ... 7 zeroes, 0x80 */
if (c == 0) {
int i;
for (i = 0; i < 6; i++) {
c = fgetc(f);
if (c == EOF)
break;
if (c != 0)
goto bad_sync;
}
c = fgetc(f);
if (c == 0x80) {
printf("SYNC\n");
continue;
}
bad_sync:
printf("BAD SYNC\n");
continue;
}
/* Overflow packet */
if (c == 0x70) {
/* REVISIT later, report just what overflowed!
* Timestamp and SWIT can happen. Non-ITM too?
*/
overflow = true;
printf("OVERFLOW ...\n");
continue;
}
overflow = false;
switch (c & 0x0f) {
case 0x00: /* Timestamp */
show_timestamp(f, c);
break;
case 0x04: /* "Reserved" */
show_reserved(f, "RESERVED", c);
break;
case 0x08: /* ITM Extension */
/* FIXME someday, handle these ... */
show_reserved(f, "ITM EXT", c);
break;
case 0x0c: /* DWT Extension */
show_reserved(f, "DWT EXT", c);
break;
default:
if (c & 4)
show_hard(f, c);
else
show_swit(f, c);
break;
}
}
return 0;
}

View File

@ -0,0 +1,19 @@
This code is an example of using the openocd debug message system.
Before the message output is seen in the debug window, the functionality
will need enabling:
From the gdb prompt:
monitor target_request debugmsgs enable
monitor trace point 1
From the Telnet prompt:
target_request debugmsgs enable
trace point 1
To see how many times the trace point was hit:
(monitor) trace point 1
Spen
spen@spen-soft.co.uk

View File

@ -0,0 +1,157 @@
/***************************************************************************
* Copyright (C) 2008 by Dominic Rath *
* Dominic.Rath@gmx.de *
* Copyright (C) 2008 by Spencer Oliver *
* spen@spen-soft.co.uk *
* Copyright (C) 2008 by Frederik Kriewtz *
* frederik@kriewitz.eu *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#include "dcc_stdio.h"
#define TARGET_REQ_TRACEMSG 0x00
#define TARGET_REQ_DEBUGMSG_ASCII 0x01
#define TARGET_REQ_DEBUGMSG_HEXMSG(size) (0x01 | ((size & 0xff) << 8))
#define TARGET_REQ_DEBUGCHAR 0x02
#if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_6SM__)
/* we use the System Control Block DCRDR reg to simulate a arm7_9 dcc channel
* DCRDR[7:0] is used by target for status
* DCRDR[15:8] is used by target for write buffer
* DCRDR[23:16] is used for by host for status
* DCRDR[31:24] is used for by host for write buffer */
#define NVIC_DBG_DATA_R (*((volatile unsigned short *)0xE000EDF8))
#define BUSY 1
void dbg_write(unsigned long dcc_data)
{
int len = 4;
while (len--)
{
/* wait for data ready */
while (NVIC_DBG_DATA_R & BUSY);
/* write our data and set write flag - tell host there is data*/
NVIC_DBG_DATA_R = (unsigned short)(((dcc_data & 0xff) << 8) | BUSY);
dcc_data >>= 8;
}
}
#elif defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_5T__)
void dbg_write(unsigned long dcc_data)
{
unsigned long dcc_status;
do {
asm volatile("mrc p14, 0, %0, c0, c0" : "=r" (dcc_status));
} while (dcc_status & 0x2);
asm volatile("mcr p14, 0, %0, c1, c0" : : "r" (dcc_data));
}
#else
#error unsupported target
#endif
void dbg_trace_point(unsigned long number)
{
dbg_write(TARGET_REQ_TRACEMSG | (number << 8));
}
void dbg_write_u32(const unsigned long *val, long len)
{
dbg_write(TARGET_REQ_DEBUGMSG_HEXMSG(4) | ((len & 0xffff) << 16));
while (len > 0)
{
dbg_write(*val);
val++;
len--;
}
}
void dbg_write_u16(const unsigned short *val, long len)
{
unsigned long dcc_data;
dbg_write(TARGET_REQ_DEBUGMSG_HEXMSG(2) | ((len & 0xffff) << 16));
while (len > 0)
{
dcc_data = val[0]
| ((len > 1) ? val[1] << 16: 0x0000);
dbg_write(dcc_data);
val += 2;
len -= 2;
}
}
void dbg_write_u8(const unsigned char *val, long len)
{
unsigned long dcc_data;
dbg_write(TARGET_REQ_DEBUGMSG_HEXMSG(1) | ((len & 0xffff) << 16));
while (len > 0)
{
dcc_data = val[0]
| ((len > 1) ? val[1] << 8 : 0x00)
| ((len > 2) ? val[2] << 16 : 0x00)
| ((len > 3) ? val[3] << 24 : 0x00);
dbg_write(dcc_data);
val += 4;
len -= 4;
}
}
void dbg_write_str(const char *msg)
{
long len;
unsigned long dcc_data;
for (len = 0; msg[len] && (len < 65536); len++);
dbg_write(TARGET_REQ_DEBUGMSG_ASCII | ((len & 0xffff) << 16));
while (len > 0)
{
dcc_data = msg[0]
| ((len > 1) ? msg[1] << 8 : 0x00)
| ((len > 2) ? msg[2] << 16 : 0x00)
| ((len > 3) ? msg[3] << 24 : 0x00);
dbg_write(dcc_data);
msg += 4;
len -= 4;
}
}
void dbg_write_char(char msg)
{
dbg_write(TARGET_REQ_DEBUGCHAR | ((msg & 0xff) << 16));
}

View File

@ -0,0 +1,35 @@
/***************************************************************************
* Copyright (C) 2008 by Dominic Rath *
* Dominic.Rath@gmx.de *
* Copyright (C) 2008 by Spencer Oliver *
* spen@spen-soft.co.uk *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#ifndef DCC_STDIO_H
#define DCC_STDIO_H
void dbg_trace_point(unsigned long number);
void dbg_write_u32(const unsigned long *val, long len);
void dbg_write_u16(const unsigned short *val, long len);
void dbg_write_u8(const unsigned char *val, long len);
void dbg_write_str(const char *msg);
void dbg_write_char(char msg);
#endif /* DCC_STDIO_H */

View File

@ -0,0 +1,58 @@
/***************************************************************************
* Copyright (C) 2008 by Spencer Oliver *
* spen@spen-soft.co.uk *
* Copyright (C) 2008 by Frederik Kriewtz *
* frederik@kriewitz.eu *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
#include "dcc_stdio.h"
/* enable openocd debugmsg at the gdb prompt:
* monitor target_request debugmsgs enable
*
* create a trace point:
* monitor trace point 1
*
* to show how often the trace point was hit:
* monitor trace point
*/
int main(void)
{
dbg_write_str("hello world");
dbg_write_char('t');
dbg_write_char('e');
dbg_write_char('s');
dbg_write_char('t');
dbg_write_char('\n');
unsigned long test_u32 = 0x01234567;
dbg_write_u32(&test_u32, 1);
static const unsigned short test_u16[] = {0x0123, 0x4567, 0x89AB, 0xCDEF, 0x0123, 0x4567, 0x89AB, 0xCDEF};
dbg_write_u16(test_u16, 8);
static const unsigned char test_u8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0XDD, 0xEE, 0xFF};
dbg_write_u8(test_u8, 16);
while(1)
{
dbg_trace_point(0);
}
}

View File

@ -0,0 +1,34 @@
.PHONY: arm clean-arm
all: arm
common_dirs = \
checksum \
erase_check \
watchdog
ARM_CROSS_COMPILE ?= arm-none-eabi-
arm_dirs = \
flash/fm4 \
flash/kinetis_ke \
flash/xmc1xxx \
debug/xscale
arm:
for d in $(common_dirs); do \
$(MAKE) -C $$d arm; \
done
for d in $(arm_dirs); do \
$(MAKE) -C $$d all CROSS_COMPILE=$(ARM_CROSS_COMPILE); \
done
clean-arm:
for d in $(arm_dirs); do \
$(MAKE) -C $$d clean; \
done
clean: clean-arm
for d in $(common_dirs); do \
$(MAKE) -C $$d clean; \
done

View File

@ -0,0 +1,33 @@
Included in these directories are the src to the various ram loaders used
within openocd.
** target checksum loaders **
checksum/armv4_5_crc.s :
- ARMv4 and ARMv5 checksum loader : see target/arm_crc_code.c:arm_crc_code
checksum/armv7m_crc.s :
- ARMv7m checksum loader : see target/armv7m.c:cortex_m_crc_code
checksum/mips32.s :
- MIPS32 checksum loader : see target/mips32.c:mips_crc_code
** target flash loaders **
flash/pic32mx.s :
- Microchip PIC32 flash loader : see flash/nor/pic32mx.c:pic32mx_flash_write_code
flash/stellaris.s :
- TI Stellaris flash loader : see flash/nor/stellaris.c:stellaris_write_code
flash/stm32x.s :
- ST STM32 flash loader : see flash/nor/stm32x.c:stm32x_flash_write_code
flash/str7x.s :
- ST STR7 flash loader : see flash/nor/str7x.c:str7x_flash_write_code
flash/str9x.s :
- ST STR9 flash loader : see flash/nor/str9x.c:str9x_flash_write_code
Spencer Oliver
spen@spen-soft.co.uk

View File

@ -0,0 +1,30 @@
BIN2C = ../../../src/helper/bin2char.sh
ARM_CROSS_COMPILE ?= arm-none-eabi-
ARM_AS ?= $(ARM_CROSS_COMPILE)as
ARM_OBJCOPY ?= $(ARM_CROSS_COMPILE)objcopy
ARM_AFLAGS = -EL
arm: armv4_5_crc.inc armv7m_crc.inc
armv4_5_%.elf: armv4_5_%.s
$(ARM_AS) $(ARM_AFLAGS) $< -o $@
armv4_5_%.bin: armv4_5_%.elf
$(ARM_OBJCOPY) -Obinary $< $@
armv4_5_%.inc: armv4_5_%.bin
$(BIN2C) < $< > $@
armv7m_%.elf: armv7m_%.s
$(ARM_AS) $(ARM_AFLAGS) $< -o $@
armv7m_%.bin: armv7m_%.elf
$(ARM_OBJCOPY) -Obinary $< $@
armv7m_%.inc: armv7m_%.bin
$(BIN2C) < $< > $@
clean:
-rm -f *.elf *.bin *.inc

View File

@ -0,0 +1,7 @@
/* Autogenerated with ../../../src/helper/bin2char.sh */
0x00,0x20,0xa0,0xe1,0x00,0x00,0xe0,0xe3,0x01,0x30,0xa0,0xe1,0x00,0x40,0xa0,0xe3,
0x0b,0x00,0x00,0xea,0x04,0x10,0xd2,0xe7,0x30,0x70,0x9f,0xe5,0x01,0x0c,0x20,0xe0,
0x00,0x50,0xa0,0xe3,0x00,0x00,0x50,0xe3,0x80,0x60,0xa0,0xe1,0x01,0x50,0x85,0xe2,
0x06,0x00,0xa0,0xe1,0x07,0x00,0x26,0xb0,0x08,0x00,0x55,0xe3,0xf8,0xff,0xff,0x1a,
0x01,0x40,0x84,0xe2,0x03,0x00,0x54,0xe1,0xf1,0xff,0xff,0x1a,0x70,0x00,0x20,0xe1,
0xb7,0x1d,0xc1,0x04,

View File

@ -0,0 +1,58 @@
/***************************************************************************
* Copyright (C) 2010 by Spencer Oliver *
* spen@spen-soft.co.uk *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
***************************************************************************/
/*
r0 - address in - crc out
r1 - char count
*/
.text
.arm
_start:
main:
mov r2, r0
mov r0, #0xffffffff /* crc */
mov r3, r1
mov r4, #0
b ncomp
nbyte:
ldrb r1, [r2, r4]
ldr r7, CRC32XOR
eor r0, r0, r1, asl #24
mov r5, #0
loop:
cmp r0, #0
mov r6, r0, asl #1
add r5, r5, #1
mov r0, r6
eorlt r0, r6, r7
cmp r5, #8
bne loop
add r4, r4, #1
ncomp:
cmp r4, r3
bne nbyte
end:
bkpt #0
CRC32XOR: .word 0x04c11db7
.end

View File

@ -0,0 +1,5 @@
/* Autogenerated with ../../../src/helper/bin2char.sh */
0x02,0x46,0x00,0x20,0xc0,0x43,0x0a,0x4e,0x0b,0x46,0x00,0x24,0x0d,0xe0,0x11,0x5d,
0x09,0x06,0x48,0x40,0x00,0x25,0x00,0x28,0x02,0xda,0x40,0x00,0x70,0x40,0x00,0xe0,
0x40,0x00,0x01,0x35,0x08,0x2d,0xf6,0xd1,0x01,0x34,0x9c,0x42,0xef,0xd1,0x00,0xbe,
0xb7,0x1d,0xc1,0x04,

Some files were not shown because too many files have changed in this diff Show More