Skip to main content
MAdle.1
Associate II
May 24, 2024 10:39 AM UTC
Solved

STM32 VS Code Extension Remote Connection

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?

This topic has been closed for replies.
JordiDBest answer
Visitor II
Oct 29, 2024 9:28 AM UTC

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!

7 replies

Nawres GHARBI
ST Technical Moderator
Jun 6, 2024 8:26 AM UTC

hi @MAdle.1 

we are already checking this issue

Associate
Jul 20, 2024 2:17 PM UTC

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

Nawres GHARBI
ST Technical Moderator
Jul 22, 2024 8:25 AM UTC

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

MAdle.1
MAdle.1Author
Associate II
Oct 18, 2024 10:34 AM UTC

Hi @Nawres GHARBI,

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

MAdle.1
MAdle.1Author
Associate II
Oct 18, 2024 11:04 AM UTC

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.

JordiDBest answer
Visitor II
Oct 29, 2024 9:28 AM UTC

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!