From 82b1fd1326d82d2978bb96530168bcb8eb438370 Mon Sep 17 00:00:00 2001 From: Nick Williams <5554798+metanoic@users.noreply.github.com> Date: Sun, 22 Jul 2018 10:12:25 -0500 Subject: [PATCH 1/2] taskName is deprecated. Use 'label' instead. https://github.com/Microsoft/vscode/issues/29852 --- Firmware/.vscode/tasks.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Firmware/.vscode/tasks.json b/Firmware/.vscode/tasks.json index 2376b650..d5b7d969 100644 --- a/Firmware/.vscode/tasks.json +++ b/Firmware/.vscode/tasks.json @@ -4,7 +4,7 @@ "version": "2.0.0", "tasks": [ { - "taskName": "build", + "label": "build", "type": "shell", "command": "make", "group": { @@ -19,13 +19,13 @@ ] }, { - "taskName": "flash", + "label": "flash", "type": "shell", "command": "make flash", "problemMatcher": [] }, { - "taskName": "openocd", + "label": "openocd", "type": "shell", "command": "openocd -f \"interface/stlink-v2.cfg\" -f \"target/stm32f4x_stlink.cfg\" -c \"gdb_port 3333; log_output openocd.log\"", "problemMatcher": [] From f05cfa01a98134cd411c57caae740bfee65864b4 Mon Sep 17 00:00:00 2001 From: Nick Williams <5554798+metanoic@users.noreply.github.com> Date: Sun, 22 Jul 2018 10:31:11 -0500 Subject: [PATCH 2/2] add flashbmp to makefile and accompanying task --- Firmware/.vscode/launch.json | 18 ++++++++++++++++-- Firmware/.vscode/tasks.json | 8 +++++++- Firmware/Makefile | 9 +++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Firmware/.vscode/launch.json b/Firmware/.vscode/launch.json index 71e7db4c..1b99a2a6 100644 --- a/Firmware/.vscode/launch.json +++ b/Firmware/.vscode/launch.json @@ -9,7 +9,7 @@ "type": "cortex-debug", "servertype": "openocd", "request": "launch", - "name": "Debug ODrive", + "name": "Debug ODrive - ST-Link", "executable": "${workspaceRoot}/build/ODriveFirmware.elf", "configFiles": [ "interface/stlink-v2.cfg", @@ -22,7 +22,7 @@ "type": "cortex-debug", "servertype": "openocd", "request": "launch", - "name": "Debug ODrive - FreeRTOS", + "name": "Debug ODrive - ST-Link - FreeRTOS", "executable": "${workspaceRoot}/build/ODriveFirmware.elf", "rtos": "FreeRTOS", "configFiles": [ @@ -31,5 +31,19 @@ ], "cwd": "${workspaceRoot}" }, + { + // For the Cortex-Debug extensions + "type": "cortex-debug", + "servertype": "bmp", + "request": "launch", + "name": "Debug ODrive - Black Magic Probe", + "executable": "${workspaceRoot}/build/ODriveFirmware.elf", + "device": "STM32F4xx", + "BMPGDBSerialPort": "${env:BMP_PORT}", + "interface": "swd", + "targetId": 1, + "armToolchainPath": "${env:ARM_GCC_ROOT}/bin/", + "cwd": "${workspaceRoot}" + } ] } \ No newline at end of file diff --git a/Firmware/.vscode/tasks.json b/Firmware/.vscode/tasks.json index d5b7d969..c82adc83 100644 --- a/Firmware/.vscode/tasks.json +++ b/Firmware/.vscode/tasks.json @@ -19,11 +19,17 @@ ] }, { - "label": "flash", + "label": "flash - ST-Link", "type": "shell", "command": "make flash", "problemMatcher": [] }, + { + "label": "flash - Black Magic Probe", + "type": "shell", + "command": "make flashbmp", + "problemMatcher": [] + }, { "label": "openocd", "type": "shell", diff --git a/Firmware/Makefile b/Firmware/Makefile index 82ae758c..b498343c 100644 --- a/Firmware/Makefile +++ b/Firmware/Makefile @@ -20,6 +20,15 @@ flash: all -c 'reset run' \ -c exit +flashbmp: all + arm-none-eabi-gdb --ex 'target extended-remote $(BMP_PORT)' \ + --ex 'monitor swdp_scan' \ + --ex 'attach 1' \ + --ex 'load' \ + --ex 'detach' \ + --ex 'quit' \ + $(FIRMWARE) + gdb: all arm-none-eabi-gdb $(FIRMWARE) -x openocd.gdbinit