Skip to main content
Associate II
February 17, 2025
Question

Flashing chip on pcb

I am trying to flash a chip on a PCB. Right now I just have it toggle an LED. Sometimes it connects, but does not toggle, only stays lit. After power cycling, it does not even light up, it just stays off. Is there something i am missing, perhaps in the option bits or some clock setting. 

Also, on another board, it is just not connecting, what are some common issues?

Lastly, on third test, it connected a few times. However around a month later, it just won't connect. Any insight?

 

Thanks!

This topic has been closed for replies.

18 replies

TDK
February 18, 2025

Some common issues here:

  • Check that BOOT0 is tied low to boot into the user program.
  • Check that board is powered and doesn't have manufacturing issues like cold solder joints.
  • Check power rails.
  • Verify VCAP voltage if present.
  • If code is not working as intended, debug the code by single stepping instructions, inserting breakpoints, and examining where the cpu is at and what it's doing.
"If you feel a post has answered your question, please click ""Accept as Solution""."
at3Author
Associate II
February 18, 2025

Thank you, I think the main issue now is connecting to the chip on the PCB, not sure what is not working on the board.

Andrew Neil
Super User
February 18, 2025

Show schematics of your board(s) !

What programmer (HW & SW) are you using, and how do you have it connected ?

How to write your question to maximize your chances to find a solution

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.
at3Author
Associate II
February 18, 2025

I am using an ST-Link and SWD. 

Screenshot 2025-02-17 215641.png

This is the one I got to flash once and does not work anymore.

I got the flashing working consistently on this type of device. This was also the setup I was working on that would not run after power cycling. Not sure what I did, but it is now working :). It is just getting 3.3V at the power input pins, and I am using 3.3V, GND, SWDIO, SWCLK. I did not change any boot pins

at3_0-1739847725953.png

This one will not connect at all, I have made 2 of these and still no luck. I am not sure what is different other than the capacitors and ferrite bead. 

 

 

 

Andrew Neil
Super User
February 18, 2025

@at3 wrote:

I am using an ST-Link


That's not a genuine ST-Link:

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

You didn't answer what software tool(s) you're using.

Again, please read this.

 


@at3 wrote:

This is the one I got to flash once and does not work anymore.


What, exactly, do you mean by "does not work" ?

Does the (unknown)  programmer not connect?

Can you use the debugger?

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.
TDK
February 18, 2025

With BOOT0 floating, the microcontroller may boot into flash or into system memory. It is not defined.

"If you feel a post has answered your question, please click ""Accept as Solution""."
at3Author
Associate II
February 18, 2025

which should I set it to for programming and for running when connected to power

TDK
February 19, 2025

Set BOOT0 low during reset to run user code. Set it high during reset to jump into the bootloader.

"If you feel a post has answered your question, please click ""Accept as Solution""."
at3Author
Associate II
February 19, 2025

The messages are enable debug authentication or error connecting.

In my test setup with the chip clamp, it is very inconsistent. Sometimes it starts on a power cycle, some times it does not. Right when I plug the stlink into my computer, it starts toggling the led (most of the time). But if i use an external power supply, it works very inconsistently. Also, sometimes I get the debug authentication error on my test setup, but i just unplug the stlink and try again and it works. 

My main question as of now is why sometimes the program runs correctly sometimes, but not at other times

Andrew Neil
Super User
February 19, 2025

@at3 wrote:

The messages are enable debug authentication or error connecting.


It's better to copy/paste the actual messages, and/or give a screenshot, rather than try to paraphrase or summarise.

 


@at3 wrote:

In my test setup with the chip clamp, it is very inconsistent.


That is in the nature of those things - they are notoriously unreliable!

Did you follow @TDK's advice about BOOT0 and other things to check ?

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.
at3Author
Associate II
February 19, 2025

It seems that the boot0 pin was the issue, it now consistently works

 

I am still unsure on the issue for the PCB. Even if the boot is floating, it should at least connect, right?

at3_0-1740001455089.png