Normally, if your ST-link utility is giving you the “cannot connect to target” message while you’re trying to flash firmware on an STM based module, you’ve messed up one of the following:
- The soldering on the STM
- The connection/wiring between the ST-link/Disco board and the module
- The ST-link utility target settings (Connect under reset, etc)
…but not always.
Having built another UTides 2, I flashed the Factory test firmware and calibrated it and built the Hex file.
Using a Windows 10 laptop, I go to connect again and flash the calibrated firmware and…nope. It connects once, immediately disconnects, and simply won’t talk to the module again. The laptop recognises the Discovery Board I’m using, everything seems fine, but I can’t even get it to talk to previously built, functioning and flashed modules.
After the usual checks, rebooting the machine, re-installing the USB driver, re-installing ST-Link Utility, trying different USB ports etc, I give up and install ST-Utility on an old Windows 7 laptop – which instantly connects and works.
Now, it could be my Windows 10 laptop has its ports on an internal hub, which the ST-links can be picky about. Or it could be that there’s something not properly configured, etc. But I thought I’d share this in case anyone else runs into the same problem and spends ages debugging the PCB, believing it’s their build at fault.
Try another machine!