cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with programming

Mohade
Visitor

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

3 REPLIES 3
Karl Yamashita
Principal

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

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.
TDK
Guru

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.

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.

 


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

 

 

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.