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

    M5Paper stuck in M5.begin();

    Cores
    3
    8
    7.7k
    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.
    • M
      michael_o
      last edited by

      Hi,

      I'm doing my first steps with the M5Paper and even the slightest examples often fail, because the device is stuck in the M5.begin() function - it never returns from it.

      With the next upload, it works again, slightest change - stuck again.

      I'm using Arduino IDE. Am I doing something wrong or is my device faulty?

      Best regards,

      Michael

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

        Are you resetiing the M5Paper between each programming attempt?

        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
        • M
          michael_o
          last edited by

          I'm not manually resetting it, no. But even if I reset it, it doesn't work.

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            Hello @michael_o

            would you mind sharing one of the examples which fails on your M5Paper?

            Thanks
            Felix

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 0
            • M
              michael_o
              last edited by

              Sure. Even this tiny example fails. It prints "Begin", but not the "initializing ... OK" which M5.begin() usually prints.

              #include <M5EPD.h>

              M5EPD_Canvas canvas(&M5.EPD);

              void setup() {
              Serial.begin(115200);

              Serial.printf("Begin\n");
              delay(1000);

              M5.begin();
              M5.EPD.Clear(true);
              }

              void loop() {
              yield();
              }

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by felmue

                Hello @michael_o

                thanks. Most likely the issue is the double initialisation of Serial. If you have a look into M5.begin() you'll see that by default it initialises Serial as well.

                    if (SerialEnable == true)
                    {
                        Serial.begin(115200);
                        Serial.flush();
                        delay(50);
                        Serial.print("M5EPD initializing...");
                    }
                

                So I suggest you change your code to:

                #include <M5EPD.h>
                
                M5EPD_Canvas canvas(&M5.EPD);
                
                void setup() {
                  M5.begin();
                  M5.EPD.Clear(true);
                }
                
                void loop() {
                }
                

                Note: untested as my M5Paper currently is in a long term battery test.

                Hope this helps.

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                1 Reply Last reply Reply Quote 0
                • M
                  michael_o
                  last edited by

                  That's right, it looks like that was the problem. Thank you very much. What a peculiar behaviour if you init Serial twice.

                  Michael

                  1 Reply Last reply Reply Quote 0
                  • felmueF
                    felmue
                    last edited by

                    Hello @michael_o

                    you are welcome. I am glad to hear you got it working and thank you for reporting back here.

                    Cheers
                    Felix

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

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