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

Neither command seems to work:

andreasp00_0-1770717833448.png

Same error message from the CMake plugin:

andreasp00_1-1770717856874.png

I'm not entirely sure what's going on. I have seen the issue in both WSL and Windows. Can it be something like unix/windows line endings that trips up the plugin?

 

Sorry for the late reply; I was out of the ST Community context for a week.

These two commands indicate an issue with the communication of one of the core utilities named cube-cmsis-scanner. This service runs in the background, listening on port 32125. I wonder if there was an issue starting the process (port already bound to other process, other anything else).

Could you try launching it manually with this command:

cube cmsis-scanner --launch-service

If it fails, please paste the error here.

If it works, please try the two previous commands again in a separate terminal.

 

If the failure is due to the port already being bound to Hyper-V or WinNAT, such as:

CLIENT: Failed to bind 127.0.0.1:32125: Os { code: 10013, kind: PermissionDenied, message: "An attempt was made to access a socket in a way forbidden by its access permissions." }, assuming our service is already running

Then you can try to reserve this port for other applications with these Windows commands:

netsh interface ipv4 show excludedportrange protocol=tcp
net stop winnat
netsh interface ipv4 show excludedportrange protocol=tcp
netsh int ipv4 add excludedportrange protocol=tcp startport=32125 numberofports=1
net start winnat

 

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.