AnsweredAssumed Answered

ST-Link and the STM32F4 Discovery

Question asked by lodolce.gabriel on Feb 6, 2014
Latest reply on Apr 22, 2014 by motii.nawfal
Hi Everyone,

Sorry if this is a repeat post, I'm pretty sure I've looked through all of the past discussions related to this and still have not found a solution.

I designed a new board using the STM32F427 and have been unable to program the device using the external ST-Link V2 hardware via SWD or JTAG. I'm simply using the ST-Link Utilities on a windows 7 machine. I can connect to the device, read its ID/revision, read the program memory and erase it, but as soon as I try to program the device the ST-Link Utility disconnects with the following error:

Internal command error
Cannot connect to the device!

I've noticed that this also erases the program memory (since I can program it via the USB boot loader).

Now on to why I posted this in the STM32 Discovery section …

Since this is my own board design I figured, hey lets try this on the STM32F4 Discovery to make sure I didn't mess up the design. Sure enough I have the same exact problem when I try to flash the discovery board using the SWD header (CN2) which bypasses the ST-Link chip on the discovery board.

Early on I was unable to even talk to the F427 on my board until I updated the firmware of the ST-Link V2. This leads me to believe there is a firmware issue on the ST-Link.

I found some old posts stating the ST-Link firmware was incompatible with rev Z of the STM32F407, but that it had been fixed. I did not see anything about this in the current errata sheets.

The software I am loading is very simple (flash an LED). I am not changing any of the GPIO settings for the pins related to the SWD or using any of the sleep functions.

Last, I've connected SWDIO, SWCLK, NRST, one 3.3V line and one return line of the ST-Link to the discovery board. I have not connected SWO as it should not be needed - I will give that a try though.

Thanks for any suggestions.


Outcomes