cancel
Showing results for 
Search instead for 
Did you mean: 

not able to flash program on stm32f103c8t6

mohamedehsan
Visitor

Hi,

I have been trying to flash a program into my stm32f103c8t6. but I'm not able to flash neither through stm32cube ide or stm32cubeprogrammer. when i try to flash through cube ide , im getting the following error:

 

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.17.0

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

ST-LINK SN : E

ST-LINK FW : V2J45S7

Board : --

Voltage : 3.19V

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 : 128 KBytes (default)

Device type : MCU

Device CPU : Cortex-M3

BL Version : --

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a14700.srec

File : ST-LINK_GDB_server_a14700.srec

Size : 29.53 KB

Address : 0x08000000

 

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 29]

Error: failed to erase memory

Error: failed to erase memory

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

Error in STM32CubeProgrammer

Shutting down...

Exit.

similarly when i try to flash through cubeprogrammer, its not getting connected. im getting error message:

UR connection mode is defined with the HWrst reset mode


I tried using STM32_Programmer_CLI.

there I found out RDP is enabled.

I did mass erase and write RDP =0xAA.

both commands were successful but still when I give the command to display, it's still showing rdp enabled.

I have attached screenshots of cli messages

how to solve this?

 

Screenshot 2025-05-12 111825.pngScreenshot 2025-05-12 111854.pngScreenshot 2025-05-12 111919.png

 

 

This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions

Your ST-LINK7v2 is a clone with a fake STM32F103C8T6. ST resources are only dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes products work properly with the firmware we provide.

This thread will now be locked. However, if you face difficulties while using genuine ST products, we’re here to assist you. Please feel free to start a new thread, and our team, along with community members, will be ready to help you with any issues/questions you encounter.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
Ozone
Principal

Did you notice this ?

Ozone_0-1747032704103.png

Try to get your board into system mode (ROM bootloader), and perform a mass erase.

And remove/disable any code enabling this Flash protection for the time being.

Peter BENSCH
ST Employee

@mohamedehsan 

Please show a photo of your ST-LINK/V2.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

stlink.jpg

Welcome to the forum.

What board is your chip on?

Please see: How to write your question to maximize your chances to find a solution

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Your ST-LINK7v2 is a clone with a fake STM32F103C8T6. ST resources are only dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes products work properly with the firmware we provide.

This thread will now be locked. However, if you face difficulties while using genuine ST products, we’re here to assist you. Please feel free to start a new thread, and our team, along with community members, will be ready to help you with any issues/questions you encounter.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.