cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to program a Nucleo board via an external ST-Link V2

CraigORV
Associate II

Hello,

As the questions says, I'm having difficulty programming a Nucleo-F334R8 board directly via the PA13 and PA14 SWD pins.

After removing the jumpers on the built-in ST-link (CN2) I have connected the external ST link directly to the SWD, reset, ground and power pins on CN7. However, the STM32CubeProgrammer is failing to detect the board at all. I have tried multiple settings for 'mode' and 'reset mode' options to no avail, getting a "Error: Problem occured while trying to connect" message every time.

I have also tried with the old ST-LINK utility with the same result. I have tried my external ST-link on an old STM32L-discovery board lying around and was able to read the flash from that fine, so presumably the problem lies with the nucleo part.

Am I missing something here? I can't figure out why this shouldn't work. I had a feeling it may be because the built-in ST-link is still present but I don't want to snap that off the board before I know that the alternative will work.

4 REPLIES 4
TDK
Guru

Did you disconnect the on-board ST-Link connection? There are jumpers for SWDIO/SWCLK. Also make sure it's not holding the chip in reset.

Why would you not just use the on-board ST-Link?

If you feel a post has answered your question, please click "Accept as Solution".
CraigORV
Associate II

Yes, I disconnected the two jumpers on CN2 marked "ST-LINK / NUCLEO". The reset pin is being held high (not in reset).

I can't use the on-baod ST-link in the final project... The nucleo is going to be mounted to the underside of a carrier PCB where it is out of sight and inaccessible, but must still be able to be programmed. To do this I've added a header to the top of the carrier PCB for the ST-Link to connect to the SWD pins of the nucleo board. It sounds strange but it's a necessity for the project.

You'd need to inject SWDIO/SWCLK on the Target facing side of the CN2 pins

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

Those pins are directly connected to PA13 and PA14 on the nucleo header (CN7), so it should make no difference. Also, when the ST-link has been snapped off those pins won't exist at all...