I have a custom STM32 PCB, when I try to connect the STLink V2 to the PCB, through STM32Programmer, it says:
If I hold the MCU Reset button, and in the program I press connect, after waiting 3 seconds and then I release the reset button, the MCU connects to the STM32Programmer no problems. I can then, without touching the PCB, program it, release data and similar things. I can wait however long I want, while connected.
Project: All info in detail: https://github.com/dominykasLi/LED_dice
Simple, random 6 sided dice generation electronics project. Click a button and it generates a number.
It is programmed through STlinkV2 (newest version, but from aliexpress).
BOOT0 and BOOT1 both use 10 kΩ resistors, before I used 100 kΩ, no difference. I even tried removing them, and just shorting BOOT0 and BOOT1 pins to GND
Changed: "System Core / SYS / Mode / Debug to Serial Wire", did not make a difference.
If I jump BOOT0 to +3.3V then I can easily connect to the STM32 with the programmer, no reset button holding needed, after programming the STM32, I can set the BOOT0 jumper back to place and then after resetting, the electronics work fine.
I copied the schematics from STM32 bluepill designs on the internet and the bluepill I have, with the same code, works fine i.e. I don't need to change boot pins jumpers to program and run the electronics.
Instead of using 1 uF, 100 nF and other capacitor values, I had only 10 nF, so in the project I only used 10 nF capacitors.
I can use STM32CubeIDE to program only if I get the window (hold reset and then release) right. Debugging does not work (because of this problem).
I checked dozens of websites and forums, their "fixes" did not work.




