Skip to main content
Graduate
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
  • 132 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!

    This topic has been closed for replies.

    2 replies

    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

     

    AHugh.2Author
    Graduate
    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?

    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