cancel
Showing results for 
Search instead for 
Did you mean: 

BlackPill (STM32F411CEU6): Can not program through DFU mode

pbcal
Associate II

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.

7 REPLIES 7
AScha.3
Chief II

Hi,

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

If you feel a post has answered your question, please click "Accept as Solution".

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.

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pbcal
Associate II

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.

 

Pavel A.
Evangelist III

Looks like this thread.

 

pbcal
Associate II

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?

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