-1
\$\begingroup\$

I have a custom STM32 PCB, when I try to connect the STLink V2 to the PCB, through STM32Programmer, it says:

No STM32 target found

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

enter image description here

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.

  • Programmer ver. 2.18.0 and configuration: default settings

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

PCB and schematic: https://github.com/dominykasLi/LED_dice/tree/main/KiCAD

schematic

\$\endgroup\$
5
  • \$\begingroup\$ Show the schematics of your board. Wouldn't hurt to show layout too, but it probably isn't relevant. \$\endgroup\$ Commented Feb 2 at 16:13
  • \$\begingroup\$ Added it to the bottom of the post. \$\endgroup\$ Commented Feb 2 at 16:17
  • \$\begingroup\$ It'd help to have pictures of the schematic inlined into the question, so we don't have to download it and open it in KiCAD. \$\endgroup\$ Commented Feb 2 at 16:26
  • \$\begingroup\$ Embed the image into your post in case of future link-rot. You must use all the correctly recommended components. \$\endgroup\$ Commented Feb 2 at 16:26
  • \$\begingroup\$ You said you bought an ST-Link/V2 from AliExpress. That must be an illegal clone. Also you never told how you connected it. A real ST-Link/V2 requires the 3.3V supply from MCU to use same IO levels with the target MCU. You also said you copy-pasted the Blue Pill design and that is unfortunate because most things related to MCU are not entirely wrong but against manufacturer suggestions how to connect it so definitely not recommend to copy it but read the datasheet how it should be done. \$\endgroup\$ Commented Feb 2 at 17:02

2 Answers 2

0
\$\begingroup\$

I made a project with STM32F407VGT6 (Datalogger2039), and a similar problem was occurring, but I discovered that I had caused the problem, so I left this warning below in the repository, maybe it might be useful to know:

Note: If the pins PA13 (SWDIO) and PA14 (SWCLK) are used (configured for another option other than the default state) it may prevent the ST-Link from working, to solve this problem, keep the BOOT0 (pin 94) in logical state high (3.3V) before energizing (reset the microcontroller). To not need to manually change the BOOT0 pin, keep the pins PA13 (SWDIO) and PA14 (SWCLK) unused, it also cannot be configured as input.

\$\endgroup\$
0
\$\begingroup\$

Fixed it.

Made a new PCB, Boot0 pin -> 10kR resistor and then left it unconnected to GND. Also, forgot to add 100nF on analog power for the MCU (so I added it) and added 10uF capacitor also for the same MCU. Code is the same.

Now it works fine, I can completely debug it now.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.