Menu

#231 DFU download bricking STM32F767 and mass-erase is failing

none
open
nobody
None
2026-03-03
2026-03-02
No

Hi,

We have a STM32F767 that can't be flashed with dfu-util. The ECU does not boot once flashed with dfu-util. We tried 0.10 and 0.11 on Windows 11.

When we flash with CubeProgrammer it boots fine.

It seems the device likes (requires) a full erase before flashing (as CubeProgrammer) does but that fails on dfu-util.

The same command set works on STM32H743 and STM32F407.

Full command:
dfu-util -d0483:df11 -a0 -s 0x08000000:mass-erase:force -D rusefi.bin

Flashing C:\Users\ggurov\AppData\Local\Temp\epicEFI-dfu-update18060022641956708335\rusefi.snapshot.MEGA144F7\rusefi.bin
Rebooting ECU to DFU...
Erasing and updating firmware...
dfu-util 0.10-msvc

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2020 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/


Warning: Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
Performing mass erase, this can take a moment
Error during special command "MASS_ERASE" get_status


Process exited with code: 74

ECU update failed! See details.

Discussion

  • Tormod Volden

    Tormod Volden - 2026-03-03
     
  • Tormod Volden

    Tormod Volden - 2026-03-03

    Please also use the latest version or latest git, because the diagnostics output has been improved.

     
  • Tormod Volden

    Tormod Volden - 2026-03-03

    If you are using latest git you can also try the new :fast dfuse modifier.

     
  • Ognjen Galic

    Ognjen Galic - 2026-03-03

    Hi,

    Is there any possibility that you could build us a git msvc x64 binary? I dont have the toolchain set up as im on Mac.

    Many thanks!
    Ognjen

     
    • Tormod Volden

      Tormod Volden - 2026-03-03

      Windows git snapshot binaries can be found here: https://dfu-util.sourceforge.net/snapshots/

      (2024-04-16 is practically latest git)

       
      • Ognjen Galic

        Ognjen Galic - 2026-03-03

        Here it is:

        STM32F767:

        ```C:\Users\ggurov\Downloads\epictuner-plugin-1.0-alpha-b18>dfu-util-static -v -d0483:df11 -a0 -s 0x08000000:mass-erase:force -D "C:\Users\ggurov\AppData\Local\Temp\epicEFI-dfu-update14162277243067594849\rusefi.snapshot.MEGA144F7\rusefi.bin"
        dfu-util 0.11-dev
        
        Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
        Copyright 2010-2021 Tormod Volden and Stefan Schmidt
        This program is Free Software and has ABSOLUTELY NO WARRANTY
        Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
        
        libusb version 1.0.27 (11893)
        Warning: Invalid DFU suffix signature
        A valid DFU suffix will be required in a future dfu-util release
        Opening DFU capable USB device...
        Device ID 0483:df11
        Device DFU version 011a
        DFU attributes: (0x0b) bitCanDnload bitCanUpload bitWillDetach
        Detach timeout 255 ms
        Claiming USB DFU Interface...
        Setting Alternate Interface #0 ...
        Determining device status...
        DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
        Clearing status
        Determining device status...
        DFU state(2) = dfuIDLE, status(0) = No error condition is present
        DFU mode device DFU version 011a
        Device returned transfer size 2048
        DfuSe interface name: "Internal Flash  "
        Memory segment at 0x08000000   4 x 16384 = 65536 (rew)
        Memory segment at 0x08010000   1 x 65536 = 65536 (rew)
        Memory segment at 0x08020000   3 x 131072 = 393216 (rew)
        Memory segment at 0x08080000   4 x 16384 = 65536 (rew)
        Memory segment at 0x08090000   1 x 65536 = 65536 (rew)
        Memory segment at 0x080a0000   3 x 131072 = 393216 (rew)
        Performing mass erase, this can take a moment
        Error during special command "MASS_ERASE" get_status: -7 (LIBUSB_ERROR_TIMEOUT)```
        

        STM32F407:

        ```C:\Users\ggurov\Downloads\epictuner-plugin-1.0-alpha-b18>dfu-util -v -d0483:df11 -a0 -s 0x08000000:mass-erase:force -D "C:\Users\ggurov\AppData\Local\Temp\epicEFI-dfu-update14162277243067594849\rusefi.snapshot.MEGA144F7\rusefi.bin"
        dfu-util 0.11-dev
        
        Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
        Copyright 2010-2021 Tormod Volden and Stefan Schmidt
        This program is Free Software and has ABSOLUTELY NO WARRANTY
        Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
        
        libusb version 1.0.27 (11893)
        Warning: Invalid DFU suffix signature
        A valid DFU suffix will be required in a future dfu-util release
        Opening DFU capable USB device...
        Device ID 0483:df11
        Device DFU version 011a
        DFU attributes: (0x0b) bitCanDnload bitCanUpload bitWillDetach
        Detach timeout 255 ms
        Claiming USB DFU Interface...
        Setting Alternate Interface #0 ...
        Determining device status...
        DFU state(10) = dfuERROR, status(10) = Device's firmware is corrupt. It cannot return to run-time (non-DFU) operations
        Clearing status
        Determining device status...
        DFU state(2) = dfuIDLE, status(0) = No error condition is present
        DFU mode device DFU version 011a
        Device returned transfer size 2048
        DfuSe interface name: "Internal Flash  "
        Memory segment at 0x08000000   4 x 16384 = 65536 (rew)
        Memory segment at 0x08010000   1 x 65536 = 65536 (rew)
        Memory segment at 0x08020000   7 x 131072 = 917504 (rew)
        Performing mass erase, this can take a moment
        Setting timeout to 35 seconds
        
        ```
        

        STM32H7:

        C:\Users\ggurov\Downloads\epictuner-plugin-1.0-alpha-b18>dfu-util -v -d0483:df11 -a0 -s 0x08000000:mass-erase:force -D "C:\Users\ggurov\AppData\Local\Temp\epicEFI-dfu-update14162277243067594849\rusefi.snapshot.MEGA144F7\rusefi.bin"                                                                                   dfu-util 0.11-dev                                                                                                                                                                                                                                                                                                         Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.                                                                                           Copyright 2010-2021 Tormod Volden and Stefan Schmidt                                                                                                         This program is Free Software and has ABSOLUTELY NO WARRANTY                                                                                                 Please report bugs to http://sourceforge.net/p/dfu-util/tickets/                                                                                                                                                                                                                                                          libusb version 1.0.27 (11893)                                                                                                                                Warning: Invalid DFU suffix signature                                                                                                                        A valid DFU suffix will be required in a future dfu-util release                                                                                             Opening DFU capable USB device...                                                                                                                            Device ID 0483:df11                                                                                                                                          Device DFU version 011a                                                                                                                                      DFU attributes: (0x0b) bitCanDnload bitCanUpload bitWillDetach                                                                                               Detach timeout 255 ms                                                                                                                                        Claiming USB DFU Interface...                                                                                                                                Setting Alternate Interface #0 ...                                                                                                                           Determining device status...                                                                                                                                 DFU state(2) = dfuIDLE, status(0) = No error condition is present                                                                                            DFU mode device DFU version 011a                                                                                                                             Device returned transfer size 1024                                                                                                                           DfuSe interface name: "Internal Flash   "                                                                                                                    Memory segment at 0x08000000  16 x 131072 = 2097152 (rew)                                                                                                    Performing mass erase, this can take a moment                                                                                                                                                                                                            
        
         
  • Tormod Volden

    Tormod Volden - 2026-03-03

    Can you please format the STM32H7 output?

    You can see in the STM32F407 output: "Setting timeout to 35 seconds". This is a quirk because we know some devices report wrong erase time. Maybe the F767 also reports wrong erase time. Please use -v -v to see more debug information. You can also use -v -v -v but that is so verbose you'd better attach the output as a file.

     
    • Ognjen Galic

      Ognjen Galic - 2026-03-03

      Hi,

      When you said it's verbose, you weren't kidding :^)

      The full output is attached.

      Many thanks!
      Ognjen

       
  • Tormod Volden

    Tormod Volden - 2026-03-03

    Poll timeout 200 ms on command MASS_ERASE (state=dfuDNBUSY)
    The chip tells dfu-util to wait 200 ms before asking about status again, but that is probably too short and the chip is still busy erasing and not able to communicate so our get_status request times out.

     
    • Ognjen Galic

      Ognjen Galic - 2026-03-03

      Hi,

      Should that be added to the 35 second quirk perhaps?

      Br,
      Ognjen

       
  • Tormod Volden

    Tormod Volden - 2026-03-03

    Then what if some other chip also reports 200 ms but doesn't need 35 seconds, maybe even correctly needs less than 200 ms? :)
    How many seconds does the datasheet say?

     
    • Ognjen Galic

      Ognjen Galic - 2026-03-03

      Hi,

      The F767 datasheet for this chip says 8 (in some crazy parallel mode) to 32 seconds.

      Yeah if we force such a timeout, it would slow down the tool a lot for other, real chips (STM32F0 chips mass-erase in 30ms).

      Maybe if we add up the flash size from the memory segments, and if they are "large" (1MB) and the controller lies, then set the large timeout?

      Thanks!
      Ognjen

       
      • Ognjen Galic

        Ognjen Galic - 2026-03-03

        ...or, perhaps, to avoid hacks and stupid stuff just add a console switch to disable timeouts or raise them :^)

         

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB