Skip to main content
Associate
April 2, 2024
Question

STM32CubeIDE user interface freezing in Ubuntu 22.04 Wayland session

  • April 2, 2024
  • 6 replies
  • 2933 views

Hi,

I would like to report that STM32CubeIDE is freezing when running on Wayland session.

The solution I found is to start Ubuntu in a X session.

Best regards,

Daniel

    6 replies

    user7
    Associate
    April 2, 2024

    When does the crash occur? Just after starting or after a while?

    I installed the generic linux version and have no problems. There is a startup script named stm32cubeide_wayland with following content:

    #!/bin/bash

    basedir=$(dirname "$BASH_SOURCE")
    export GDK_BACKEND=x11
    export GTK_THEME=Adwaita
    "$basedir"/stm32cubeide "$@"

     

    The line export GTK_THEME=Adwaita was inserted by me to make the theme work. Give it a try. 

     

    iso9660Author
    Associate
    April 2, 2024

    It is not that the IDE crashes, but it stops updating the window, so it freezes and it is impossible to work with it.

    The configuration in which this happens is:

    iso9660_1-1712084545252.png

    It works fine in X11

     

    iso9660Author
    Associate
    April 2, 2024

    Ok, I will try your solution

     

    The STM32CubeIDE uses this shortcut:

    iso9660_1-1712085299359.png

     

     

    user7
    Associate
    April 2, 2024

    take a look at the contents of the file that you have marked in the screenshot. It has the same name than the file I mentioned. You can open it in your preferred text editor (e.g. kate). Does it have the export GDK_BACKEND=x11 entry? If not, add it. 

    After which time the IDE  stops working? 

    Since CubeIDE is based on Eclipse IDE, maybe there is the problem? Could not find information about this. 

    iso9660Author
    Associate
    April 4, 2024

    I tried your solution (adding Adwaita theme) but it doesn't work.

    The file already contained GDK_BACKEND=x11 theme entry.

    STM32CubeIDE stops working randomly normally when I switch the Window back to STM32CubeIDE after working in another window.

    I am falling back to X11 and it works flawlessly.

    Visitor II
    December 3, 2024

    I've just encountered this problem, today. The answer, for me, was to remove GDK_BACKEND=x11 from /opt/st/stm32cubeide_1.17.0/stm32cubeide_wayland

    Associate
    January 5, 2026

    I was also seeing this problem after a recent upgrade of Ubuntu in which support for X11 was removed (due the upgrade including a Gnome update that doesn't support it anymore).
    Removing GDK_BACKEND=x11 fixed the issue. It's peculiar to see a reference to X11 in a file suffixed _wayland, and I wonder why this line was in there. Perhaps someone from the CubeIDE team can shed some light on this.

    Visitor II
    January 21, 2026

    I had the same issue. As a temporary solution you can run the IDE in terminal like: 
    `unset GDK_BACKEND && /opt/st/stm32cubeide_2.0.0/stm32cubeide`

    or 

    Create a file at ~/.local/share/applications/stm32cubeide-wayland-fixed.desktop with the following content (adjust the
    version path as yours):

    [Desktop Entry]
    Name=STM32CubeIDE
    Comment=STM32CubeIDE with Wayland fix
    GenericName=STM32CubeIDE
    Exec=env -u GDK_BACKEND /opt/st/stm32cubeide_2.0.0/stm32cubeide %F
    Icon=/opt/st/stm32cubeide_2.0.0/icon.xpm
    Path=/opt/st/stm32cubeide_2.0.0/
    Terminal=false
    StartupNotify=true
    Type=Application
    Categories=Development

    The key is using env -u GDK_BACKEND which unsets the variable before launching the IDE. After creating the file, run
    update-desktop-database ~/.local/share/applications and the new launcher will appear in your application search.
    This is not a perfect solution but hopefully resolves the UI freezing part.

    Associate II
    January 30, 2026

    Hello, I tried:

    • adding "export GTK_THEME=Adwaita"
    • removing "GDK_BACKEND=x11"
    • running "`unset GDK_BACKEND && /<path_to_cube_ide>/stm32cubeide`"

    but I have still the IDE that freezes quite often. It seems somehow related at the contextual use of (external) CubeMX or CubeProgrammer; this happened both with version 1.19 and 2.0.

    If someone found some different solutions please let me know, because this behavior is very annoying ;)

    Thank you,
    Giulio