cancel
Showing results for 
Search instead for 
Did you mean: 

External ST-LINK/V2 programmer/debugger with STM32F4DISCOVERY board

michele239955_stm1_st
Associate II
Posted on January 09, 2014 at 15:39

Hi,

I have bought:

1)a STM32F4DISCOVERY board (with on-board ST-LINK/V2 programmer/debugger)

http://www.st.com/web/en/catalog/tools/PF252419

2)a separate ST-LINK/V2 programmer/debugger.

http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168

 

I have downloaded and installed on my PC (windows XP) the following tools:

1) STSW-LINK003 (ST-LINK/V2 USB driver for Windows 7, Vista and XP)

http://www.st.com/web/en/catalog/tools/PF258167

2) STSW-LINK004 (STM32 ST-LINK utility)

http://www.st.com/web/en/catalog/tools/PF258168

 

So, I have:

STM32 ST-LINK Utility.exe v3.2.1

STLinkUSBDriver.dll v4.2.4.0

ST-LINK_CLI.exe v1.8.1

I have verified, by the ST-LINK utility, that:

1)ST-LINK/V2 adapter firmware version is ''V2.J17.S4 JTAG+SWIM Debugger''

2)On-board ST-LINK/V2 programmer firmware version is ''V2.J14.S0 JTAG''

 

When I connect by a USB cable the PC with STM32F4DISCOVERY board (with jumpers JP1 and CN3 ON), and I try to the target by the menu command ''target->connect'' of the ST-LINK utility, I obtain the following log messages (connection OK):

        ST-LINK Firmware version : V2J14S0

        Connected via SWD.

        Connetion mode : Connect Under Reset.

        Debug in sleep and stop mode enabled.

        Device ID:0x413

        Device flash Size : 1 Mbytes

        Device family :STM32F40x / STM32F41x

However, when I try to connect the target by using the separate ST-LINK/V2 programmer/debugger, I obtain the error message ''can not connect to target''. The ST-LINK/V2 status led is initially RED (communication between the PC and ST-LINK/V2 is established), then (when I try to connect the target) becomes blinking GREEN/RED (data are being exchanged between the target and the PC), and finally becomes ORANGE (ST-LINK/V2 communication with the target has failed).

To perform this trial, I have:

1) removed the two CN3 jumpers (to switch to the external programmer/debugger)    

2) connected the STM32F4DISCOVERY board with the PC by an USB cable (only for power supply)

3) connected the ST-LINK/V2 with the PC by an USB cable

4) connected JTAG/SWD connector (20 pin) of the ST-LINK/V2 to SWD connector (6 pin) of the STM32F4DISCOVERY board as in the following:

    VDD        pin &sharp1  of JTAG/SWD 20-pin connector on ST-LINK/V2 <-> pin &sharp1 of SWD

      6-pin connector on STM32F4DISCOVERY

    VDD        pin &sharp2  of JTAG/SWD 20-pin connector on ST-LINK/V2 <-> pin &sharp1 of SWD

      6-pin connector on STM32F4DISCOVERY

    GND        pin &sharp4  of JTAG/SWD 20-pin connector on ST-LINK/V2 <-> pin &sharp3 of SWD

      6-pin connector on STM32F4DISCOVERY

    SWDIO    pin &sharp7  of JTAG/SWD 20-pin connector on ST-LINK/V2 <-> pin &sharp4 of

      SWD 6-pin connector on STM32F4DISCOVERY

    SWCLK    pin &sharp9  of JTAG/SWD 20-pin connector on ST-LINK/V2 <-> pin &sharp2 of SWD

       6-pin connector on STM32F4DISCOVERY

    NRST    pin &sharp15 of JTAG/SWD 20-pin connector on ST-LINK/V2 <-> pin &sharp5 of SWD

      6-pin connector on STM32F4DISCOVERY

        

Someone knows why the configuration with the external ST-LINK does not work?

Michele

#st-link/v2-stm32f4discovery #.
6 REPLIES 6
Posted on January 09, 2014 at 15:44

The point of doing this would be what exactly?

Have you looked at the solder bridges?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
michele239955_stm1_st
Associate II
Posted on January 09, 2014 at 17:14

Hi,

Thank you for reply.

I want to test and verify the ST-LINK/V2 emulator, because I will use it to program and debug a custom board with the STM32F4.

Solder Bridges configuration of the STM32F4DISCOVERY board is the default one described in Table 4 at pag. 19 of UM1472 (User manual - Discovery kit for STM32F407/417 lines)

Michele

Posted on January 09, 2014 at 17:26

The discovery board has an ST-LINK soldered on it, kind of demonstrates the functionality.

There are other boards with standard 20-pin and 10-pin JTAG/SWD headers that might be a simpler target. There are schematics a plenty to demonstrate how this works.

I mentioned the solder bridges because the connector on the DISCOVERY board is designed for OUT BOUND communications, you need to break the SWDIO, SWCLK, SWO and NRST connections to the F103 part that's performing the ST-LINK functionality now, if you want to supplant that with connectivity to your external ST-LINK.

Review the schematics, understand the signal paths.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
michele239955_stm1_st
Associate II
Posted on January 09, 2014 at 19:10

Thank you, I will consider the Evaluation board for STM32 F4 series, instead of the Discovery board.

Bye

Michele

jvavra
Associate III
Posted on January 10, 2014 at 19:46

I have this same issue when using an external ST-Link V2. I have also ensured that I have the latest V2 firmware, as well as the latest driver. The ST-Link V2 enumerates fine when I connect to my laptop. However, I am unable to connect to my target board. I get repeated ''Can not connect to target'' errors. I have tried ''Normal'', ''Hot Link'' and ''Connect Under Reset'' modes. 

I CAN connect to this board using an IAR J-Link (made by Segger) in JTAG mode. The pinning on the 20-pin connector is identical between the two. However, the JFLASH utility that Segger provides does not allow access to the Option Bytes like ST-LINK does, so I need to get this working. 

Any suggestions are appreciated.  

Posted on January 10, 2014 at 20:58

Well the ST-LINK isn't really what I'd call a commercial solution, the Segger guys have a lot of practical and learned knowledge about this stuff.

I'd pay attention to what the NRST pin is doing, and what you have going on in your firmware early in the boot/reset sequence. Wrestling a processor to a stop initially is a key part of the task.

It is also not necessary to rely on SWD/JTAG tools to program option bytes, these are things you can initialize or change from within your own application code, or boot loader.

Keil allows you to select a programming algorithm for the debugger which is agnostic to which pod you are using.

0690X000006053TQAQ.png

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..