Skip to content

Commit

Permalink
增加对外部OpenOCD进程的支持;解决选择窗口的文件名重复和变量缺失问题;选择窗口添加加载状态显示和刷新按钮;添加高级配置窗口,允许配置…
Browse files Browse the repository at this point in the history
…串口、采样频率和GDB/OCD参数;完善tooltip说明;版本号更新至1.3.0
  • Loading branch information
Skythinker616 committed Feb 25, 2023
1 parent ba95366 commit acf23d0
Show file tree
Hide file tree
Showing 23 changed files with 689 additions and 108 deletions.
5 changes: 4 additions & 1 deletion LinkScope.pro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CONFIG += c++11
# 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 \
APP_VERSION=\\\"1.2.2\\\"
APP_VERSION=\\\"1.3.0\\\"

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
Expand All @@ -20,6 +20,7 @@ DEFINES += QT_DEPRECATED_WARNINGS \

SOURCES += \
aboutwindow.cpp \
configwindow.cpp \
gdbprocess.cpp \
graphwindow.cpp \
helpwindow.cpp \
Expand All @@ -32,6 +33,7 @@ SOURCES += \

HEADERS += \
aboutwindow.h \
configwindow.h \
gdbprocess.h \
graphwindow.h \
helpwindow.h \
Expand All @@ -44,6 +46,7 @@ HEADERS += \

FORMS += \
aboutwindow.ui \
configwindow.ui \
graphwindow.ui \
helpwindow.ui \
listwindow.ui \
Expand Down
2 changes: 1 addition & 1 deletion LinkScope.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.0, 2022-08-08T00:56:42. -->
<!-- Written by QtCreator 4.11.0, 2023-02-25T21:45:34. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

> 附OpenOCD官方文档: [支持的调试器](https://openocd.org/doc/html/Debug-Adapter-Hardware.html)、[支持的芯片](https://openocd.org/doc/html/CPU-Configuration.html#Target-CPU-Types)

* 对于需要专用OpenOCD驱动的芯片(如ESP32C3等),允许在外部手动开启OpenOCD进程后进行连接

* 最高采样速度约100Hz

* 串口模式:软件和目标芯片间通过串口连接
Expand Down Expand Up @@ -68,7 +70,7 @@

4. 选择连接模式,连接芯片,连接成功后程序开始采样

* 调试器模式下,在下拉框中选择调试器和芯片类型,点击连接目标
* 调试器模式下,在下拉框中选择调试器和芯片类型,点击连接目标;或勾选“外部进程”后直接连接到正在运行的OpenOCD进程

* 串口模式下,点击刷新串口加载串口列表,选中所连接的串口,点击连接目标

Expand All @@ -94,6 +96,8 @@

* `导出数据`:将获取到的各变量采样数据导出到CSV表格文件

* `高级设置`:打开高级设置窗口,可以设置串口参数配置、采样频率、GDB端口等

---

## 进阶使用说明
Expand Down Expand Up @@ -138,7 +142,7 @@

* 若不指定符号文件,无法使用变量名,只能通过绝对地址进行查看

* 修改符号路径后需要重新连接
* 修改符号文件路径后需要重新连接

* 本程序不带下载功能,连接目标前请确认已为目标芯片下载过指定程序;若更换为不同类型的调试器,即使芯片程序没有变动,也应使用更换后的调试器再次下载程序

Expand Down Expand Up @@ -166,14 +170,13 @@

**关于实际支持的设备**

* 虽然理论上支持OpenOCD所支持的所有设备,但受各种因素影响,实际使用时仍可能在部分设备上无法工作
* 虽然理论上支持内置OpenOCD所支持的所有设备,但受各种因素影响,实际使用时仍可能在部分设备上无法工作

* 目前已测试过的设备如下:

* 调试器:STLINK-V2、CMSIS-DAP

* 目标芯片:STM32F103RCT6、STM32F103C8T6、STM32F407ZGT6、STM32F407IGH6

* 目标芯片:STM32F103RCT6、STM32F103C8T6、STM32F407ZGT6、STM32F407IGH6、ESP32C3(内置JTAG+[专用OpenOCD](https://github.com/espressif/openocd-esp32))

---

Expand Down
1 change: 1 addition & 0 deletions aboutwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AboutWindow::AboutWindow(QWidget *parent) :
ui(new Ui::AboutWindow)
{
ui->setupUi(this);
setWindowTitle("LinkScope - About");
}

AboutWindow::~AboutWindow()
Expand Down
2 changes: 1 addition & 1 deletion aboutwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;hr width=&quot;300&quot;/&gt;&lt;p align=&quot;center&quot;&gt;版本号:V1.2.2&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;更新时间:2022/8/7&lt;/p&gt;&lt;hr width=&quot;300&quot;/&gt;&lt;p align=&quot;center&quot;&gt;Developed by Skythinker&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;hr width=&quot;300&quot;/&gt;&lt;p align=&quot;center&quot;&gt;版本号:V1.3.0&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;更新时间:2023/2/24&lt;/p&gt;&lt;hr width=&quot;300&quot;/&gt;&lt;p align=&quot;center&quot;&gt;Developed by Skythinker&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
Expand Down
50 changes: 50 additions & 0 deletions configwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include "configwindow.h"
#include "ui_configwindow.h"
#include <qdebug.h>

ConfigWindow::ConfigWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::ConfigWindow)
{
ui->setupUi(this);
setWindowTitle("高级设置");
}

ConfigWindow::~ConfigWindow()
{
delete ui;
}

void ConfigWindow::setParam(ConfigWindowParam &param)
{
ui->sb_baudrate->setValue(param.baudrate);
ui->cb_databit->setCurrentText(QString("%1").arg(param.databits));
ui->cb_stopbit->setCurrentText(param.stopbits==1 ? "1" : (param.stopbits==2?"2":"1.5"));
ui->cb_parity->setCurrentText(param.parity==0 ? "" : (param.parity==2?"偶校验":"奇校验"));
ui->cb_sample_freq->setCurrentText(QString("%1Hz").arg(param.sampleFreq));
ui->sb_gdb_port->setValue(param.gdbPort);
ui->et_gdb_param->setText(param.gdbParam);
ui->et_ocd_param->setText(param.ocdParam);
}

void ConfigWindow::getParam(ConfigWindowParam &param)
{
param.baudrate=ui->sb_baudrate->value();
param.databits=(QSerialPort::DataBits)ui->cb_databit->currentText().toInt();
param.stopbits=(QSerialPort::StopBits)QList<int>{1,3,2}.at(ui->cb_stopbit->currentIndex());
param.parity=(QSerialPort::Parity)QList<int>{0,2,3}.at(ui->cb_parity->currentIndex());
param.sampleFreq=QList<int>{100,50,20,10,5,2,1}.at(ui->cb_sample_freq->currentIndex());
param.gdbPort=ui->sb_gdb_port->value();
param.gdbParam=ui->et_gdb_param->text();
param.ocdParam=ui->et_ocd_param->text();
}

void ConfigWindow::on_bt_ok_clicked()
{
accept();
}

void ConfigWindow::on_bt_cancel_clicked()
{
close();
}
40 changes: 40 additions & 0 deletions configwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef CONFIGWINDOW_H
#define CONFIGWINDOW_H

#include <QDialog>
#include <QSerialPort>

namespace Ui {
class ConfigWindow;
}

struct ConfigWindowParam {
qint32 baudrate;
QSerialPort::DataBits databits;
QSerialPort::StopBits stopbits;
QSerialPort::Parity parity;
int sampleFreq;
int gdbPort;
QString gdbParam;
QString ocdParam;
};

class ConfigWindow : public QDialog
{
Q_OBJECT

public:
explicit ConfigWindow(QWidget *parent = nullptr);
~ConfigWindow();
void setParam(ConfigWindowParam &param);
void getParam(ConfigWindowParam &param);

private slots:
void on_bt_ok_clicked();
void on_bt_cancel_clicked();

private:
Ui::ConfigWindow *ui;
};

#endif // CONFIGWINDOW_H
Loading

0 comments on commit acf23d0

Please sign in to comment.