STLink Upgrade software is written in Java. As of the date this gist was initially written, it did not seem to work with Java natively installed on Apple M1. It requires x86_64 architecture execution under Rosetta.
This guide is about installing Java OpenJDK 17 support via Homebrew x86_64, on Apple M1 machine, in order to be able to run STLinkUpgrade.jar software by ST Microelectronics.
https://www.st.com/en/development-tools/stsw-link007.html
It is similar to installing Homebrew natively, with added arch --x86_64
prefix before the command line:
$ arch --x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
The latest version of Java tested to work with STLinkUpgrade is OpenJDK 17:
$ arch --x86_64 /usr/local/bin/brew install openjdk@17
Homebrew packages for x86_64 architecture requires full path execution on Apple M1:
$ /usr/local/opt/openjdk@17/bin/java -jar STLinkUpgrade.jar
- You may need to give STLinkUpgrade's library permission to execute in Preferences -> Security & Privacy
- You may need to plug in your STLink device before calling STLinkUpgrade.jar