2020-05-25 10:22 AM
Problem running STM32CubeProgrammer Version 2.4.0 on Mac OS Version 10.10.5.
Keeps throwing error "CubeProgrammer_API or one of its dependencies is missing. Please try reinstalling the program or check your java architecture"
java -version returns
java version "1.8.0_251"
Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
Please help. Thanks in advance.
2020-10-30 06:49 AM
Hi @RTN.1
The root cause of this issue may be :
Best regards,
Nesrine
2020-10-31 08:12 PM
Latest version of Oracle JDK 8 (1.8.0_271) did work for me with STM32CubeProgrammer.
To workaround, I've downloaded 1.8.0_251, from the archives: https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html
/usr/libexec/java_home -V
Matching Java Virtual Machines (1):
1.8.0_251, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home
On the machines with multiple JDK versions I am launching the programmer using this shell script:
# Run STM32CubeProgrammer.app in a compatible JRE
#
# e.g. /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
# as it fails to start with the latest JRE (OpenJDK 14.0.1)
JAVA_HOME=`/usr/libexec/java_home -v 1.8` \
open /Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app
Meantime launching programmer command line tool works for me even with latest JDK 14:
/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin/STM32_Programmer_CLI
current version of java:
java -version
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+14)
OpenJDK 64-Bit Server VM (build 14.0.1+14, mixed mode, sharing)
Using latest version of JDK 8 (since 1.8.0_261) STM32CubeProgrammer crashing with following error:
Process: java [1499]
Path: /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/bin/java
Identifier: com.st.stm32cubeprogrammer
Version: 2.4.0 (2.4.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: java [1499]
User ID: 502
Date/Time: 2020-10-31 18:51:40.476 -0700
OS Version: Mac OS X 10.15.7 (19H2)
Report Version: 12
Bridge OS Version: 4.6 (17P6610)
Anonymous UUID: C3E633C8-2F15-9A5C-975C-C63A660EC9A3
Time Awake Since Boot: 1400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x000000013e514000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x2
kernel messages:
VM Regions Near 0x13e514000:
WebKit Malloc 000000013e4fc000-000000013e514000 [ 96K] rw-/rwx SM=ZER
--> mapped file 000000013e514000-000000013e515000 [ 4K] r--/r-x SM=PRV Object_id=e735a625
WebKit Malloc 000000013e515000-000000013e519000 [ 16K] rw-/rwx SM=ZER
Application Specific Information:
dyld: in dlopen()
@rpath/libSTLinkUSBDriver.dylib
and shows launch services error -10810, see https://www.osstatus.com/search/results?platform=all&framework=all&search=-10810
This error and the above crash report indicates to me that newest version of Java is sandboxed on macOS and is unable to load dylib signed with non matching code signing authority.
Hoping future versions of STM32CubeProgrammer will ship with properly working installer and bundled with JRE as macOS app.
2021-01-17 04:04 PM
I have faced the same problem. The workaround I come up with is to remove the signature completely from all the binaries inside the STM32CubeProgrammer.app by executing following command:
find STM32CubeProgrammer.app |xargs -n 1 sudo codesign --remove-signature
Seems like after that, the OSX is happy not having any signature in dynlib and allows java to load them.
Important to note that my setup is kind of hackish, I don't have JRE 1.8 installed in my system. What I did instead is to download jre-8u271-macosx-x64.tar.gz from oracle and unpack it into STM32CubeProgrammer.app/Contents. After that I renamed STM32CubeProgrammer binary to STM32CubeProgrammer.bin.
To make everything run I created follwoing script and named it STM32CubeProgrammer (replacing original binary name):
!/bin/sh
export JAVA_HOME=${0%/*/*/*}/jre1.8.0_271.jre/Contents/Home/
exec $0.bin
Made it executable and vioala - Profit!