cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Failed to erase memory on (Bluepill) STM32F103C8T6

rahgirrafi
Associate


STMicroelectronics ST-LINK GDB server. Version 7.3.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

Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.13.0
-------------------------------------------------------------------

 

Log output file: C:\Users\rahgi\AppData\Local\Temp\STM32CubeProgrammer_a16228.log
ST-LINK SN : 022604157316303030303032
ST-LINK FW : V2J45S7
Board : --
Voltage : 3.16V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size : 64 KBytes
Device type : MCU
Device CPU : Cortex-M3
BL Version : --

 

Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a16228.srec
File : ST-LINK_GDB_server_a16228.srec
Size : 4.46 KB
Address : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 4]
Error: failed to erase memory


Error: failed to erase memory
Encountered Error when opening H:\Installed\STM32CubeIDE_1.12.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.600.202301161003\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer
Shutting down...
Exit.

I was able to connect to my board using ST-Link Utility and STM32Programmer. But whenever I was trying to upload the code using STM32Cubeide, i was receiving this error. I tried erasing the chip memory. But didn't work. Then I read the error message carefully, and suspected that the stm32cubeide maybe having trouble opening the programmer for some reason (not sure why). So I built the project file in the ide and tried to upload it by using STM32priogrammer manually, and it worked. I was able to upload the program to the MCU. Not sure why is this happening. It would be nice if any experienced individual can provide any indication to the whys. 

Thanks in advance.

2 REPLIES 2

Is this an authentic ST-LINK or a cheap clone? Does the Blue Pill have an authentic STM32F103 ?

The current version of STM32 Cube Programmer is 2.17.0 show actual error, with verbose logging set to 3

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

I am not entirely sure if its authentic or not. The chip has the same writings that an authentic chip has. But yeah, I was unable to power the chip through the ST-LINK. The bluepill wasn’t getting enough power. So I am powering it from the USB port.

Is there any way for checking authenticity?