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