# DFU not working in Arduino IDE (MacOS)

**URL:** <https://discuss.blues.com/t/dfu-not-working-in-arduino-ide-macos/3492>\
**Category:** Tools & SDKs\
**Tags:** arduino, dfu\
**Created:** [March 10, 2026, 10:30pm UTC](https://discuss.blues.com/t/dfu-not-working-in-arduino-ide-macos/3492 "2026-03-10T22:30:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [March 10, 2026, 10:30pm UTC](https://discuss.blues.com/t/dfu-not-working-in-arduino-ide-macos/3492/1 "2026-03-10T22:30:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/2X/d/d4dbe1642a4273d4e7ffa14de8611cc7072db2ae.png)

When I try to flash firmware using DFU from the latest Arduino IDE, I’m encountering the following error:

```  
sh “/Users/rozzie/Library/Arduino15/packages/STMicroelectronics/tools/STM32Tools/2.4.0/stm32CubeProg.sh” -i dfu -f “/Users/rozzie/Library/Caches/arduino/sketches/EE382C7E844F687B7316224527814660/host.ino.bin” -o 0x0 -v 0x0483 -p 0xdf11 -a 0x8000000 -s 0x8000000  
getopt: illegal option – a  
Warning: long options not supported due to getopt from BSD usage.  
Terminating…  
Failed uploading: uploading error: exit status 1  
```

This used to work, what gives?

---

<div class="post-metadata">

**Author:** ![zfields](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/zfields/32/29_2.png) [@zfields](https://discuss.blues.com/u/zfields)\
**Post date:** [March 10, 2026, 10:34pm UTC](https://discuss.blues.com/t/dfu-not-working-in-arduino-ide-macos/3492/3 "2026-03-10T22:34:15Z")

</div>

This is a known issue in the Arduino Tools repository:

> <https://github.com/stm32duino/Arduino_Tools/issues/112>
>
> STM32Tools 2.4.0 that shipped with STM32Duino Arduino core 2.12.0.
> 
> macOS 15.6 2…4G84
> Using built-in macOS BSD getopt.
> 
> \*\*Describe the bug\*\*
> \`getopt: illegal option -- a\` when using DFU upload. Board STM32U0 -\> Generic U073C8Tx.
> Upload method: "STM32CubeProgrammer (DFU)".
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behavior:
> 1. Compile (success)
> 2. Upload
> 3. Fails due to getopt error.
> 
> \*\*Expected behavior\*\*
> Successful upload (it was working on STM32Tools@2.3.1 that shipped with STM32Duino Arduino core 2.11.0).
> 
> \*\*Screenshots\*\*
> Sorry, unable to provide
> 
> \*\*Desktop (please complete the following information):\*\*
> - OS: macOS 15.6 24G84
> - Arduino IDE version: 2.3.6
> - STM32 core version: 2.12.0
> - Library version: N/A (fails even with empty sketch)
> - Tools menu settings if not the default: Board STM32U0 -\> Generic U073C8Tx
> - Upload method: \[e.g. SWD\]
> 
> \*\*Hardware (please complete the following information):\*\*
> - Board Name: Generic U073C8Tx
> - Hardware Revision: Proprietary
> - Extra hardware used if any: N/A native USB
> 
> \*\*Additional context\*\*

> **TL;DR:** The problem is stemming from the BSD version of `getopt`. A simple workaround is to install GNU `getopt`.
> 
> This can be accomplished using:
> 
> ```auto
> brew install gnu-getopt
> 
> ```
