cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 VS Code Extension Remote Connection

MAdle.1
Associate II

When working in remote connections, such as WSL or docker the STM32 extension can not be activated with the following error:
"Cannot activate the 'STM32 VS Code Extension' extension because it depends on the 'C/C++ Extension Pack' extension, which is not loaded. Would you like to reload the window to load the extension?"

But the C/C++ extension is loaded and working.

Is there any Work Around available?

6 REPLIES 6
Nawres GHARBI
ST Employee

hi @MAdle.1 

we are already checking this issue

Any updates on this? I'm seeing it with latest version.

Nawres GHARBI
ST Employee

Hi @dmainz  

still working on it not yet fixed

but I invite you to check this post it may help you as a workaround 

https://community.st.com/t5/stm32-vscode-extension-mcus/stm32-vs-code-extension-and-devcontainer/td-p/659247/page/2

Hi @Nawres GHARBI,

is there a solution coming, or does this issue doesn't have any priority? 

MAdle.1
Associate II

Hello together, hello @Nawres GHARBI 

with the help of https://community.st.com/t5/stm32-vscode-extension-mcus/stm32-vs-code-extension-and-devcontainer/td-p/659247/page/2 I found a solution which works for me.

My setup I'm running a devcontainer inside WSL, so the remote connection is windows -> wsl -> devcontainer. For me it seems that the STM32 VSCode must run in the devcontainer and must be disabled in the local installation (like some other extensions). There are two problems, first the extension itself doesn't give the opportunity to install it anywhere else than in the local installation (windows).  To get around the issue you have install it locally and then press the cloud symbol on the dev container section in the Extension Tab. Then you can select the STM32 extension to installed in the devcontainer.

MAdle1_0-1729249157488.png

The second issue is that, the that instance which is locally installed is not disabled, instead it is still the main instance searching for c++ extension, which locally disabled and enabled in the devcontainer. A solution is now do uninstall the STM32 extension locally. After that reload the vscode and the extension should work in the devcontainer.
I hope this helps finding a solution to get the extension working out of the box.

JordiD
Associate

Suggested Workaround:

  • Open the Command Palette by pressing Ctrl + Shift + P.
  • Search for "Preferences: Open Settings (JSON)" and select it to open your settings.json file.
  • Add the following code snippet to force the STM32 extension to run remotely in WSL:
"remote.extensionKind": {
"stmicroelectronics.stm32-vscode-extension": [
"workspace"
]
}
  • Save the file, then restart VS Code.
  • Finally, install the extension directly in WSL. You should now see the option to install it in the WSL environment.

Hope this helps!