cancel
Showing results for 
Search instead for 
Did you mean: 

Programming a Nucleo board using SWD connector and STM32 ST-LINK Utility

Muscle Man
Associate III
Posted on May 02, 2017 at 18:07

Hi everyone,

I'm facing some troubles trying to program the STM32L073 micro on a NUCLEO-L073RZ Nucleo board using

the STM32 ST-LINK Utility and the ST-LIN/V2 ISOL debugger/programmer attached to the SWD connector

(named CN2 on the Nucleo board).

I powered the Nucleo board via USB using an AC/USB converter (the JP5 jumper is set on the U5V position

- the one to select when the power is applied via the USB cable).

Also I left connected both the jumpers on CN4 connector to allow the SWD signals to be applied to the STM32 core

(on the Nucleo board user manual expressly STM people say to disconnect them, but I'm afraid that doing so I only

will program the STM32F103 that make STLINK-V2-1 features possible).

Another thing I made it was to connect the 3,3V of the Nucleo board to the pin 1 of SWD connector to allow the

ST-LIN/V2 ISOL to detect the Vdd of the targed board: without this action the

STM32 ST-LINK Utility will no able

to detect and to connect to the STM32 core of the Nucleo board.

With these changes I was also able to erase and then program a binary image that simply blinking the green user led

(LD2): the flash memory checksum and the binary file checksum matched and also the target memory compare 

operation against the binary file contents was successful.

The problem is that after disconnecting the ST-LIN/V2 ISOL programmer and resetting the Nucleo board the green

user led does not blink..

Then if I program again the same binary file using the SW4STM32 IDE (by right clicking on the project and then

selecting the voice 'Target->Program chip..') I can program and run successfully the project.

I do not understand what operation I made wrong or if I missed some passage.

Someone has experienced the same kind of problems?

Thanks in advance for any helps.

Stefano M.

6 REPLIES 6
Posted on May 02, 2017 at 18:39

SMH, Why?

>>but I'm afraid that doing so I only 

will program the STM32F103 that make STLINK-V2-1 features possible

No, but you will be fighting with it's outputs. The SWD header is to program OTHER boards, not an injection point for an external programmer. 

You really want to be removing the CN2 jumpers, and attaching to the SWDIO/SWCLK of the 

STM32L073LZ there.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 02, 2017 at 18:43

Make sure you have current ST-LINK firmware on the NUCLEO, some of the older mbed firmware held the device in reset. Check also Solder Bridges which can be used to disconnect the on-board ST-LINK.

If the LED flashing still doesn't work, you'd need to start probing the part, and debugging.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 03, 2017 at 09:15

Hi,

removing the CN2 jumpers provokes the following error in the log window of 

STM32 ST-LINK Utility:

Can not connect to the target!

 If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->System menu.

 If you're trying to connect to a low frequency application, please select a lower SWD Frequency mode from

 

 Target->System menu.

Currently I have set the Normal mode and a 0,25KHz Frequency Mode, but the error still is present.

Inserting again the CN2 jumpers at least I can connect to the Nucleo board.

Posted on May 03, 2017 at 09:21

The ST-LINKV2 is already upgraded to the firmware version V2J28M18, i.e the last one.

Posted on May 03, 2017 at 18:32

Look, like I said you're connecting to the WRONG place, you want to connect the SWDIO and SWCLK from your external programmer to the STM32L073 *SIDE* of the CN2 jumpers.

The CN2 jumpers connect the onboard ST-LINK, and SWD header on one side, and TARGET CPU on the OTHER side.

If this is still not clear to you, review the schematic for the NUCLEO board more critically.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 03, 2017 at 18:59

Injection points for an EXTERNAL debug pod, remove CN2 jumpers, connect SWCLK to CN2.2 and SWDIO to CN2.4

Removing SB12 and SB15 is also recommended

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