Remapping Hardware serial pins
Posted: Mon Aug 22, 2022 1:07 pm
Hi
I'm currently trying to map the UART2 Hardware serial pins on a STM32G0B1CBT to PA15 and PA14, however it doesn't seem to be taking effect.
On a different board, the BlackPill / STM32F401CC the code below works to change the hardware pins of the serial port
However using the code adapted for the STM32G0B1CBT6 it does not, nor does it show any compiling issues.
Looking at the data sheet USART 2 can be mapped to the following pins
USART2_RX PD6, PA15, PA3
USART2_TX PD5, PA14, PA2
With PD5 & PD6 being the default for USART2
Any help that can be offered is greatly appreciated
I'm currently trying to map the UART2 Hardware serial pins on a STM32G0B1CBT to PA15 and PA14, however it doesn't seem to be taking effect.
On a different board, the BlackPill / STM32F401CC the code below works to change the hardware pins of the serial port
Code: Select all
// RX TX
//HardwareSerial Serial2(PA10, PA9);
HardwareSerial Serial2(PB7, PB6);
void setup() {
Serial2.begin(9600);
}
void loop() {
Serial2.println("HB");
delay(10);
}
Code: Select all
// RX TX
//HardwareSerial Serial2(PD6, PD5); //Pins not available on STM32G0B1CBT6
HardwareSerial Serial2(PA15, PA14);
//HardwareSerial Serial2(PA3, PA2);
void setup() {
Serial2.begin(9600);
}
void loop() {
Serial2.println("HB");
delay(10);
}
USART2_RX PD6, PA15, PA3
USART2_TX PD5, PA14, PA2
With PD5 & PD6 being the default for USART2
Any help that can be offered is greatly appreciated