Change:
{ fdupes <ins> , buildFHSEnv </ins> , fetchzip , icoutils , imagemagick , jdk17 , lib , makeDesktopItem <del> , stdenv </del> <ins> , stdenvNoCC </ins> }: let iconame = "STM32CubeMX"; <del> in stdenv.mkDerivation rec { pname = "stm32cubemx"; version = "6.10.0"; </del> <ins> package = stdenvNoCC.mkDerivation rec { pname = "stm32cubemx"; version = "6.10.0"; </ins> <del> src = fetchzip { url = "https://sw-center.st.com/packs/resource/library/stm32cube_mx_v${builtins.replaceStrings ["."] [""] version}-lin.zip"; sha256 = "sha256-B5Sf+zM7h9BiFqDYrLS0JdqZi3dGy6H9gAaJIN3izeM="; stripRoot = false; }; nativeBuildInputs = [ fdupes icoutils imagemagick ]; desktopItem = makeDesktopItem { name = "STM32CubeMX"; exec = "stm32cubemx"; desktopName = "STM32CubeMX"; categories = [ "Development" ]; icon = "stm32cubemx"; comment = meta.description; terminal = false; startupNotify = false; mimeTypes = [ "x-scheme-handler/sgnl" "x-scheme-handler/signalcaptcha" ]; }; </del> <ins> src = fetchzip { url = "https://sw-center.st.com/packs/resource/library/stm32cube_mx_v${builtins.replaceStrings ["."] [""] version}-lin.zip"; sha256 = "sha256-B5Sf+zM7h9BiFqDYrLS0JdqZi3dGy6H9gAaJIN3izeM="; stripRoot = false; }; </ins> <del> buildCommand = '' mkdir -p $out/{bin,opt/STM32CubeMX,share/applications} </del> <ins> nativeBuildInputs = [ fdupes icoutils imagemagick ]; desktopItem = makeDesktopItem { name = "STM32CubeMX"; exec = "stm32cubemx"; desktopName = "STM32CubeMX"; categories = [ "Development" ]; icon = "stm32cubemx"; comment = meta.description; terminal = false; startupNotify = false; mimeTypes = [ "x-scheme-handler/sgnl" "x-scheme-handler/signalcaptcha" ]; }; </ins> <del> cp -r $src/MX/. $out/opt/STM32CubeMX/ chmod +rx $out/opt/STM32CubeMX/STM32CubeMX </del> <ins> buildCommand = '' mkdir -p $out/{bin,opt/STM32CubeMX,share/applications} </ins> <del> cat << EOF > $out/bin/${pname} #!${stdenv.shell} ${jdk17}/bin/java -jar $out/opt/STM32CubeMX/STM32CubeMX EOF chmod +x $out/bin/${pname} </del> <ins> cp -r $src/MX/. $out/opt/STM32CubeMX/ chmod +rx $out/opt/STM32CubeMX/STM32CubeMX </ins> <del> icotool --extract $out/opt/STM32CubeMX/help/${iconame}.ico fdupes -dN . > /dev/null ls for size in 16 24 32 48 64 128 256; do mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps if [ $size -eq 256 ]; then mv ${iconame}_*_"$size"x"$size"x32.png  $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png else convert -resize "$size"x"$size" ${iconame}_*_256x256x32.png  $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png fi done; </del> <ins> cat << EOF > $out/bin/${pname} #!${stdenvNoCC.shell} ${jdk17}/bin/java -jar $out/opt/STM32CubeMX/STM32CubeMX EOF chmod +x $out/bin/${pname} </ins> <del> cp ${desktopItem}/share/applications/*.desktop $out/share/applications ''; </del> <ins> icotool --extract $out/opt/STM32CubeMX/help/${iconame}.ico fdupes -dN . > /dev/null ls for size in 16 24 32 48 64 128 256; do mkdir -pv $out/share/icons/hicolor/"$size"x"$size"/apps if [ $size -eq 256 ]; then mv ${iconame}_*_"$size"x"$size"x32.png  $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png else convert -resize "$size"x"$size" ${iconame}_*_256x256x32.png  $out/share/icons/hicolor/"$size"x"$size"/apps/${pname}.png fi done; </ins> <del> meta = with lib; { description = "A graphical tool for configuring STM32 microcontrollers and microprocessors"; longDescription = '' A graphical tool that allows a very easy configuration of STM32 microcontrollers and microprocessors, as well as the generation of the corresponding initialization C code for the Arm® Cortex®-M core or a partial Linux® Device Tree for Arm® Cortex®-A core), through a step-by-step process. </del> <ins> cp ${desktopItem}/share/applications/*.desktop $out/share/applications </ins> ''; <del> homepage = "https://www.st.com/en/development-tools/stm32cubemx.html"; sourceProvenance = with sourceTypes; [ binaryBytecode ]; license = licenses.unfree; maintainers = with maintainers; [ angaz wucke13 ]; platforms = platforms.all; </del> <ins> meta = with lib; { description = "A graphical tool for configuring STM32 microcontrollers and microprocessors"; longDescription = '' A graphical tool that allows a very easy configuration of STM32 microcontrollers and microprocessors, as well as the generation of the corresponding initialization C code for the Arm® Cortex®-M core or a partial Linux® Device Tree for Arm® Cortex®-A core), through a step-by-step process. ''; homepage = "https://www.st.com/en/development-tools/stm32cubemx.html"; sourceProvenance = with sourceTypes; [ binaryBytecode ]; license = licenses.unfree; maintainers = with maintainers; [ angaz wucke13 ]; platforms = [ "x86_64-linux" ]; }; </ins> }; <ins> in buildFHSEnv { inherit (package) pname meta; runScript = "${package.outPath}/bin/stm32cubemx"; targetPkgs = pkgs: with pkgs; [ alsa-lib at-spi2-atk cairo cups dbus expat glib gtk3 libdrm libGL libudev0-shim libxkbcommon mesa nspr nss pango xorg.libX11 xorg.libxcb xorg.libXcomposite xorg.libXdamage xorg.libXext xorg.libXfixes xorg.libXrandr ]; </ins> }

Discussion:
When clicking "GENERATE CODE" nothing happens, and I get the error from title in the console log. I'm not familiar with java but I guess newer cubemx versions require some browser like functionality which failed to init within java runtime due missing .so dependencies. Startup Info: Relevant error log: Spawn shell with stm32cubemx using . Create CubeMX project Generate Code Generated project folder with confirmation window.
After further investigation I think CubeMX is trying to execute binaries found in , which were downloaded during the first startup. I'm not sure if this is fixable without FHS env.
This bug kind of kills my workflow. Has anyone investigated further? I will try to work things out during the weekend.
I've kinda got it to work using FHS env. Only issue I have is that the CubeMX now requires login for code generation, and the login window (embedded browser) takes a while to appear on Wayland (Sway) and uses a lot of the CPU for no reason, while it appears OK on X11. Though you only need to login once, and than it works normaly. I have updated package here : https://git.project- I guess I shold make a pull request out of it.
It is sad to see ST hurt us like this. I would appreciate a PR, it seems to be a good solution. You can ping me and I'll have a look. Not really sure what we can do about the wait and high CPU. I think getting the package usable again, and then trying to fix that problem sounds like a good way to progress.
Thanks for the fast replies! Do you recall how you approached debugging the issue? EDIT: Turns out I get a similar but not identical error: This occurs at startup then clicking generate fails due to missing browser instance. Running the jar directly with JxBrowser logs gives: which is not much. nix-info:
thanks, will make PR over the weekend most likely I got simmilar error when I wanted to keep pached ~/.stm32cubemx/.../Chromium by setting chattr +i. So cube didn't get permissions to extract Chromium and failed. Maybe try to remove/backup ~/.stm32cubemx and try again.
I have deleted multiple times while doing these checks, and it doesn't change anything.

Than please try to run it with steam-run, maybe extractor is missing something too. Also please try my package linked above. It's a closed source app so we are verry limited... Edit: Now I see you are using aarch64, I'm not sure if Cube will support that even though it's java. Please check what kind of binary do you get in ~/.stm32cubemx/.../Chromium
There are no binaries under the folder, only the lock file. JxBrowser does seem to support aarch64 linux but maybe there is something wrong at the cubemx side. Thanks for your help!
JxBrowser seems packed into CubeMX. Maybe indicates that they didn't put arm version.
Yea, that is possible. Thanks for the help! EDIT: It seems that the .7z bundle that JxBrowser provides is corrupted for linux arm.
Coincidentally, I also tried to get this running last week inside an FHS env, but even with (basically) all dependencies in there (and in x86_64), one of the chromium child processes crashed in some udev function. It also tried to load some very old libraries like , for some reason. Just patching our own chromium in there and preventing it from modifying it might be a better solution, if it can be made to work.