Skip to main content
DTung.2
Associate
October 12, 2020
Solved

STM32F013C8T6 (blue pill) flash error

  • October 12, 2020
  • 3 replies
  • 1192 views

I am using STM32F103C8T6 with libopencm3 and FreeRTOS. Some programs I have can only flash once, even though the code function properly. The second time I flash it will say something like "unknown chip id! 0x3748. Failed to connect to target". I have to set boot0 jumper to VDD, and issue "st-flash erase" from console, then set boot0 jumper back to GND to reset the board.

My question is: Is this normal? If not, what could be the problem? How can I narrow down the issue? It really is inconvenient to go through so many steps to flash a new code.

This topic has been closed for replies.
Best answer by Peter BENSCH

This thread relates to a so-called Blue Pill, which uses illegally cloned STM32F103. 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.

We recommend to purchase genuine products from STMicroelectronics and purchase them from known and trusted distributors.

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.

Thank you for your understanding.

Regards
/Peter

3 replies

Uwe Bonnes
Chief
October 12, 2020

Check that you do not have a STM32F103 clone!

DTung.2
DTung.2Author
Associate
October 12, 2020

No. It is from STM.

DTung.2
DTung.2Author
Associate
October 14, 2020

In case anyone curious about what happens to this problem, I found I have disabled JTAG and SWD accidentally in the programs so the flash function is not working.

About the approach I used to debug this problem, I disable my program block by block until I narrow down the problem.

Peter BENSCH
Technical Moderator
April 25, 2025

This thread relates to a so-called Blue Pill, which uses illegally cloned STM32F103. 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.

We recommend to purchase genuine products from STMicroelectronics and purchase them from known and trusted distributors.

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.

Thank you for your understanding.

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.