Skip to main content
Visitor II
November 10, 2022
Solved

Upload works well, code isn´t running on custom STM32f103

  • November 10, 2022
  • 5 replies
  • 3832 views

Hi I have a program, which works normally on standalone STM32f103c8t6. I made a custom board and now I can upload the program, but its not running. Even simple Blink sketch. STM Cube programmer shows this error:

Memory Programming ...

 07:53:02 : Opening and parsing file: Blink.ino.BLUEPILL_F103C8.bin

 07:53:02 :  File     : Blink.ino.BLUEPILL_F103C8.bin

 07:53:02 :  Size     : 12.20 KB 

 07:53:02 :  Address    : 0x08000000 

 07:53:02 : Erasing memory corresponding to segment 0:

 07:53:02 : Erasing internal memory sectors [0 12]

 07:53:02 : Download in Progress:

 07:53:04 : File download complete

 07:53:04 : Time elapsed during download operation: 00:00:02.271

 07:53:04 : RUNNING Program ... 

 07:53:04 :  Address:   : 0x08000000

 07:53:04 : Start operation achieved successfully

 07:53:06 : Timeout error occured while waiting for acknowledgement.

 07:53:06 : Error: GETID command not acknowledged!

 07:53:06 : Reemission of GetID command

 07:53:07 : Timeout error occured while waiting for acknowledgement.

 07:53:07 : Error: GETID command not acknowledged!

 07:53:07 : Reemission of GetID command

 07:53:08 : Timeout error occured while waiting for acknowledgement.

 07:53:08 : Error: GETID command not acknowledged!

 07:53:09 : Timeout error occured while waiting for acknowledgement.

 07:53:09 : Error: GETID command not acknowledged!

 07:53:09 : Reemission of GetID command

 07:53:10 : Timeout error occured while waiting for acknowledgement.

 07:53:10 : Error: GETID command not acknowledged!

 07:53:10 : Reemission of GetID command

 07:53:11 : Timeout error occured while waiting for acknowledgement.

 07:53:11 : Error: GETID command not acknowledged!

 07:53:11 : Warning: Connection to device 0x410 is lost

 07:53:11 : Disconnected from device.

Can you help me please?

0693W00000WHyJjQAL.jpg0693W00000WHyJZQA1.jpg

    This topic has been closed for replies.
    Best answer by TDK

    How are you determining that the code isn't running, as opposed to the code being stuck somewhere during startup? Do you have the source code to be able to debug and step through?

    The non-crystal side of C13/C15 needs to be grounded, not floating.

    5 replies

    Technical Moderator
    November 10, 2022

    Welcome, @Pavel Novák​, to the community!

    Are you 100% sure that it is an original STM32F103 and not a clone or counterfeit?

    Please check websites like e.g. hackaday.io or eevblog.com.

    Have you set the jumpers on the BOOTx settings correctly?

    BTW: you should not copy circuits from Bluepills, Blackpills, etc., as many details are not implemented correctly. For example, no pull-up to /NRST (R2 in your case) is necessary or even counterproductive.

    Regards

    /Peter

    Visitor II
    November 10, 2022

    Hello @Peter BENSCH​ , thank you for the answer. The source of the chip is https://jlcpcb.com/partdetail/Stmicroelectronics-STM32F103C8T6/C8734, so I hope, it´s original. You´re true that I copied a part of bluepill schema and probably with a mistake. If I bypass the R2 resistor, nothing change. :( Appreciate any help.

    Graduate
    November 10, 2022

    The placement of 100n capacitors as well as of oscillators and their capacitors on the PCB is very, very wrong. The microcontroller may be unable to run at anything > 8 MHz from its internal HSI because of effectively missing power decoupling. Try to start testing with HSI used as clock sorce (no PLL). The firware may be stuck in HSE/PLL init routine.

    Visitor II
    November 10, 2022

    Here are data from programmer, I don´t know if it is original:0693W00000WI0C6QAL.jpg

    TDKAnswer
    Super User
    November 10, 2022

    How are you determining that the code isn't running, as opposed to the code being stuck somewhere during startup? Do you have the source code to be able to debug and step through?

    The non-crystal side of C13/C15 needs to be grounded, not floating.

    Visitor II
    November 10, 2022

    Hi @TDK​  Thank you very much, the missing ground was the reason!!!!!

    Graduate II
    November 11, 2022

    Remove the R23 and R2, replace the C12 with 100 nF. Also R3 and R6 are recommended to be 10k, but that should not be an issue. And read the AN2586.

    Visitor II
    November 11, 2022

    Thank you @Piranha​ you are right.