Serial2 Don't compile
-
I have recently changed to using https://dl.espressif.com/dl/package_esp32_index.json in the boards manager now any application using serial2 wont comple. I get an error Error compiling for board M5Stack-Core-ESP32.
Thanks
David Ardis
-
@ardisd Can you post a screenshot of the error ouput from arduino?
-
Enclosed screen shot as requested
I get the same error when compiling Serial2.ino and my own code

-
Are you running arduino 1.8.7?
Thats not all the error. -
Upgraded to 1.8.7 was on 1.8.5
This is the error now

-
I first thought is to tell you to Backup and delete the SD folders in dropbox and
C:\programfiles(x86)\Arduino\Librarys\SD
and then try again.Can I see your source code?
-
Just the standard serial2 sketch
#include <M5Stack.h>
HardwareSerial Serial2(2);
void setup() {
M5.begin();
Serial.begin(115200);
// Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
Serial2.begin(115200, SERIAL_8N1, 16, 17);
}void loop() {
if(Serial.available()) {
int ch = Serial.read();
Serial2.write(ch);
}if(Serial2.available()) {
int ch = Serial2.read();
Serial.write(ch);
}
} -
I got the same problem.
I changed the rename of Serial2 and fixed it.HardwareSerial Serial2(2);
→HardwareSerial Serial2_(2); -
@nnn 在 Serial2 Don't compile ä¸è¯´ï¼š
HardwareSerial Serial2_(2)
Thanks
That worked for me
David Ardis
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login