I'm using Keil uVision V5.22.0.0 and I'm trying to work with a STM32 Nucleo board, which has ST-LINK built into the board. When either debugging or downloading to flash using uVision, it works for about a minute (sometimes more, sometimes less) and then I get a small popup window saying "ST-LINK USB communication error". I can unplug the USB cable, plug it back in, and then it works again for a short period of time.
I'm not sure the best way to determine the ST-LINK driver version, but if I open the STM32 ST-LINK Utility Application and go to Help->About, it says that STLinkUSBDriver.dll is v4.4.0.0.
I've tried different USB cables and different USB ports on my computer. Same problem.
Any ideas?
Thanks.
Two quick updates:
- I tried a different Nucleo board and one of the example programs from STMicro for this board. Same issue.
- The error message in the popup window when it fails while in the middle of debug session is "Cannot access target. Shutting down debug session." In both this popup and the one I mentioned in the original post, the title bar of the popup window says "Debugger - Cortex-M Error".
Thank you.
Make sure you don't have any WFI or low power code in there. The debugger can't sustain a connection if the logic turns off.
Reprogramming the GPIO pins used by the debugger is also a surefire way of losing connectivity.
If you think it is an issue with the pod/drivers, update those to current releases.
Thanks for the good ideas. Unfortunately, none check out. There is no low-power code, the debug pins aren't used for anything else, and I verified that I have the latest drivers.
Still trying to figure it out...