Skip to main content
Explorer
June 24, 2024
Solved

BlackPill (STM32F411CEU6): Can not program through DFU mode

  • June 24, 2024
  • 5 replies
  • 3818 views

Hello,

I am trying to program STM32F411CEU6 based board using STM32Cube Programmer. If I try to flash the file through DFU mode it gives an error

Erasing internal memory sectors [0 1]
sector 0000 does not exist
sector 0001 does not exist

 

Programming through UART with an FTDI adapter works without any problem.

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    ST resources are dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes work properly with the firmware we provide.

    Thank you for your understanding.

    5 replies

    Super User
    June 24, 2024

    Hi,

    ok, but : is program working ? (download complete - so it could be ok.)

    pbcalAuthor
    Explorer
    June 24, 2024

    No, the program does not work after flashing through DFU mode. If you see the timestamp in my attached pictures, in DFU the down in progress and download complete message comes in 1 sec where as in UART mode it takes 7 sec.

    Graduate II
    June 24, 2024

    Have you considered using a debugger to understand what's NOT WORKING exactly?

    I'd have some kind of output or indication if it lands in ErrorHandler() or HardFault_Handler() so the death there isn't entirely silent.

    Get some GPIO / LED outputs early in main(), prior to HAL_Init() or anything else.

    pbcalAuthor
    Explorer
    June 25, 2024

    I have tried some debugging without any success. Actually the Flash does not have any valid program to execute.

    What actually is happening here, in DFU mode before flashing it fails to erase sector 0 and 1, but the process does not create an error and terminate. It proceeds to download step, in this step. it can change 1 to 0, but can not change 0 to 1. Not sure if my explanation is clear or not. Here is an example (just one line from the hex dump)

    flash has this content

    :200000000000022055350008A5350008A5350008A5350008A5350008A535000800000000C2

    I try to program a file with this content

    :2000000000000220254B0008754B0008754B0008754B0008754B0008754B0008000000005E

    Erase fails but it sill tried to write, So we end up with this flash content

    :200000000000022005010008250100082501000825010008250100082501000800000000CA

     

    I found a solution to to overcome this issue. I have to manually do a full chip erase, then download my file.

     

    Super User
    June 25, 2024

    Looks like this thread.

     

    pbcalAuthor
    Explorer
    June 25, 2024

    I just uninstalled 2.16 and installed 2.15 and do not see the same issue. Flashing works in DFU mode. Is it a bug in V2.16?

    Visitor II
    June 28, 2024

    Thanks.  I was having the same issue.  Moving back to 2.15 worked for me.

    mƎALLEmAnswer
    Technical Moderator
    April 14, 2025

    Hello,

    ST resources are dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes work properly with the firmware we provide.

    Thank you for your understanding.