STM32Tools version: 2.4.0
OS: macOS [your version, e.g. Sequoia 15.x]
Arduino IDE version: [yours]
Package manager: MacPorts
Problem 1: GNU getopt detection doesn't include MacPorts path
The script checks for GNU getopt only at Homebrew paths:
/usr/local/opt/gnu-getopt/bin/getopt
/opt/homebrew/opt/gnu-getopt/bin/getopt
MacPorts installs GNU getopt at /opt/local/bin/getopt, which is not
checked. When neither Homebrew path exists, GNU_GETOPT is set to n
even if a valid GNU getopt is available.
Fix: add a MacPorts check before falling back to n:
elif command -v /opt/local/bin/getopt >/dev/null 2>&1; then
export PATH="/opt/local/bin:$PATH"
Problem 2: Missing short options in getopt option string
Arduino passes -a, -m, and -s to the script but the getopt option
string hi:ef:o:c:r:d:v:p: doesn't include them. Fix: add a:m:s:.
OS: macOS Tahoe
Arduino IDE version: 2.3.10
Upload method: SWD
Board Name: SMT32F1 BluePill
STM32Tools version: 2.4.0
OS: macOS [your version, e.g. Sequoia 15.x]
Arduino IDE version: [yours]
Package manager: MacPorts
Problem 1: GNU getopt detection doesn't include MacPorts path
The script checks for GNU getopt only at Homebrew paths:
/usr/local/opt/gnu-getopt/bin/getopt/opt/homebrew/opt/gnu-getopt/bin/getoptMacPorts installs GNU getopt at
/opt/local/bin/getopt, which is notchecked. When neither Homebrew path exists,
GNU_GETOPTis set toneven if a valid GNU getopt is available.
Fix: add a MacPorts check before falling back to
n:Problem 2: Missing short options in getopt option string
Arduino passes
-a,-m, and-sto the script but the getopt optionstring
hi:ef:o:c:r:d:v:p:doesn't include them. Fix: adda:m:s:.