From 53de825c4c4d8325c02341177f62ab84897eb5ee Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sat, 25 Jul 2026 22:09:43 +0800
Subject: [PATCH] update vscode task.json and add stm32flash tools

---
 ex1.ws2812b/.vscode/tasks.json |   43 +++++++++++++------------------------------
 1 files changed, 13 insertions(+), 30 deletions(-)

diff --git a/ex1.ws2812b/.vscode/tasks.json b/ex1.ws2812b/.vscode/tasks.json
index c8d0ec6..3079dd6 100644
--- a/ex1.ws2812b/.vscode/tasks.json
+++ b/ex1.ws2812b/.vscode/tasks.json
@@ -2,22 +2,16 @@
     "version": "2.0.0",
     "tasks": [
         {
-            "label": "STM32: Flash via ST-Link(SWD)",
+            "label": "STM32: Flash via ST-Link (SWD)",
             "type": "shell",
-            "command": "D:\\Program Files\\ST\\STM32CubeProgrammer\\bin\\STM32_Programmer_CLI.exe",
+            "command": "cube",
             "args": [
-                "-c port=SWD",
-                "-e all",
-                "-w",
-                "${workspaceFolder}\\build\\Release\\ISKBoard.elf",
-                "0x08000000",
-                "-v",
+                "programmer",
+                "-c", "port=SWD", "freq=4000", "reset=HWrst",
+                "-w", "${workspaceFolder}\\build\\Release\\ISKBoard.elf",
                 "-rst"
             ],
-            "group": {
-                "kind": "build",
-                "isDefault": false
-            },
+            "group": "build",
             "problemMatcher": [],
             "presentation": {
                 "reveal": "always",
@@ -26,26 +20,15 @@
             }
         },
         {
-            "label": "STM32: Flash via stm32flash(UART)",
+            "label": "STM32: Flash via Serial (UART)",
             "type": "shell",
-            "command": "${workspaceFolder}/.vscode/stm32flash.bat",
+            "command": "cube",
             "args": [
-                "${input:comPort}"
+                "programmer",
+                "--connect", "port=${input:comPort}",
+                "-w", "${workspaceFolder}\\build\\Release\\ISKBoard.elf"
             ],
-            "options": {
-                "env": {
-                    "PATH": "${env:PATH}",
-                    "SystemRoot": "${env:SystemRoot}",
-                    "GCC_BIN": "${env:LOCALAPPDATA}\\stm32cube\\bundles\\gnu-tools-for-stm32\\14.3.1+st.2\\bin",
-                    "ELF": "${workspaceFolder}\\build\\Release\\ISKBoard.elf",
-                    "BIN": "${workspaceFolder}\\build\\Release\\ISKBoard.bin",
-                    "FLASH_EXE": "${workspaceFolder}\\.vscode\\stm32flash.exe"
-                }
-            },
-            "group": {
-                "kind": "build",
-                "isDefault": false
-            },
+            "group": "build",
             "problemMatcher": [],
             "presentation": {
                 "reveal": "always",
@@ -62,4 +45,4 @@
             "default": "COM22"
         }
     ]
-}
\ No newline at end of file
+}

--
Gitblit v1.10.0