USART on STM32F411 BlackPill

Post Reply
Posts: 6
Joined: Sat Jul 25, 2020 8:22 pm

USART on STM32F411 BlackPill

Post by konczakp »


Could someone explain me why on earth on the board diagram of the blackpill there are three USART1 ports (rx1 on pins PA10,PB3,PB7 ant tx1 on pins PA9,PA15,PB6). I was able to run USART1 on PB6 and PB7, USART2 on PA3 and PA2 and the USB-C is on the PA11 and PA12. Are the other USART1 pins some how usable as separate rx-tx ports. If Yes than How? If not then why they are there. Usually if some pins are multi usage (like USART and I2C etc) then they are usable but in this case I was not able to get the other USART1 to run.


Posts: 80
Joined: Wed Jan 15, 2020 11:30 am
Answers: 5

Re: USART on STM32F411 BlackPill

Post by GonzoG »

Those are alternate pins.
PA9 and PA10 are used with USB,
PB6 and PB7 are used with I2C1
so if you cannot use them you have 3rd pair: PA15 and PB3 but you need to change pin assignment: ... wareserial

Posts: 390
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 7
Location: Munich, Germany

Re: USART on STM32F411 BlackPill

Post by stevestrong »

Which block diagram do you refer to?
How did you manage to use USART1 on PB6/7?
Please always post links/code, otherwise we cannot read your thoughts.
PA9/10 are usually TX1, RX1.
PA12/12 are USB pins.

Posts: 6
Joined: Sat Jul 25, 2020 8:22 pm

Re: USART on STM32F411 BlackPill

Post by konczakp »

Thanks GonzoG for the link. I omitted this info somehow ... But thanks to this I was able to redirect USART1 to different pins. At the begining I was doing this wrong.
SteveStrong You are right, thanks for the correction. I've made a mistake in first post putting wrong pin names.
Now HW Serial is working as in here:

Code: Select all

HardwareSerial Serial2(USART2);

#include <SoftwareSerial.h>

SoftwareSerial mySerial(PB1, PB0); // RX, TX

void setup() {

void loop() {
  Serial1.println("hello 1");
  Serial2.println("hello 2");
  mySerial.println("hello 3");

I was referring to this diagram*ixFS ... 0w6jFA.png

Unfortunately I'm still having problems with getting the SoftwareSerial running. It is also in the code above and it is not sending any data. Someone else has similar problem so I wrote also in other thread but still nothing. Can You guys help me with this also?

Post Reply

Return to “STM32F4 based boards”