STM32 & ST-LINK – Cannot connect to MCU after successful programming

flashprogrammingst-linkstm32

I have built my own board with STM32F7-45VGT6. I have successfully programmed it with ST-LINK v2 (not the original one though) and now I cannot even connect with MCU.

I use ST-Link Utility from ST and SWD interface. It can be the case that I use SWD pins as output and in my code I set them as GPIO output. Can it be the case?

Nevertheless, I connect my reset pin to GND and set "Connect under reset" option in ST-Link Utility but it doesn't work… What can I do?

On the Internet, I have found something about using BOOT0 Pin, but I don't know exactly…

Best Answer

I managed to solve that problem. If anybody encounters similar problem, here's what I've done:

I used ST-Link v2 and ST-Link Utility. In setting, I set "Connect under reset" and SWD interface (I'm not sure about frequency).
Then I press the reset button on my board and clicked "Target" -> "Erase chip" and just after clicking I released the button - It erased the chip so I can now reprogram my MCU.


Anyway, if you need to use SWD pins as output, then add some delay at the beginning of the program or use some jumper to disable/enable setting these pins as outputs.