Hello,
I am using WeAct BlackPill STM32F411CE and wondering if I can and how to define the chips Serial6 UART port.
Currently I am using Serial1 for main i/o and will continue using it, but I want to move from i2c Gyro to a serial port Gyro. Problem is I have already used Serial2 pins for other functions and would be BIG issue to rewire/design my board.
Hence, how to use hardware Serial6 which is wired on the board to USB or I guess other option might be Software Serial but I am reluctant to try this I think this F411 is running flat out and Software serial might be too much for it.
Many thanks in advance imk
C:/Users/Me/AppData/Local/Arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\Me\AppData\Local\arduino\sketches\7CDB37B86C4FD7D841F155EA2862A09D\sketch\ARIAChassis-V1-3.ino.cpp.o: in function setup': ARIAChassis-V1-3.ino.cpp:(.text.setup+0xa0): undefined reference to Serial6'
collect2.exe: error: ld returned 1 exit status
Serial2 can be remapped to PD5,PD6 but Blackpill does not have these pins.
Only option is Serial6 which does not seem defined or I guess software serial which I guess I'll have to take a look at. Thanks for the post.
IMK
this compiles OK but if I connect PA11 to PA12 for a loopback test as soon as I enter Serial monitor data it looses the serial port
// STM32 Black Pill STM32F401 F411 Serial6 test - for loopback test connect pins PA11 to PA12
HardwareSerial Serial6(PA11, PA12);;
void setup() {
// initialize both serial ports:
Serial.begin(115200);
delay(3000);
Serial6.begin(115200, SERIAL_8N1);
Serial.println("\n\nSTM32 black pill serial6 test RXD pin PA11 TXD pin PA12");
}
void loop() {
// read from Serial1, send to Serial
if (Serial6.available()) {
int inByte = Serial6.read();
Serial.write(inByte);
}
// read from Serial, send to Serial1
if (Serial.available()) {
int inByte = Serial.read();
//Serial.write(inByte); // local echo if required
Serial6.write(inByte);
}
}
With HardwareSerial Serial6(PA11, PA12);; Serial6.begin compiles ok, thank you I forgot to add hardware serial.
I think the drop out when connecting to serial monitor maybe due to compiler options
USB Support->
or
U(S)ART Support Enable ->