Page 2 of 2

Re: ST-LINK V2.1 doesn't connect COM port for serial monitor

Posted: Wed Jul 03, 2024 7:37 pm
by STM32ardui
ag123 wrote: Wed Jul 03, 2024 6:55 pm make sure boot0 is at gnd so that it doesn't trip stm32f103 into programming mode on reset.
BlackPill has 2 buttons to set chip into boot mode.
But with SWD and STM32CubeProgrammer I don't need to push them, Programmer sets it automaticly into bootmode.
Is BluePill different?

Re: ST-LINK V2.1 doesn't connect COM port for serial monitor

Posted: Wed Jul 03, 2024 7:47 pm
by ag123
blue pill (stm32f103) doesn't have DFU, but that it can be programmed on uart1 pa9 tx pa10 rx.
normally for the 'old' blue pill (stm32f103), boot0 (and boot1) are *jumpers*, and boot0 has to remain at gnd, if one do not want to trip stm32f103 into programming mode, especially if pa9 tx and pr10 rx is connected

st-link i.e. swd doesn't depend on boot0, but that sometimes one need to press reset on the board to connect it seemed.

Re: ST-LINK V2.1 doesn't connect COM port for serial monitor

Posted: Thu Jul 04, 2024 10:48 am
by justinjools
I found the solution here, below. I can confirm this works for anyone else having this problem. You need to connect STM32 MCU to USB for serial monitor and ST-LINK for downloading. In Arduino IDE You can then see two ports and connect to the USB port for monitoring.

You also need to select a different board name variation for serial monitor otherwise it won't connect with the same one (bottom pic).

"ST-Link is not a Serial adapter, it is a programmer. You can't open a Serial Monitor over ST-Link.
to see the Serial prints connect the Blue Pill with USB cable. without bootloader listening on USB you can't upload over USB but it works as Serial (or Serial1?) with Serial Monitor or other terminal program"

viewtopic.php?t=90

Re: ST-LINK V2.1 doesn't connect COM port for serial monitor

Posted: Thu Jul 04, 2024 11:05 am
by justinjools
I bought this adapter for this purpose but it doesn't fit. They made JTAG header too wide to fit this type of closed male JTAG socket. I think it is only designed to open male pins. I'm thinking of doing some DIY adapter with 1.27mm ribbon cable now. These things I'm sure are designed to drive us mad!

JTAG (2x10 2.54mm) to SWD (2x5 1.27mm) Cable Adapter
https://www.adafruit.com/product/2094