Page 1 of 1

[macOS] stm32CubeProg.sh: getopt: illegal option -- o

Posted: Fri Jul 05, 2024 7:27 am
by Kenjutsu
Hello everyone.

Today I upgraded to Arduino_Core_STM32 2.8.0 (from 2.7.1) using Arduino IDE Version: 2.3.2.

When I tried to upload to a BluePill using STM32CubeProgrammer (SWD), I get the following error:
"" sh "/Users/ZZZZ/Library/Arduino15/packages/STMicroelectronics/tools/STM32Tools/2.2.2/stm32CubeProg.sh" -i swd -f "/private/var/folders/tq/dqrghm993td49tz1pvg8psxm0000gn/T/arduino/sketches/D5AFD427BFFBF8805E002A2460D8199D/Blink.ino.bin" -o 0x0
getopt: illegal option -- o
Terminating...
Failed uploading: uploading error: exit status 1
I also tried a F411 BlackPill with the same error:
"" sh "/Users/ZZZZ/Library/Arduino15/packages/STMicroelectronics/tools/STM32Tools/2.2.2/stm32CubeProg.sh" -i swd -f "/private/var/folders/tq/dqrghm993td49tz1pvg8psxm0000gn/T/arduino/sketches/35A84DEC798681261AC7D05DB0A8B048/Blink.ino.bin" -o 0x0
getopt: illegal option -- o
Terminating...
Failed uploading: uploading error: exit status 1
And with STM32CubeProgrammer (DFU)
"" sh "/Users/ZZZZ/Library/Arduino15/packages/STMicroelectronics/tools/STM32Tools/2.2.2/stm32CubeProg.sh" -i dfu -f "/private/var/folders/tq/dqrghm993td49tz1pvg8psxm0000gn/T/arduino/sketches/35A84DEC798681261AC7D05DB0A8B048/Blink.ino.bin" -o 0x0 -v 0x0483 -p 0xdf11
getopt: illegal option -- o
Terminating...
Failed uploading: uploading error: exit status 1
Running just the following in the terminal:
sh /Users/ZZZZ/Library/Arduino15/packages/STMicroelectronics/tools/STM32Tools/2.2.2/stm32CubeProg.sh
also gives:
getopt: illegal option -- o
Terminating...
Sanity-check:
  1. uninstall 2.8.0, and re-install: same error
  2. uninstall 2.8.0 and install 2.7.1: everything working again

Re: [macOS] stm32CubeProg.sh: getopt: illegal option -- o

Posted: Fri Jul 05, 2024 7:31 am
by fpiSTM
Hi @Kenjutsu
This is already tracked. See https://github.com/stm32duino/Arduino_Tools/issues/99
A Pr exist with an updated script.

Re: [macOS] stm32CubeProg.sh: getopt: illegal option -- o

Posted: Fri Jul 05, 2024 7:14 pm
by Kenjutsu
Thank you @fpiSTM !

That solved the problem. 8-)