Skip to main content
Visitor II
May 24, 2024
Solved

STM32 VS Code Extension Remote Connection

  • May 24, 2024
  • 5 replies
  • 3039 views

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.
    Best answer by JordiD

    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!

    5 replies

    Technical Moderator
    June 6, 2024

    hi @MAdle.1 

    we are already checking this issue

    Explorer
    July 20, 2024

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

    Technical Moderator
    July 22, 2024

    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.1Author
    Visitor II
    October 18, 2024

    Hi @Nawres GHARBI,

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

    MAdle.1Author
    Visitor II
    October 18, 2024

    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.

    JordiDAnswer
    Visitor II
    October 29, 2024

    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!