赞
踩
帮助: CYGWIN:https://cygwin.com/
ARM: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
OPENOCD:http://openocd.org/
STM32-LINK UTILITY:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.html
STM32CUBE:https://www.st.com/en/embedded-software/stm32cubef4.html
- {
- "configurations": [
- {
- "name": "Win32",
- "includePath": [
- "${workspaceFolder}/**"
- ],
- "defines": [
- "_DEBUG",
- "UNICODE",
- "_UNICODE"
- ],
- "compilerPath": "/usr/bin/gcc",
- "cStandard": "c11",
- "cppStandard": "c++17",
- "intelliSenseMode": "clang-x64"
- }
- ],
- "version": 4
- }
- {
- "version": "0.2.0",
- "configurations": [
-
- {
- "name": "ARM Debug",
- "type": "cppdbg",
- "request": "launch",
- "miDebuggerPath": "C:/Program Files (x86)/GNU Tools Arm Embedded/5.4 2016q3/bin/arm-none-eabi-gdb.exe",
- "targetArchitecture": "arm",
- "program": "${workspaceRoot}/build/pwmTest.elf",
- "setupCommands": [
- {
- "text": "file 'C:/Users/Cairne/OneDrive/Code/stm32/nucleo/PWMTest/CubeMX/PWMTest/build/pwmTest.elf'"
- },
- {
- "text": "target remote localhost:3333"
- },
- {
- "text": "monitor reset"
- },
- {
- "text": "monitor halt"
- },
- {
- "text": "load"
- }
- ],
- "preLaunchTask": "build",
- "launchCompleteCommand": "None",
- "externalConsole": true,
- "cwd": "${workspaceRoot}"
- }
- ]
- }
关于端口的解释:
- PS C:\OpenOCD-20190828-0.10.0\share\openocd\scripts\interface> openocd -v
- Open On-Chip Debugger 0.10.0 (2019-08-28) [https://github.com/sysprogs/openocd]
- Licensed under GNU GPL v2
- For bug reports, read
- http://openocd.org/doc/doxygen/bugs.html
来查看是否安装成功,然后安装成功STLINK驱动后可以查到到
这个设备。
- openocd -f .\stlink-v2-1.cfg -f C:\OpenOCD-20190828-0.10.0\share\openocd\scripts\target\stm32f3x.cfg
- Open On-Chip Debugger 0.10.0 (2019-08-28) [https://github.com/sysprogs/openocd]
- Licensed under GNU GPL v2
- For bug reports, read
- http://openocd.org/doc/doxygen/bugs.html
- WARNING: interface/stlink-v2-1.cfg is deprecated, please switch to interface/stlink.cfg
- Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
- Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
- Info : Listening on port 6666 for tcl connections
- Info : Listening on port 4444 for telnet connections
- Info : clock speed 1000 kHz
- Info : STLINK V2J28M17 (API v2) VID:PID 0483:374B
- Info : Target voltage: 3.252528
- Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
- Info : Listening on port 3333 for gdb connections
- Info : accepting 'gdb' connection on tcp/3333
可以看到端口是3333,对应上面的VSCODE的配置文件里的设置。可以在每次调试前输入这个命令以连上openocd。或者在launch.json里写一个任务,每次调试之前都自动连接。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。