Skip to main content
Graduate II
July 16, 2024
Question

STM32CubeMX Hangs When Launched from VSCode

  • July 16, 2024
  • 6 replies
  • 2865 views

I am running VSCode on Fedora 39 with the latest STM32 VSCode extensions.

I am using STM32CubeMX 6.12.0.

First, STM32CubeMX is not the default action when clicking on the IOC file. It is rather surprising that it is opened in a text editor in VSCode. However, the real problem is that when I right-click on the IOC file in VSCode and select "Open with STM32CubeMX", STM32CubeMX starts up, begins reading the IOC file, and just hangs, never completing the action. This is all I see:

RobRiggs_0-1721158216320.png

The window is unresponsive. I cannot close it. I need to then manually find the Java process and kill -9 it to resume normal operations. If I start STM32CubeMX manually from the command-line, it works fine. I have verified that both are using the same JRE.

What is causing this and are there any work-arounds?

    This topic has been closed for replies.

    6 replies

    Technical Moderator
    July 17, 2024

    Hi @Rob.Riggs 

    we are aware of this issue and trying to fix it, unfortunately won't be possible for the next release (in the coming days)

    Technical Moderator
    July 18, 2024
    Rob.RiggsAuthor
    Graduate II
    July 18, 2024

    @Nawres GHARBI I updated the extension (and have restarted VS Code numerous times) and still see the same behavior. One new thing I did discover while testing the new extension it is that STM32CubeMX will complete loading if I exit VSCode (File|Exit) while it is stuck loading the IOC file.

    Technical Moderator
    July 19, 2024

    hi @Rob.Riggs 

    could you please clean you environment uninstall completely the extension restart VSCode and install it again

    If the issue persists could you please share these information:

    version of Fedora

    version of STM32CubeMX

    log file of STM32CubeMX

    Rob.RiggsAuthor
    Graduate II
    July 19, 2024

    @Nawres GHARBI I removed the STM32 plugin, restarted VS Code, installed the STM32 plugin, and then restarted VS Code again. I still see the same behavior.

    I am running Fedora 39.

    I am running STM32CubeMX 6.12.0.

    RobRiggs_0-1721415570655.png

     

    VS Code shows this in Help|About:

    Version: 1.91.1
    Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
    Date: 2024-07-09T22:08:12.169Z
    Electron: 29.4.0
    ElectronBuildId: 9728852
    Chromium: 122.0.6261.156
    Node.js: 20.9.0
    V8: 12.2.281.27-electron.0
    OS: Linux x64 6.9.9-100.fc39.x86_64

    I verified that I am running the new version of the STM32 plugin.

    RobRiggs_1-1721416080849.png

    I am including 2 log files. The first shows the log up to the point where it is stuck after being launched by VS Code. The second contains the first, but also shows the remainder which occurs after I exit VS Code which allowed STM32CubeMX to complete start-up.

    Rob.RiggsAuthor
    Graduate II
    July 19, 2024

    I have found a hack to work around the problem for now. Maybe it will help identify the root cause of the problem.

    Rename the executable STM32CubeMX to STM32CubeMX.jar, and replace STM32CubeMX with this shell script:

    #!/bin/bash

    CMD=$(readlink -f $0)
    DIR=$(dirname ${CMD})

    nohup ${DIR}/STM32CubeMX.jar $* &

     

    Replacing the executable is necessary because the STM32 VS Code extension apparently ignores the setting below when launching STM32CubeMX. This seems like a bug to me.

     

    STM32 VSCode Extension › Project Creator: Executable Path
    Absolute path to the STM32CubeMX executable
    Technical Moderator
    July 22, 2024

    Thanks @Rob.Riggs  for the details we are trying to get the issue

    Technical Moderator
    July 23, 2024

    Hi @Rob.Riggs 

    We have some more questions please

    • How was installed ST Tools ? Root or simple user ?
    • VSCode running: With CLI or GUI ?
    • VSCode not saving CubeMX absolute path (Executable path) in the setting, is affecting also CubeCLT Path?

    Rob.RiggsAuthor
    Graduate II
    July 23, 2024
    1. ST tools were installed info /opt/st as root. stm32cubeclt was installed via RPM, others via tar.gz & shell script.
    2. VSCode is running with GUI on Gnome desktop.
    3. I should be clear that the path to CubeMX is saved, and it is used by STM32 VSCode extension to launch CubeMX to create a new project. It does not use this path when opening an existing IOC file (right-click, "Open With STM32CubeMX" using vscode-embedded.openWithStm32CubeMx). I do not know when the STM32 VSCode extension would use the CubeCLT path.

    RobRiggs_0-1721756646185.png

    Looking at this more closely, this is coming from Microsoft's Embedded Tools Extension. The STM32 VS Code Extension provides no way to easily open an existing IOC file directly from the VSCode UI.

    So, to be clear, the problem with STM32CubeMX hanging when launched from VSCode is occurring in Microsoft's Embedded Tools Extension, not in STM32 VSCode Extension.

    @Nawres GHARBI Please fix STM32CubeMX to work with Microsoft's Embedded Tools Extension or work with Microsoft to fix their embedded tools extension to work with STM32CubeMX. Also, please enhance the STM32 VSCode Extension to provide a function similar to vscode-embedded.openWithStm32CubeMx so that users can easily open existing IOC files. In fact, the default action when clicking on an IOC file should be to open the file using STM32CubeMX when the STM32 VSCode Extension is installed and enabled. That is not the case today.