This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
大家好!
我想尝试 CCS 之外的其他 IDE 来开发适用于 MSP430FRXXXX 微控制器的固件。 目前、我想尝试使用 Visual Studio Code。 我的工具链是 MSP430-GCC、硬件是 LaunchPad MSP430FR4133
调试设置如下:
但是、调试存在问题。
如果我没有设置断点并且程序正在运行、我就无法中断/停止正在运行的程序。 在我的控制台上,我看到"gdb"和"gdbServer"之间的所有 命令,我看到了 mi-command "-exec-interrupt"的日志。
所以在我看来、停止的命令是发送、但调试器不会中断。
因此、一般运行和闪存都可以正常运行、单步执行代码也可以正常运行、但停止正在运行的 MSP 则不起作用。
有人能 解决我的问题吗?
以下是我使用的所有文件/配置/二进制文件:
- GDB:msp430-elf-gdb v8.1
- GDB-Server: gdb_agent_console v8.0.809.0
-编译器/链接器:msp430-elf-gcc v9.3.1
-板数据文件(用于 gdb_agent_console )
# config version=3.5 $ msp430 msp430_drvr=msp430.dll msp430_port=TIUSB msp430_vcc=3.3 $ /
- Command SO 启动 GDB-Server (在启动.json 在 VS 代码中): gdb_agent_console.exe msp430.dat
-启动 GDB 的命令(在启动.json 在 VS 代码中): msp430-elf-gdb.exe -ex="target remote :55000"-ex="mon erase "-ex="load" main.elf
操作系统: Windows 10
PS:
我在将"mspdebug"或"msp430-gdbproxy"用作 GDB 服务器时遇到同样的问题
非常感谢任何帮助!
忘记添加我的固件代码:
#include <msp430.h> int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode // to activate previously configured port settings P1DIR |= 0x01; // Set P1.0 to output direction P1OUT &= ~0x01; for(;;) { volatile unsigned int i; // volatile to prevent optimization P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR i = 10000; // SW Delay do i--; while(i != 0); } }
它只是一个闪烁的 LED
我认为与代码没有关系。
能否在 CCS 之间进行比较?
抱歉、我对 GCC 工具链的了解不多、TI 已经不再加以管理了...
那么、实际上我让它正常工作。
我只需要插入我最终能够正常工作的 launch.json 文件。
{ "version": "0.2.0", "configurations": [ { "name": "(gdb-server-agent) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/main.elf", "args": [], "stopAtEntry": true, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": false, "logging": { "engineLogging": true, "exceptions": true, "moduleLoad": true, "natvisDiagnostics": true, "programOutput": true, "trace": false, "traceResponse": false }, "MIMode": "gdb", "windows": { "debugServerPath": "${config:msp430_gdb_bin_dir}/gdb_agent_console.exe", "debugServerArgs": "-f MSP430 ${workspaceFolder}/.vscode/msp430.dat", "miDebuggerPath": "${config:msp430_gdb_bin_dir}/msp430-elf-gdb.exe" }, "miDebuggerServerAddress": "localhost:55000", "miDebuggerArgs": "${workspaceFolder}/build/main.elf", "preLaunchTask": "Flash MSP430" } ] }
我使用在我的 settings.json 中声明的变量来定义到 MSP430-GCC 二进制目录的路径(在这个目录中、GDB 和 gdb-agent-console 都位于)。 对于您的设置、您可以只使用绝对路径。
我还删除了到 SVD 文件的路径、这是因为这取决于所使用的微控制器和 SVD 文件的可用性(请见 dhove/tixml2svd :此实用程序从德州仪器(TI) XML 器件和外设描述符文件中创建 SVD 文件。 (github.com) 、如果你想为 MSP430生成 SVD 文件。)
适用于使用 MSP430-GCC 或 TI-CGT 生成的代码