cancel
Showing results for 
Search instead for 
Did you mean: 

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

Melih--
Associate II

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!

6 REPLIES 6
AScha.3
Super User

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

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 Venmo
Up vote any posts that you find helpful, it shows what's working..

ı 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 

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

hello again

so when ı checked all option bytes click apply programmer stop working 

Ekran görüntüsü 2025-08-18 195647.png

Ekran görüntüsü 2025-08-18 195627.png

Ekran görüntüsü 2025-08-18 195616.png

 

these are screenshoot when ı try to full erase chip 

And you looked at all sectors in OptionBytes  ?

AScha3_0-1755539411864.png

 

: all (!) sectors have write protection OFF (= checked).

btw

I also got some new chips from distributor, that had some write protected sectors - no full erase possible.

Until you set all to unprotected.

 

If you feel a post has answered your question, please click "Accept as Solution".