Hi ! Version 3.0.0 throws an error ` #define Serial1_RX PA10 // Serial1 RX #define Serial1_TX PA9 // Serial1 TX HardwareSerial Serial1(Serial1_RX, Serial1_TX); void setup() { // put your setup code here, to run once: } void loop() { // put your main code here, to run repeatedly: } C:\Users\Admin\AppData\Local\Temp\.arduinoIDE-unsaved2026625-8432-6liyya.ubz86\sketch_jul25a\sketch_jul25a.ino:4:16: error: conflicting declaration 'arduino::HardwareSerial Serial1' 4 | HardwareSerial Serial1(Serial1_RX, Serial1_TX); | ^~~~~~~ In file included from C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\3.0.0\cores\arduino/WSerial.h:5, from C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\3.0.0\cores\arduino/wiring.h:103, from C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\3.0.0\cores\arduino/Arduino.h:37, from C:\Users\Admin\AppData\Local\arduino\sketches\870FFC002468014B87DE5543024610EC\sketch\sketch_jul25a.ino.cpp:1: C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\3.0.0\cores\arduino/Serial.h:226:15: note: previous declaration as 'Uart Serial1' 226 | extern Uart Serial1; | ^~~~~~~ exit status 1 Compilation error: conflicting declaration 'arduino::HardwareSerial Serial1' `
Activity
fpistm commentedon Jul 25, 2026
Hi @acronis2000
3.0.0 release deployed the ArduinoCore-API.
HardwareSerialhas been renamedUart.That's why major release number changed. See #2879.
whcir911 commentedon Aug 6, 2026
Could you please show the proper syntax to use?
Aymane-ST commentedon Aug 6, 2026
Hi,
The issue is that since 3.0.0 (see 2d23c7c), the stm32duino concrete serial class is now
Uartinstead ofHardwareSerial.So this old syntax is no longer valid:
HardwareSerial Serial1(Serial1_RX, Serial1_TX);It should now be:
Uart Serial1(Serial1_RX, Serial1_TX);So the migration is basically:
HardwareSerial -> Uart
Thanks.