cancel
Showing results for 
Search instead for 
Did you mean: 

Cube CMake: Unexpected end of JSON input

andreasp00
Associate II

Hello!

I'm trying out the new STM32CubeIDE extensions for VSCode and have generated a CMake project using CubeMX. I'm unable to setup my project as I get this error:

andreasp00_0-1769176582540.png

I don't know what JSON file it is referring to as there are none in my project except the auto-generated CMakePresets.json, but I don't think that's the issue since I get the same error even if I remove that file.

I have tried to re-install the extensions and restart VSCode with no luck.

 

 

 

11 REPLIES 11
Julien D
ST Employee

Hi @andreasp00,

Can you share the CubeMX version and the device/board you are using for this project ?

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

I'm using a fresh installation of CubeMX 6.16.1.

The project is for a custom board using a STM32L476MGY6TR.

Unfortunately, I cannot reproduce the issue.

Could you please open the Developer Tools window (Help > Toggle Developer Tools), switch to the Console tab, and record any errors shown when running your scenario?

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.

andreasp00_0-1769779367324.png

Here is a screenshot of the console output. Right now I'm working in WSL, but I have observed the same issue directly in Windows.

Julien D
ST Employee

It looks like the extension is unable to fetch the list of available bundles from the remote because the received JSON file, which describes the registry content, has an invalid format.

Can you reproduce this failure using the cube bundle list-online command in the VSCode integrated terminal?

Normally you should have:

JulienD_0-1769780622182.png

 

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

The command gives no errors and seem to work fine:

andreasp00_0-1770036939886.png

 

Julien D
ST Employee

Looking back at your first message, you are trying to use an MX project in VSCode, while the error from STM32Cube Project Manager indicates that you tried to create an empty project.

JulienD_0-1770038998923.png

Could you please clarify the sequence of steps?

Normally, when you open an existing MX project in VSCode (File > Open Folder...), you should receive a notification prompting you to complete the initial setup of your project by pressing 'Yes,' enabling you to build and debug it.

JulienD_1-1770039274939.png

 

 

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.

Sorry about the confusion!

The issue seems to occur randomly. Sometimes a restart fixes it. It can happen at any point i.e. Project Creation, Project Setup, Debug etc..

The sequence of steps:

- Generate CMake project using CubeMX

- Edit CMakeLists and project files

- Open project in VSCode

- "Setup STM32Cube project(s)"

Today I got the JSON error while trying to debug a previously working project.

 

No worries, thank you for confirming.

Out of curiosity, do the following commands return a list of devices and boards as it should?

cube pack list devices
cube pack list boards

 

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.