0
\$\begingroup\$

I got myself an STM32F411RCT6 and my ST-Link V2 is not detecting it using SWD, but I am able to program other STM32s using an even simpler setup, so I think there is something specific about this MCU that I'm missing. I've combed through the datasheet and looked at other schematics for the same chip, but I can't figure out what I'm doing wrong or missing.

This is my schematic: STM32F411 Schematic

Some notes:

  • The ST-Link V2 supplies the power to the circuit (3.3v) and has only 4 wires connected (3.3v, GND, SWDIO, and SWCLK) I have no hardware reset on the programmer (My other STM32s use software resetting) but I did add a reset switch to the circuit to manually reset the chip.
  • With the analog supply (VDDA) connected to 3.3v, the VCAP1 pin generates +- 1.2v (As it should, according to the datasheet). I initially did not connect VDDA to 3.3v, and the VCAP1 voltage was at 0v, but when bridging certain pins on the left side of the QFP64 chip with my finger, the VCAP1 voltage jumped to +- 0.7v, and the ST-Link V2 was able to detect the chip (I discovered this accidentally, and can reproduce it 🤷‍♂️). It is not a reliable trick to try programming the chip with, but it makes me think that my problem lies with one or more of the pins on the left side of the package.
  • The circuit on the schematic was the end result of my troubleshooting, I initially connected only one VDD and VSS pin, as well as the SWDIO and SWCLK pins to try and program it, and that is how I discovered the weird finger trick above - I can program my other STM32s (MM32F031C6T6) by only connecting the 4 pins from the ST-Link V2 (No capacitors, no oscillator, and no connections or switches on the BOOT and reset pins)
  • I reset the chip with the BOOT0 pin pulled high to see if maybe I need to use the bootloader, but it did nothing.
  • The HSE is not in use (I think) because it has not been programmed to use it yet, but I added it to my circuit as the intended oscillator. (The HSE also wasn't connected when the weird finger magic from the previous point happened)
  • I have a 100nf capacitor connected between each of the VDD pins and GND, but I simplified my schematic.
  • When connecting VDDA to 3.3v, I cannot reproduce the finger trick above, even though the VCAP1 voltage does jump around a bit when doing it.

Update: I soldered a USB connection on to the circuit and changed the oscillator to a 25mhz one, and also removed the series resistor, to see if I can boot the chip into DFU mode, and this works, but only for a few seconds (Windows device manager shows the STM32 Bootloader USB device, and after a few seconds it disappears). After it disconnects from USB, it cannot be rebooted back into DFU mode again, unless I've left it powered off for a minute or so.

I also tried what was suggested in the comments with the capacitor on the reset switch, but as expected, this made no difference.

I tried connecting to it using STM32CubeProgrammer, and the USB connection also disappears the moment I connect to it. I then found the with STM32CubeProgrammer I can connect to it using SWD, but I cannot write to, or erase the chip, it throws errors, but this connection remains conencted as long as I don't try writing to the chip.

I've looked at the ADAFruit STM32F411 Blackpill board to follow their circuit as closely as possible, but I'm not having any luck getting it to work reliably.

Below is the updated schematic.

Updated STM32F411 Schematic

Hopefully someone can help point out where I'm going wrong.

\$\endgroup\$
17
  • \$\begingroup\$ There is no info how you connect to the ST-Link. Show that diagram, with VCC, GND, SWDAT and SWCLK, Reset too. How do you power the MCU, from where does the 3.3V come from? \$\endgroup\$
    – Justme
    Commented Mar 11, 2023 at 20:55
  • \$\begingroup\$ @Justme I added the first point to my list to explain your comment \$\endgroup\$ Commented Mar 11, 2023 at 21:01
  • \$\begingroup\$ Is it a genuine ST-Link/V2 or a clone? \$\endgroup\$
    – Justme
    Commented Mar 11, 2023 at 21:03
  • \$\begingroup\$ @Justme it is a clone, but I'm quite certain the programmer is not the problem, as can be deduced with the finger trick. It is a state of the chip that dictates if the programmer can communicate with it or not. \$\endgroup\$ Commented Mar 11, 2023 at 21:06
  • \$\begingroup\$ OK. Because that is important info you must add to question. A genuine ST-Link/V2 would not power a target, so I already thought I had solved your problem. The reset has a pull-up and no capacitor - that's not how it should be done. \$\endgroup\$
    – Justme
    Commented Mar 11, 2023 at 21:09

1 Answer 1

1
\$\begingroup\$

Judging from the updated schematic, I believe your power supply is unstable. If we take a look at the datasheet of the AP1117 that you're using to generate the 3.3V, it says:

Input Capacitors

To ensure stable operation, the input supply must be low impedance up to a frequency of a few MHz. This requires a closely placed input decoupling capacitor of 4.7μF minimum. This can be either ceramic or solid tantalum. The ESR of this capacitor must be less than 0.5Ω.

According to the schematic, yours is 100nF which is obviously not sufficient.

Furthermore, the minimum load current of the AP1117 is between 5 and 10 mA (page 4 of the datasheet). Since you have nothing connected to the LDO besides the MCU, we can look at it's datasheet to see how much current it's expected to draw.

enter image description here

As we can see, even when in run mode with all peripherals enabled, it can fall well below 10 mA and even 5 mA. In sleep mode and stop mode its current consumption is even lower (as expected).

\$\endgroup\$
1
  • \$\begingroup\$ Oh I wasn't aware of the minimum current limit. I'll swap out the capacitor and just add an LED to the circuit to bump the load up, and try again. Hopefully that solves the DFU issue. Thanks for the feedback \$\endgroup\$ Commented Mar 17, 2023 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.