相同的配置都在vscode使用stm32-jlink中,以下是不同配置:

    1. {
    2. "configurations": [
    3. {
    4. "name": "Win32",
    5. "includePath": [
    6. "${workspaceFolder}/**"
    7. ],
    8. "defines": [
    9. "_DEBUG",
    10. "UNICODE",
    11. "_UNICODE",
    12. "USE_HAL_DRIVER",
    13. "STM32F103xE"
    14. ],
    15. "windowsSdkVersion": "10.0.19041.0",
    16. "compilerPath": "D:/vs studio/SDK/VC/Tools/MSVC/14.32.31326/bin/Hostx64/x64/cl.exe",
    17. "cStandard": "c17",
    18. "cppStandard": "c++17",
    19. "intelliSenseMode": "gcc-arm",
    20. "configurationProvider": "ms-vscode.makefile-tools"
    21. }
    22. ],
    23. "version": 4
    24. }
    1. {
    2. "makefile.extensionOutputFolder": "./.vscode"
    3. }
    1. {
    2. "tasks": [
    3. {
    4. "type": "cppbuild",
    5. "label": "C/C++: gcc.exe 生成活动文件",
    6. "command": "D:/LearnApp/SDK/C/Feil/mingw64/bin/gcc.exe",
    7. "args": [
    8. "-fdiagnostics-color=always",
    9. "-g",
    10. "${file}",
    11. "-o",
    12. "${fileDirname}\\${fileBasenameNoExtension}.exe"
    13. ],
    14. "options": {
    15. "cwd": "D:/LearnApp/SDK/C/Feil/mingw64/bin"
    16. },
    17. "problemMatcher": [
    18. "$gcc"
    19. ],
    20. "group": {
    21. "kind": "build",
    22. "isDefault": true
    23. },
    24. "detail": "调试器生成的任务。"
    25. },
    26. //按照以上格式添加这段
    27. {
    28. "type": "shell",//类型
    29. "label": "Update", //运行任务中的名称
    30. "command": "D:/IOT/STM32/File/openocd-0.10.0/bin/openocd.exe", //执行的命令
    31. "args": [
    32. "-f", //文件
    33. "D:/IOT/STM32/File/openocd-0.10.0/scripts/interface/stlink-v2.cfg",
    34. "-f",
    35. "D:/IOT/STM32/File/openocd-0.10.0/scripts/target/stm32f1x.cfg",
    36. "-c",
    37. "program build/f103zet6One.elf verify reset exit" //build/401CEU6fist.elf: 是你build里面的.elf文件名称和build路径
    38. ],
    39. "problemMatcher": [
    40. "$gcc"
    41. ],
    42. "group": {
    43. "kind": "build",
    44. "isDefault": true
    45. },
    46. "detail": "调试器生成的任务。"
    47. },
    48. //按照最上面的格式添加这段
    49. {
    50. "type": "shell",//类型
    51. "label": "Build",//运行任务中的名称
    52. "command": "make",//执行的命令(需要在环境依赖中有配置)
    53. "args": [
    54. ],
    55. "problemMatcher": [
    56. "$gcc"
    57. ],
    58. "group": {
    59. "kind": "build",
    60. "isDefault": true
    61. },
    62. "detail": "调试器生成的任务。"
    63. }
    64. ],
    65. "version": "2.0.0"
    66. }