cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link and the STM32F4 Discovery

gabriel
Associate
Posted on February 06, 2014 at 01:21

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.

11 REPLIES 11
nawfal3
Associate II
Posted on April 22, 2014 at 17:55

use the BOOTx pins is highly recommend.

 

How can I use the BOOTx pins...please check the document attached illustrating my pcb design

________________

Attachments :

PINS.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzrk&d=%2Fa%2F0X0000000bQU%2FTMG05tA9eDgCvs85Mnq5xRi8JFJtWIg4nWWuV9Na2Ms&asPdf=false
nawfal3
Associate II