cancel
Showing results for 
Search instead for 
Did you mean: 

Error: failed to erase memory

Nsg1987
Senior

Hi,

While flashing code in STM32G474VBT6, I am getting below error. After reinstalling cube ide and cube programmer, same error continues.

 

STMicroelectronics ST-LINK GDB server. Version 7.4.0

Copyright (c) 2023, STMicroelectronics. All rights reserved.

 

Starting server with the following options:

Persistent Mode : Disabled

Logging Level : 1

Listen Port Number : 61234

Status Refresh Delay : 15s

Verbose Mode : Disabled

SWD Debug : Enabled

InitWhile : Enabled

 

Waiting for debugger connection...

Debugger connected

Waiting for debugger connection...

Debugger connected

Waiting for debugger connection...

-------------------------------------------------------------------

STM32CubeProgrammer v2.14.0

-------------------------------------------------------------------

 

 

 

Log output file: C:\Users\NIKHIL~1\AppData\Local\Temp\STM32CubeProgrammer_a02888.log

ST-LINK SN : 68005200040000363036544E

ST-LINK FW : V2J42S7

Board : --

Voltage : 3.26V

SWD freq : 4000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID : 0x469

Revision ID : Rev X

Device name : STM32G47x/G48x

Flash size : 128 KBytes

Device type : MCU

Device CPU : Cortex-M4

BL Version : 0xD5

Debug in Low Power mode enabled

 

 

 

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a02888.srec

File : ST-LINK_GDB_server_a02888.srec

Size : 73.29 KB

Address : 0x08000000

 

 

Erasing memory corresponding to segment 0:

Error: Operation exceeds memory limits

 

 

Error: failed to erase memory

Encountered Error when opening C:\ST\STM32CubeIDE_1.13.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.0.202305091550\tools\bin\STM32_Programmer_CLI.exe.

Error in STM32CubeProgrammer

Shutting down...

Exit.

 

Nsg1987_0-1691554608910.png

Can anyone help me to get solution?

Thanks

Nikhil

 

@Sara BEN HADJ YAHYA 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I just installed STM32CubeIDE v1.13.1 and got the same "failed to execute MI command" error.

But the error does not occur with IDE v1.12.1 (since it's the same project).

I'm using IDE 1.12.1 because there have been several reports of BUGs with version 1.13, and I've only just installed this version in a virtual machine to test it, but I shouldn't use this version for now, version 1.12.1 already suits my projects at the moment.

View solution in original post

20 REPLIES 20
RhSilicon
Lead

I remember something similar happening, which only the ST-link utility was able to resolve by performing a complete FLASH erase.

https://www.st.com/en/development-tools/stsw-link004.html

Nsg1987
Senior

Hello @RhSilicon 

I did the full chip erase with STM32CubeProgrammer. But still error is present.

Nsg1987_0-1691556467401.png

 

I just installed STM32CubeIDE v1.13.1 and got the same "failed to execute MI command" error.

But the error does not occur with IDE v1.12.1 (since it's the same project).

I'm using IDE 1.12.1 because there have been several reports of BUGs with version 1.13, and I've only just installed this version in a virtual machine to test it, but I shouldn't use this version for now, version 1.12.1 already suits my projects at the moment.

The error stopped occurring after selecting the ST-Link frequency from Auto to 8000kHz. There may be some ST-Link speed identification failure.

ST-Link_error_MI_cmd.png

I disabled firmware verification, but I noticed that leaving 8000kHz in IDE 1.13.1 caused a firmware error. IDE version 1.12.1 identifies the frequency of 4000kHz for ST-link in AUTO mode.

ST-Link_error_MI_cmd_AUTO_4000.png

I enabled firmware verification but I noticed leaving 1000kHz in IDE 1.13.1 stops with MI error.

Hi @RhSilicon ,

I uninstalled STM32CubeIde 1.13.1 and installed STM32CubeIde 1.12.0. Now it is working fine.

There may be some issue with 1.13.1.

Thanks for your help.

Regards,

Nikhil 

HMoens
Associate II

I have the same issue 1.12.1 works but 1.13.1 doesn't