Skip to main content
AHugh.2
Associate III
December 16, 2025
Question

VSCode task to flash gives path argument error after update to STM32Cube Debug Core 1.1.0

  • December 16, 2025
  • 2 replies
  • 780 views

I have a vscode task that allows me to just flash the application using `cube` which has worked fine until I got the lastest extensions update where now running this task will give a "The "path" argument must be of type string. Received undefined" error. 

The task definition (tasks.json):

"type": "shell",
"label": "Program flash",
"command": "cube",
"args": [
 "programmer",
 "-c",
 "port=SWD",
 "-d",
 "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}",
 "-g"
],
"problemMatcher": [], 

Part of the error log:

025-12-16 23:18:12.319 [error] TypeError: The "path" argument must be of type string. Received undefined
at Object.basename (node:path:911:5)
at n (c:\Users\user\.vscode\extensions\stmicroelectronics.stm32cube-ide-debug-core-1.1.0\lib\extension.js:435:4173)
at c:\Users\user\.vscode\extensions\stmicroelectronics.stm32cube-ide-debug-core-1.1.0\lib\extension.js:435:4493

How can I resolve this?

Thanks!

2 replies

Florent V
ST Employee
December 17, 2025

Hi @AHugh.2 ,

 

Please replace the VSCode command :

${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}

with the path to the binary file.
You can use the variable ${workspaceFolder} or an absolute path

${workspaceFolder}/path/to/the/binary

 

KR,

Flo

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AHugh.2
AHugh.2Author
Associate III
December 17, 2025

Thanks for this. However I'm not keen on using explicit paths like this - the previous solution worked nicely since it would deal with configuration/preset changes where the output binary is put into different directories depending on the selected configuration/preset (e.g. debug / release).

Is there any other way to avoid any explicit paths?

Florent V
ST Employee
December 18, 2025

To be honest, before it worked by chance and caused problems in other cases.
The arguments received during the resolution of the VSCode command vary depending on the context (launch.json, tasks.json, etc.).
The process is now safer, but less convenient in your case. I will investigate how to improve it.


KR,
Flo

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.