cancel
Showing results for 
Search instead for 
Did you mean: 

Can't connect STM32F103C8T6

thequyen831
Visitor

thequyen831_0-1745931497826.pngthequyen831_1-1745931784762.png

Yesterday, I have flashed faulty code to my STM32, and now I can't connect to it via ST-Link or the UART bootloader. I've tried using STM32 ST-Link Utility and STM32CubeProgrammer, but neither works. How can I erase the flash memory? Do I need to buy a new chip?
i using stm32f103c8t6

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Holding BOOT0 high during reset will let you connect and erase/recover the chip, if it's a genuine ST chip, which it's probably not.

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

View solution in original post

6 REPLIES 6
TDK
Guru

Holding BOOT0 high during reset will let you connect and erase/recover the chip, if it's a genuine ST chip, which it's probably not.

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

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 

Note that the old ST-Link Utility is long obsolete - STM32CubeProgrammer is the current tool

Are you using a genuine STM32 ?

What board is it on ?

Are you using a genuine ST-Link ?

https://community.st.com/t5/stm32-mcus/how-to-recognize-a-genuine-st-link-v2-versus-a-cloned-one/ta-p/49471

 

How are you connecting the ST-Link ?

https://community.st.com/t5/stm32-mcus/how-to-solve-connection-errors-when-connecting-and-programming/tac-p/786977

https://community.st.com/t5/stm32-mcus/how-to-solve-debugger-connection-issues/ta-p/49693

 

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.

I think I'm using a clone STM32 board and a clone ST-Link, but in the past it worked normally. It was only after I uploaded code yesterday that divided a number by zero, and since then the board hasn’t been able to connect. Is there any way to completely erase the code from the chip?

By holding BOOT0 high during reset, will I be able to connect via ST-Link or UART?

Oh my God, your solution helped me a lot! You're my hero, bro!


@thequyen831 wrote:

I think I'm using a clone STM32 board and a clone ST-Link


You need to check that for sure!

I gave you a link on how to check the ST-Link; in particular, see this part:

https://community.st.com/t5/stm32-mcus/how-to-recognize-a-genuine-st-link-v2-versus-a-cloned-one/tac-p/703663/highlight/true#M965

 

Post a link to where you bought the board.

Photos of the board & ST-Link would also help.

Again, please see: How to write your question to maximize your chances to find a solution

 


@thequyen831 wrote:

but in the past it worked normally. 


That's the trouble with using clones/fakes: they could have been just barely working before - and have now just gone over the edge.

There are many posts here where many people have wasted many hours on these fakes/clones.

Avoid the hassle - just get a genuine ST board!

eg, NUCLEO-F103RB - which comes complete with a genuine ST-Link. 

https://www.st.com/en/evaluation-tools/nucleo-f103rb.html 

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.