I have built several boards with STM32F405 on them and I have been flashing them with a cheap china ST-Link knock-off from eBay which worked perfectly for many months now. However, I now noticed, that my STM32F405 board is no longer accessible through the ST-Link (No Target Detected with ST-Link utility and STM32CubeIDE). However, the code runs fine on it! The LEDs are blinking and output is written to the SD-Card.

I am not able to do a chip erase on ST-Link Utility, because for that it needs to be connected. The issue exists on three of my boards, which have previously been flashed with the same cheap china ST-Link. I suspect that the boards have entered memory protection level 2 (RDP), thus no longer accessible via SWD, and thus bricked. ST-Utility does however not tell me that there is read out protection enabled (I don't know if it would..) it acts as if the SWD line is not connected, but I checked with a multimeter and they are... I enabled "connect under reset" and I see that the STM32 is resetting, but nothing else happens, still no connection established...

I also ordered a genuine ST-Link, and the issue appears the same.

Since I do not see any other common link between the three boards (2 have similar software, but the third has a really different software on it, the only thing in common is the drivers for the I2C and SPI sensors that are attached to the chip), I suspect that the problem could come from the cheap china ST-Link. Is that a known problem? Or do you have any other inputs? I am certain, that I did not set the memory protection flag when flashing the chip (I actually don't know how I would do that with STM32CubeIDE).

When I last flashed the board with the cheap china ST-Link I was using STM32CubeIDE on my macbook pro. ST utility was used on a virtual machine running windows 10.

All three custom STM32 Boards failed on the same day, two of them are physically the same, but running slightly different software, the third one has a much different schematic (but all use an STM32F405)

BOOT0 and BOOT1 are connected to ground through a 10k resistor, the board gets a solid 3.3v from the ST-Link. Crystal is connected with capacitors but not configured in the software. The SWD pins are not configured as anything else in software, I used the STM32CubeIDE graphical configuration tool and used them for debugging.



Conditions when it failed: High humidity (10 °C and up to 80-90% humidity) in a tent during one week (though other boards survived without any issues). Board has no conformal coating.

Schematic of one of the boards is attached.enter image description here

EDIT 2: The third board is not actually broken, it works with the genuine ST-Link but not with the replica one, however the first two boards do not work with either of them.. so there is definitely something wrong with the replica ST-Link..

  • \$\begingroup\$ Do those chips have a dedicated ERASE pin like Atmel's Cortex chips have? \$\endgroup\$ Dec 15, 2020 at 23:47
  • 1
    \$\begingroup\$ Did a china ST-Link brick my STM32F4? ... that is only answerable by someone that can examine the ST-Link and the STM32F4 .... could ST-Link have bricked my STM32F4? is answerable without examining the hardware \$\endgroup\$
    – jsotola
    Dec 15, 2020 at 23:53
  • 1
    \$\begingroup\$ try erasing the whole chip using internal bootloader. its available on few pripherals. it gives better clues \$\endgroup\$ Dec 15, 2020 at 23:55
  • \$\begingroup\$ It's very unlikely that your problem is related to the fact that the ST-Links are clones. It's more likely that your firmware has configured one of the SWD pins for other purposes than SWD. Connecting under reset can help in such a case but is difficult to achieve. I would first try the built-in bootloader on one of the UARTs (as proposed by @TirdadSadriNejad). See application note AN2606 for details \$\endgroup\$
    – Codo
    Dec 16, 2020 at 6:52
  • \$\begingroup\$ In what situation did it break? If there was an ESD event or a lot of voltage difference between the devices when the JTAG cable was plugged in or unplugged, it is possible that a JTAG data pin was first or last to connect and the MCU IO pin has damaged by overvoltage event. This can happen if connecting a board with 2-prong ungrounded power supply to a PC with 3-prong grounded supply. Or even worse if any device has a grounded plug but is connected to ungrounded mains socket. Also note that an original ST-LINK will not provide power to the target, so your board needs external power. \$\endgroup\$
    – Justme
    Dec 16, 2020 at 10:16


Your Answer

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