🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Serial2 Don't compile

    PROJECTS
    3
    9
    18.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      ardisd
      last edited by

      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

      ajb2k3A 1 Reply Last reply Reply Quote 0
      • ajb2k3A
        ajb2k3 @ardisd
        last edited by

        @ardisd Can you post a screenshot of the error ouput from arduino?

        UIFlow, so easy an adult can learn it!
        If I don't know it, be patient!
        I've ether not learned it or am too drunk to remember it!
        Author of the WIP UIFlow Handbook!
        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

        1 Reply Last reply Reply Quote 0
        • A
          ardisd
          last edited by

          Enclosed screen shot as requested

          I get the same error when compiling Serial2.ino and my own code

          0_1537097249952_Capture.JPG

          1 Reply Last reply Reply Quote 0
          • ajb2k3A
            ajb2k3
            last edited by

            Are you running arduino 1.8.7?
            Thats not all the error.

            UIFlow, so easy an adult can learn it!
            If I don't know it, be patient!
            I've ether not learned it or am too drunk to remember it!
            Author of the WIP UIFlow Handbook!
            M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

            1 Reply Last reply Reply Quote 0
            • A
              ardisd
              last edited by

              Upgraded to 1.8.7 was on 1.8.5

              This is the error now

              0_1537112496486_Capture.JPG

              1 Reply Last reply Reply Quote 0
              • ajb2k3A
                ajb2k3
                last edited by

                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?

                UIFlow, so easy an adult can learn it!
                If I don't know it, be patient!
                I've ether not learned it or am too drunk to remember it!
                Author of the WIP UIFlow Handbook!
                M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                1 Reply Last reply Reply Quote 0
                • A
                  ardisd
                  last edited by

                  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);
                  }
                  }

                  1 Reply Last reply Reply Quote 0
                  • N
                    nnn
                    last edited by

                    I got the same problem.
                    I changed the rename of Serial2 and fixed it.

                    HardwareSerial Serial2(2);
                    →HardwareSerial Serial2_(2);

                    1 Reply Last reply Reply Quote 0
                    • A
                      ardisd
                      last edited by

                      @nnn 在 Serial2 Don't compile 中说:

                      HardwareSerial Serial2_(2)

                      Thanks

                      That worked for me

                      David Ardis

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post