cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to program Nucleo 32 board via an external ST-LINK programmer

JDick.2
Associate II

I have this Nucleo 32 board namely STM32F303K8. I power it externally from 5V pin, so I removed the solder bridge SB9. In this case, the on board embedded ST-LINK is not powered but if first the board is powered then the USB is plugged one can still use the USB port to debug or program.

Here is the detailed pinout of Nucleo 32:

https://i.stack.imgur.com/bW5M1.png

But my question is about programming this board by an "external ST-LINK V3". The board has CN2 with SWD pins. The manual shows the following about it:

https://i.stack.imgur.com/1AUQm.png

And then I wired from the external ST-LINK V3 to the board as follows:

https://i.stack.imgur.com/0h7cT.jpg

I checked many times the wirings and powered the board from an external 5V source before ect. but none of them works. I get target not found error. And remedies on hardware reset. software reset ect. never worked.

Does that mean the CN2 works only for programming other microcontrollers but not programming the main microcontroller of the board itself by an external programmer?

And what else can I try to program or debug this board without using its USB port(without using its on board embedded ST-LINK) but program it with my external ST-LINK V3? I cannot fond any info on that particularly for Nucleo 32. (Like via USART?)

9 REPLIES 9

Doesn't that connector go to the on-board ST-LINK to program that? Check the schematic.

You'd need to access the PA13/PA14 pins on the F303

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

Using CN2 I tried to program F303 by the ST-LINK V3 by the wiring here: https://i.stack.imgur.com/0h7cT.jpg But it doesn't work. I get target not found error.

JDick.2
Associate II

It seems to me in CN2 the STM_JTMS on the reference schematic is the SWDIO to the debugger’s MCU(embedded ST-LINK) and STM_JTCK is the debugger’s SWCLK connection. So CN2 is not routed to the main microcontroller.

Andreas Bolsch
Lead II

Yes, CN2 is for programming the STLink's F103. To access the board's main MCU via SWD you've to keep STLink's F103 silent: pull its NRST pin low permanently, e.g. by soldering a wire from junction R9/C4 to GND. But the F103 must be powered normally, otherwise it might be (partially) powered via T_* pins and behave erratically.

And PA13/PA14 of the main MCU are not available on CN3/CN4, so can be connected to only by soldering enamelled wires to the pins :(

BTW: The Nucleo-32 are essentially MCU+STLink, nothing else. If you don't want to use the internal STLink, you're better off with a bare F303 on a simple LQFP32 adapter board ...

Hello thank you for the answer. I thought so. But is there any way to program the main MCU not via SWD but via UART? I need a solution which doesn't require soldering. So is it possible to use some accessible UART RX TX pins of the MCU and program the MCU by using an external ST-LINK V3? (In my case SB9 is OFF to use external power so embedded ST-LINK is not powered unless USB is plugged)

What's this about programming via UART by an STLink??? For employing the bootloader you need only a serial port with 3.3V levels, not an STLink. Any of the simple FTxxx, CHxxx, ... serial port adapters (without level shifters) with 3.3V supply will do.

Hi I see thank you. In my case I externally power this Nucleo board and do not use the USB. And I made SB9 OFF.

I have a 3.3V FTDI USB-to-serial port adapter. So you wrote I can use it to program the main MCU. But after I make the TX RX wiring between the MCU and the FTDI adapter, what software do I need to upload the code to the MCU?

E.g. CubeProgrammer (https://community.st.com/s/article/how-to-use-the-st-open-bootloader-for-stm32-microcontrollers), stm32flash, ...

As the bootloader protocol is rather simple, writing your own software is rather straightforward.

Anyway, the serial bootloader requires NRST and BOOT pins/ option bits to be taken into account, so I'd say NRST/SWD is to be preferred.

In my case the Nucleo F303K8, this board does not have accessible BOOT0 pin on board. I guess this should be pulled up HIGH. But the board doesnt have an accessible pin for BOOT0.

Why do you say NRST/SWD ? As I said Im looking for non USB option. USB will not be connected in my case.