PlatformIO Community

Serial.begin causes error and unable to be compiled with Arduino UNO

Hello, I tried to use the serial monitor on platformIO just like how I did with Arduino IDE by declaring first declaring Serial.begin(9600) in setup(). I have also configurated the .ini file with speed_monitor=9600.
But an error appeared and i dont understand the error it displayed. Does anyone have an idea what the error tries to describe?
Screenshot 2022-05-10 230509
Screenshot 2022-05-10 231338
Screenshot 2022-05-10 231400

avr-stub uses the serial to transport debug (GDB) messages to the host computer and back. When using this debug method, your own firmware cannot use the the serial via the Serial object. This is all documented in

https://docs.platformio.org/en/stable/plus/debug-tools/avr-stub.html#debugger-limitations

and

page 11.

You may use an avr-stub function to transport a string to GDB

but you have to start the firmware via debugging it and looking in the Debug Console.

You can also work-around this limitation by using a [software serial](https://wiki.seeedstudio.com/Software-Serial/9 on some free pin(s) and using an extra USB-to-UART adapter to connect it to your PC.