cancel
Showing results for 
Search instead for 
Did you mean: 

Errors converting Eclipse STM32CueIDE project to VSCode

MGO
Associate II

Hello everybody.
I try to convert an STM32CubeIDE project into a CMake project to be used on VSCode using the procedure included in "STM32CubeIDE for Visual Studio Code" extension.
The procedure aborts with this error message:

 
 [Error] [ide-project-convert] Bad escaped character in JSON at position 15583 (line 322 column 55).
 
Line 322 of "stm32cubeide-export.json" file, created by the procedure itself, is this one:

, "option.includepaths": "-I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\application\Display\TouchGFX\generated\texts\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\application\Display\TouchGFX\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\application\Display\TouchGFX\gui\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\application\Display\TouchGFX\generated\gui_generated\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\application\Display\TouchGFX\generated\fonts\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\Middlewares\ST\touchgfx\3rdparty\libjpeg\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\application\Display\TouchGFX\generated\images\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Library\FreeRTOSv10.4.1\Source\include\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Library\FreeRTOSv10.4.1\Source\portable\GCC\ARM_CM4F\", -I\"C:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\Middlewares\ST\touchgfx\framework\include\""

It seems to me that the problem are the single backslashes inside a "quoted" string (double backslash needed?).
How can I solve this issue since the file is automatically created?

Thank you, bye
1 ACCEPTED SOLUTION

Accepted Solutions
Julien D
ST Employee

Hi @MGO,

Indeed, this issue has been spotted in some firmware example projects as well. We are currently working on it and hope to deliver a fix soon.

In the meantime, if you want to try the project conversion, you can do it from the CLI after duplicating your JSON file somewhere else on your disk and fixing it by escaping the backslashes (\) with double backslashes (\\).

Then run:

cube ide-project-convert --bypass-converter <path_to_stm32cubeide-export.json> --source-format stm32cubeide --destination <cmake_project_location> --format cmake

Hope this helps.

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.

View solution in original post

8 REPLIES 8
Julien D
ST Employee

Hi @MGO,

Indeed, this issue has been spotted in some firmware example projects as well. We are currently working on it and hope to deliver a fix soon.

In the meantime, if you want to try the project conversion, you can do it from the CLI after duplicating your JSON file somewhere else on your disk and fixing it by escaping the backslashes (\) with double backslashes (\\).

Then run:

cube ide-project-convert --bypass-converter <path_to_stm32cubeide-export.json> --source-format stm32cubeide --destination <cmake_project_location> --format cmake

Hope this helps.

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.
ShadowOnWiiU
Associate

Thank you @Julien D for the fix!

I had a similar issue with this line in my export json:

"option.directories": "["${workspace_loc:/${ProjName}/Middlewares/ST/STM32_Audio/Addons/SRC441/Lib}"]"

where the inner quotation marks weren't being escaped. I fixed it by putting a backslash infront of the inner quotation marks. Hope this helps someone at some point!

Thank you @ShadowOnWiiU for your valuable feedback.

You are right; some parts of the JSON may not respect the format depending on the input project. This lack of quote escaping has been tracked on our side, and a fix is on its way.

The variable resolution issue is being addressed as well.

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.
cube ide-project-convert --bypass-converter ../123/stm32cubeide-export.json --source-format stm32cubeide --destination ../123 --format cmake
2026-03-16 11:19:01.530 [Info] Generating project...
2026-03-16 11:19:02.358 [Error] Inconsistent source files found across project configurations is not supported.

 修改好后,出现错误,还需要什么配置吗?

Hi @Oliver_yydd,

The current version of the tools requires having the same sources across all configurations defined in the exported JSON file. This was a deliberate choice made for the first version.

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.
MGO
Associate II

Other warnings and errors on folders:

[Warn] Issue copying headers: Error: ENOENT: no such file or directory, lstat 'c:\Repo_mgo\STM32Workspace\NGDrive\Appl\dDrive_Fwk2\Repo_mgo\STM32Workspace\NGDrive\Library\STM32H7xx\Drivers\CMSIS\Device\ST\STM32H7xx\Include"'

The RED part of the path above is wrong, appended erroneously.
There are many of these warnings.

 

[Error] EPERM: operation not permitted, copyfile 'c:\Repo_mgo\STM32Workspace\NGDrive\Library\STM32H7xx\Drivers' -> 'C:\Repo_mgo\STM32Workspace\NGDrive\VSCode\dDrive_Fwk2\Library\STM32H7xx\Drivers'

In this case paths are correct, but I get an "operation not permitted" error.
After this error the procedure aborts.

Hi @MGO,

Apologize for late replying. What you describe has been reproduced and analyzed. This is tracked by an internal ticket.

It happens when your include paths are defined with absolute path in your STM32CubeIDE (Eclipse based) project definition, you can workaround it by using relative paths within it instead.

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.

Hi Julien D.

Thank you for the reply, I am going to apply your workaround.