Skip to content

[F407VET6] Upload fails: Incorrect "Maple" suffix (1eaf:0003) added & PIO error message is misleading #873

@14790897

Description

@14790897

Describe the bug
I am attempting to upload firmware to a genericSTM32F407VET6 board using the arduino framework via the dfu protocol. The upload fails, but PlatformIO provides a misleading error message ("No DFU capable USB device available"), masking the actual cause.

Root Cause Analysis
By running the dfu-util command manually in the terminal, I discovered the real error: The build system automatically appends a DFU Suffix for a Maple device (1eaf:0003), but the actual hardware is a standard STM32 DFU device (0483:df11). dfu-util correctly identifies the device but refuses to upload due to the File ID mismatch.

To Reproduce
platformio.ini:

[env:genericSTM32F407VET6]
platform = ststm32
board = genericSTM32F407VET6
framework = arduino
upload_protocol = dfu

1. PlatformIO Output (Misleading)
When clicking "Upload" in VSCode, PIO output suggests no device is found:

Looking for upload port...
...
No DFU capable USB device available
*** [upload] Error 1

2. Manual CLI Output (The Truth)
When running the exact same command manually in PowerShell, dfu-util finds the device but rejects the file:

PS C:\git-program\Embedded\stm32f407> dfu-util -d 0483:df11 -a 0 -s 0x08000000:leave -D .pio\build\genericSTM32F407VET6\firmware.bin

Opening DFU capable USB device...
Device ID 0483:df11
...
DFU state(2) = dfuIDLE, status(0) = No error condition is present
Error: File ID 1eaf:0003 does not match device (0483:df11 or 0483:df11)

Expected behavior

  1. The build script for genericSTM32F407VET6 should NOT append the 1eaf:0003 suffix by default, OR it should append the correct 0483:df11 suffix.
  2. PlatformIO should pass through the actual dfu-util error message ("File ID mismatch") instead of swallowing it and claiming no device is available.

Environment

  • OS: Windows 10/11
  • Board: Generic STM32F407VET6
  • Framework: Arduino

Workaround:

use custom upload_command

upload_command = 
                dfu-suffix -D $SOURCE
                C:\Users\13963\scoop\shims\dfu-util.exe -d 0483:df11 -a 0 -s 0x08000000:leave -D $SOURCE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions