cancel
Showing results for 
Search instead for 
Did you mean: 

Why brand new Discovery boards give me "Error: failed to erase memory" when I am just loading up the ST provided demo hex

TStra.6
Associate II

I have 4 Discovery boards:

STM32F769I-DISCO, STM32F469I-DISCO, STML4R9I-DISCO, and a STM32H747I-DISCO boards. The H7 and L4 boards came pre-loaded with the demo firmware. So I downloaded the ST provided demo hex files for both the F4 and F7 boards. Using STM32CubeProgrammer I connect to the boards and the target information is correct. I browse to the location of the ST provided demo hex file. I click on Start Programming and at some time later I get the pop up window saying "Error: failed to erase memory"

So unless both boards were shipped to me as defective - there is something else wrong that wasn't caused by me.

I have no issues programming the L4 and H7 boards, they work just fine but the F4 and F7 boards are will not program. These are boards produced by ST and code produced and compiled by ST, so again unless they are defective something is wrong and I have no clue where to look.

Has anyone else had this issue? I looked on the forum here but in the other instance it was caused by either linker script error, make file error, or bad settings in CubeMX. My issue is none of those because again everything was supplied by ST.

I don't think ST would ship out defective boards and would have tested their demo code to load and run on their boards.

So does anyone have an idea what might be causing this?

2 REPLIES 2

>>So does anyone have an idea what might be causing this?

Bit non-specific from the error/context side. What's in the log, most verbose setting?

Bad/low quality cables.

Use of hubs or docking stations.

Trying to access memory without appropriate External Loader selected?

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

Thanks, your question sent me in the right direction. I forgot about the external loader. I had just been working on a Nucleo board and forgot on these discovery boards I have to select the correct external loader for the board. Once I set the correct external loader both the F4 and F7 boards programmed just fine.

Thanks again for your help.