Description
Bug
Serial using PA_11 & PA_12 stops working when using the default serial pins (PA_2 or PA_3) as analog or digital in/outs.
Target
Nucleo F401RE
Toolchain:
GCC_ARM || online compiler
mbed-os version:
Bug occurs after 5.4.3
SHA for commit which breaks my code
d740bde
Expected behavior
Serial should work when using pins PA_11
& PA_12
even when using the default serial pins (PA_2
or PA_3
) as analog or digital in/outs
Actual behavior
Serial stops working when using pins PA_11
& PA_12
while the default serial pins (PA_2
or PA_3
) are used as analog or digital in/outs.
Details
I tried to upgrade our mbed OS version from 5.4.3 to the latest. After doing so, all serial communication to the pc stopped working.
I am not using the default pins (PA_2
& PA_3
) for Serial, instead I am using them for AnalogIn to suit our PCB layout. For Serial I am using PA_11
& PA_12
. I have done the correct modifications to my Nucleo board to suit this change and both AnalogIn and Serial have been working as expected... until I upgraded from 5.4.3.
// DigitalOut led1(PA_3);
// AnalogIn led2(PA_2);
Serial serial(PA_11, PA_12, 921600);
int main() {
while (true) {
serial.printf("HELLLO\r\n");
wait(0.5);
}
}
After upgrading my mbed OS version, the above code will still work. When I remove the comment next to either led1
or led2
the Serial will stop working.
I have located the commit which creates this bug in 5.4.4 onwards:
[STM32F4] Remove SERIAL_TX and SERIAL_RX from available pins
mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralPins.c