Skip to main content
Visitor II
April 18, 2025
Question

Problem with programming

  • April 18, 2025
  • 2 replies
  • 387 views

Hello everyone,

I am kind of new to STM chips, i have a problem regarding programming the chip. I don't use any board, only chip on the SMD to DIP board. But when i want to program it using st-link, STM32cube can identify the programmer but not the chip, very few time it did find it but not most of the times. 

But if i start it with bootloader (Boot=1) everything is find and i can program it.

 

Is this the only way or am i doing something wrong?

 

Thd Chip is:STM32F103C

    This topic has been closed for replies.

    2 replies

    Graduate II
    April 18, 2025

    show a wiring diagram. you haven't indicated what programmer you are using.

    Super User
    April 19, 2025

    Do all these:

    • Power all VDD+VDDA pins.
    • Connect all VSS+VSSA pins to ground.
    • Use a genuine programmer (and chip).
    • Connect SWDIO, SWCLK, GND between programmer and chip.

    If you still can't program it, post pictures of your setup. Might need a bulk capacitor near the chip, but probably not just to establish communication.

     

    If the program on the board does any of the following, you will have difficulty programming and debugging it or connecting through SWD and may need to erase the chip to recover.

    • Erasing/programming flash.
    • Reassigning SWD pins to other functions.
    • Going into low power modes.

     

    If power (including decoupling caps) is insufficient, you may run into issues when running user code, particularly at fast cpu speeds.

    Super User
    April 19, 2025

    Welcome to the forum.

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

     


    @Mohade wrote:

    STM32cube can identify the programmer but not the chip,


    Is that STM32CubeIDE or STM32CubeProgrammer?

    How to solve connection errors when connecting and programming the STM32 target board

    How to solve debugger connection issues

     


    @TDK wrote:
    • Connect SWDIO, SWCLK, GND between programmer and chip.

    In addition to those (and all the other things), I would add 

    • Connect NRST between programmer and chip.

    This can get you out of (some of) the "difficult" situations @TDK  mentioned.

     


    @TDK wrote:
    • Use a genuine programmer (and chip)

    See: How to recognize a genuine ST-LINK/V2 versus a cloned one;

    In particular, this.