2025-02-17 03:42 PM
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!
2025-02-19 08:35 AM
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
2025-02-19 08:48 AM
Set BOOT0 low during reset to run user code. Set it high during reset to jump into the bootloader.
2025-02-19 09:25 AM
@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 ?
2025-02-19 01:44 PM
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?
2025-02-19 01:54 PM - edited 2025-02-19 01:55 PM
You've configured the CubeProgrammer to connect under Hardware reset, but there is no NRST in your debug header.
Add NRST to your debug connection, and try again ...
See also:
https://community.st.com/t5/stm32-mcus/how-to-solve-debugger-connection-issues/ta-p/49693
2025-02-19 02:08 PM
I tried that earlier, no luck with that. Also, with those same settings, I was able to connect to the chip in the clamp (without the reset) using only 3.3V, GND, SWDIO, SWCLK
2025-02-20 01:01 AM
So there must be a fault on your PCB, then.
https://community.st.com/t5/stm32-mcus-products/flashing-chip-on-pcb/m-p/773911/highlight/true#M273268
2025-02-20 02:20 PM
Ok, that makes sense. Are there any practices I should avoid or adhere to to ensure that it works this time?