From c36c23c0b6270a426b09da959f42aa361378c208 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Wed, 11 Nov 2020 17:36:15 -0800 Subject: [PATCH] =?UTF-8?q?debugging=20in=20vscode=20=F0=9F=8E=89=20(#1942?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- .gitmodules | 3 +++ .vscode/extensions.json | 7 +++++ .vscode/launch.json | 30 +++++++++++++++++++-- .vscode/tasks.json | 59 +++++++++++++++++++++++++++++++++++++++++ firmware/ext/cmsis-svd | 1 + 6 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/tasks.json create mode 160000 firmware/ext/cmsis-svd diff --git a/.gitignore b/.gitignore index b0eaa0c043..4955471b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ doxygen/ /.idea workspace.xml java_console_binary -.vscode +.vscode/.* *.cmp *.net err.txt diff --git a/.gitmodules b/.gitmodules index 44a4af1c1c..7b62e9a260 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,3 +15,6 @@ [submodule "hardware/InteractiveHtmlBom"] path = hardware/InteractiveHtmlBom url = https://github.com/openscopeproject/InteractiveHtmlBom.git +[submodule "firmware/ext/cmsis-svd"] + path = firmware/ext/cmsis-svd + url = https://github.com/posborne/cmsis-svd diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..51e530ec51 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "marus25.cortex-debug", + "Gruntfuggly.todo-tree", + "ms-vscode.cpptools" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 843e28df74..375a6017cc 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "version": "0.2.0", "configurations": [ { - "name": "(gdb) Launch", + "name": "Debug Unit Tests", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/unit_tests/build/rusefi_test", @@ -23,6 +23,32 @@ "ignoreFailures": true } ] - } + }, + { + "name": "Debug F40x", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceFolder}", + "executable": "${workspaceRoot}/firmware/build/rusefi.elf", + "device": "STM32F407V", + "v1": false, + "svdFile": "${workspaceRoot}/firmware/ext/cmsis-svd/data/STMicro/STM32F405.svd", + "servertype": "openocd", + "configFiles": ["interface/stlink.cfg", "target/stm32f4x.cfg"], + "runToMain": true + }, + { + "name": "Debug F42x", + "type": "cortex-debug", + "request": "launch", + "cwd": "${workspaceFolder}", + "executable": "${workspaceRoot}/firmware/build/rusefi.elf", + "device": "STM32F429Z", + "v1": false, + "svdFile": "${workspaceRoot}/firmware/ext/cmsis-svd/data/STMicro/STM32F427.svd", + "servertype": "openocd", + "configFiles": ["interface/stlink.cfg", "target/stm32f4x.cfg"], + "runToMain": true + } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000..1d85349c8f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,59 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Build Firmware (Frankenso/default)", + "type": "shell", + "command": "make -j12", + "options": { + "cwd": "${workspaceRoot}/firmware" + }, + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Build Firmware (Proteus F4)", + "type": "shell", + "command": "make -j12 PROJECT_BOARD=proteus", + "options": { + "cwd": "${workspaceRoot}/firmware" + }, + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Build Firmware (microRusEfi F4)", + "type": "shell", + "command": "make -j12 PROJECT_BOARD=microrusefi", + "options": { + "cwd": "${workspaceRoot}/firmware" + }, + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Build Unit Tests", + "type": "shell", + "command": "make -j12", + "options": { + "cwd": "${workspaceRoot}/unit_tests" + }, + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + } + ] +} \ No newline at end of file diff --git a/firmware/ext/cmsis-svd b/firmware/ext/cmsis-svd new file mode 160000 index 0000000000..e5db2387d9 --- /dev/null +++ b/firmware/ext/cmsis-svd @@ -0,0 +1 @@ +Subproject commit e5db2387d9c48359c9c5229a5bb436cf2ed5381f