I have a stm32f072 discovery kit to use as a debugger for my project. I accidentally programmed the MCU of that discovery kit and now when I try to debug with IAR embedded workbench it stuks in busy without writing the falsh. The four LEDs are always off. Can someone tell me how to restore that kit?
Asked
Active
Viewed 2,163 times
1 Answers
0
I have done this a few times with various disco boards.
First make sure all of the jumpers are back in the correct position for the onboard target (see the manual).
Now compile a project for the onboard target. Press and hold the hardware reset button on the disco board. While still holding the reset button click to start the download in your PC software, after a couple of seconds release the reset button. You may have to repeat this process a few times until you get the timing right but it usually works.
If that fails then read AN2606 to see how to boot your board into the buit-in bootloader (usually some combination of levels on boot pins). Once that is started you should be able to connect over SWD at your leisure.

Tom V
- 4,827
- 2
- 5
- 22
-
Hi @Tom V, will this procedure restore the factory condition of the disco board? Which project should I compile and download? – Andrea Jan 15 '22 at 10:18
-
This will allow you to regain control of the device by SWD/JTAG. You can then program whatever project you want. The one that is programmed in the factory is called "demonstrator" in the STM32 Cube package. Even that won't guarantee to restore factory condition because you might have written to OTP or set option bytes. – Tom V Jan 15 '22 at 11:31
-
Ok thanks, I'll try to do that – Andrea Jan 15 '22 at 11:51
-
It doesn't work, in artenative could I restore the disco board using the original binary file and the st-link utility? – Andrea Jan 15 '22 at 13:45
-
Have you read the appropriate part of AN2606? How have you verified that the processor has booted to the internal bootloader? – Tom V Jan 15 '22 at 14:01