Skip to main content
Associate
August 16, 2025
Question

STM32F103C8T6 always shows “SLEEP” in CubeProgrammer, cannot perform full chip erase—no user code loaded

  • August 16, 2025
  • 2 replies
  • 606 views

Hi everyone,
I'm working with an STM32F103C8T6. Even though I haven't programmed any code onto it myself, when I connect with STM32CubeProgrammer, the Registers panel immediately shows “SLEEP” (while on other ST boards it would show “HALTED”). Because of this, I can't perform a Full Chip Erase — the option appears but doesn't work.

Here’s what I’ve tried:

  • Connected only SWDIO, SWCLK, GND, and 3.3 V (no NRST).

  • CubeProgrammer shows “SLEEP,” and erase fails.

  • On other boards, “Connect under reset” works fine and allows erasing.

Possible issues I suspect:

  • No NRST pin connection → ST-Link can’t halt the MCU before it runs.

  • Option Bytes might have RDP (Read-Out Protection) enabled.

  • BOOT0 pin wrongly tied (stuck in System Memory mode).

  • Some factory test code or previous user code (making MCU go to sleep on reset).

What I tried from forum suggestions:

  • Tried “Connect under reset” with NRST — this works on other boards but seems not to work here yet.

Any ideas how to force-erase or regain access?
I’d appreciate any advice—including Option Bytes configuration, hardware wiring, or CubeProgrammer settings.
Thanks!

2 replies

AScha.3
Super User
August 17, 2025

Hi,

What st-link you use?

And set connect; software reset, and enable low power modes.

Try to connect, then show, what Cube programmer shows, screen shot.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Melih--Author
Associate
August 18, 2025

ı use stm32f446re nucleo board as stlink,ı can not connect stmf103 with cubeide ,only with cubeprogrammer in hot plug mode,

Melih_0-1755501452974.jpeg

this is the screenshoot ,only see stm in sleep mode , ı try my nucleo board and ı see halted,is there any chance my stm32f103c8t6 is clone 

AScha.3
Super User
August 18, 2025

>is there any chance my stm32f103c8t6 is clone 

Everything could be a "clone" , but it is very unlikely , as cpu ID (and revision) show same, as on a F103 here:

 

AScha3_0-1755506629024.png

So connect with :  software reset, nrst not needed;

Then look in OptionBytes:   rdp not set:

AScha3_1-1755506848932.png

next see  in OptionBytes: all (!) sectors have write protection OFF (= checked).

AScha3_2-1755506912884.png

down to 31:

AScha3_3-1755507059174.png

Then full/mass erase should work:

AScha3_4-1755507156378.png

Try.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
August 17, 2025

Connect Under Reset from the debug pod expects NRST to be connected to the Target MCU

You can use the BOOTx pins to cause a power-up / reset into System Memory rather than a user program in FLASH sleeping the device or otherwise breaking the debug interface.

Consider have a delaying loop in System Reset to allow debugger time to connect initially

 

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