STM32CubeIDE fails in macOS 15.0 Sequoia when trying to run the debugger. The message is "ST-Link Server is required to launch the debug session. Please download it on www.st.com." This is on an M2 Mac using the latest STM downloads.
This has been reported on the STM32 forum but the solution suggested there is "Apparently launching the app from the terminal with sudo solves this, so it appears to be a permissions issue."
I am reluctant to run 3 GBytes of IDE, from outside the app store, with root permissions. Does anyone have any better insight into this bug? Am I being too picky?
I uninstalled STM32CubeIDE entirely, including the settings in Library, and reinstalled it, v 1.16.1, and no change.
Update: Yes it is the PATH available to the app that is the problem, exactly as pyrho suggested.
I asked chatGPT to explain how to find the PATH of a running GUI app. Following those instructions, I typed at a terminal
ps aux | grep STM
and that told me the PID of the running STM32CubeIDE process, that I'd started by clicking on the app icon. It's the number after the username. Then I typed
ps eww <PID> | grep PATH
where <PID>
was the PID I found in the previous step. That told me (among other things) that PATH=/usr/bin:/bin:/usr/sbin:/sbin
which notably does not include /usr/local/bin where the stlink-server lives. Despite the PATH entry in the app's info.plist file.
I tried all this with pyrho's solution of launching the app from my command line. My PATH does include /usr/local/bin. And the ps
tricks above did tell me that the running app did have it in the PATH. However, on hitting debug in the app, it told me "No ST-LINK detected! Please connect ST-LINK and restart the debug session."
So then I tried another chatGPT suggestion. I wrote a shell script launchstm
:
#!/bin/bash
# Modify the PATH to include /usr/local/bin
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# Launch the actual executable within the .app bundle
/Applications/STM32CubeIDE.app/Contents/MacOS/STM32CubeIDE &
I did chmod +x launchstm
and made sure it was in my PATH. Type launchstm
at the terminal and that did actually work. It found my ST_LINK and I can debug again.
Great thanks to pyrho who gave me the hint. I have no idea why his proposed solution didn't work for me, but it put me on the right $PATH.
Had the same issue, you don't need to sudo
.
It seems to be a $PATH
issue, my stlink-server
is located under /usr/local/bin
I guess for some reason the update made it so that Applications do not have this path in their $PATH
environment.
To locate your stlink-server
installation, in a terminal, run $ locate stlink-server
, make sure that path is in your $PATH
environment variable, then launch Cube: /Applications/STM32CubeIDE.app/Contents/MacOS/STM32CubeIDE
.
Works for me.