I am working on Nucleo board programming circuits. This board programs like an Arduino, you can compile, run and show data on the serial port. Actually, you can do debugging, too. You just need a USB input for everything.

I designed a flight computer that has SWCLK,SWDIO,RST,RX,TX pins for programming. I thought I can combine that programming like ST-link which is on the Nucleo board, but I can't reach my goal. (I mean, I compile and run the code from Nucleo ST-link but I can't see anything on the serial port.) I can't program it like an Arduino or Nucleo board.

Any idea for this problem?

Normally the ST-link debugger is enough for embedded programming, but I want to use the serial port, too.

enter image description here

Pins which I put into the PCB.

enter image description here

Nucleo ST-link

enter image description here

enter image description here

enter image description here

This is the wiring which I use for programming my flight computer.

  • 1
    \$\begingroup\$ It ia difficult to understand what exact parts you have used and how are they connected together, especially how your serial TX/RX is connected and where? \$\endgroup\$
    – Justme
    Mar 30, 2022 at 22:00
  • \$\begingroup\$ Connections on this drawing are correct. GND is missing, but I guess you have connected it correctly. Make sure if you have enabled UART/USART in your software. \$\endgroup\$
    – Kamil
    Mar 30, 2022 at 22:33
  • \$\begingroup\$ I follow this step above for wiring. UART/USART pins just for Serial port. I took data on this section UART. When I saw the data from UART but I couldn't progmming at the same time. I mean just using an USB input for everything(Programming, debugging and reading data on serial port). But I couldn't. What is the point which I missed? \$\endgroup\$
    – TA2ERR
    Mar 31, 2022 at 5:24

1 Answer 1


The Nucleo development board includes an "embedded" ST-Link MCU that is separate from, and in addition to, the target STM32 MCU that you're developing for. The embedded ST-Link MCU provides several features via the USB interface, including:

  1. A single wire debug (SWD) interface to the target STM32 MCU.
  2. A virtual COM port to one of the target STM32 MCU's UARTs.
  3. A mass storage interface (virtual drive/filesystem).

The ST-LINK V2 compatible programmer device shown in your first picture supports only the SWD interface. It does not provide the virtual COM port or mass storage interface features that the Nucleo's embedded ST-Link MCU provides.

If you want to use a virtual COM port with your custom board then you could use a TTL to USB serial adapter cable (such as this or this). You would need to use two different USB ports on your development system, one for the ST-LINK V2 debugger, and another for the TTL to USB serial adapter cable.

Alternately, you may be able to use the embedded ST-Link MCU on the Nucleo board to both debug and provide a virtual COM port to your custom board. This would entail disconnecting the embedded ST-Link MCU from the Nucleo's target STM32 (via some jumpers), and then connecting the embedded ST-Link MCU to your custom board (via some flying wires). See sections 6.2.4 and 6.8 in the Nucleo-64 User Manual for more information.

  • 2
    \$\begingroup\$ Further alternatives including a virtual COM port are: ST-Link V3 MINI or Black Magic Probe. I think it's also possible to convert an ST-Link V2 clone into a Black Magic Probe. \$\endgroup\$
    – Codo
    Mar 31, 2022 at 15:47
  • \$\begingroup\$ Thank you so much guys. I will work from your returns. I save lots of time. \$\endgroup\$
    – TA2ERR
    Mar 31, 2022 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.