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

    Put M5.shutdown in Void loop -keeps shutting down

    Scheduled Pinned Locked Moved Core2 for AWS
    5 Posts 2 Posters 6.5k Views 1 Watching
    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.
    • T Offline
      TrentD
      last edited by

      I was trying to add a button to an Arduino sketch to shutdown unit. I messed up and put M5.shutdown in the Void loop as a separate statement. Now when I power it on it immediately shuts down. The M5 burner program won't erase it since it can't find the COM port since the power keeps shutting off. Is there any way to erase the Arduino code in memory without having to turn the unit on? I thought I could disconnect the battery but it is soldered to the board.

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

        Hello @TrentD

        try forcing the M5Core2 into download mode. Connect a wire from GPIO0 to GND, connect M5Core2 via USB to PC, then press the reset button. The COM port should now show up and stay. Now try to erase or download new firmware.

        Thanks
        Felix

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

        1 Reply Last reply Reply Quote 0
        • T Offline
          TrentD
          last edited by

          Thanks for the quick response. I bought this a few days ago so am not familiar with the pins. The pin map shows 3 GND pins in the left column in the first 3 rows and 2 GPIO pins side by side in row 11 but no GPIO0 pin. Can I use either GPIO pins?
          Thanks
          Trent

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

            Hello @TrentD

            GPIO0 is labeled G0 (row 12) on the sticker, sorry about that. Connect GND (any of the three) with G0.

            BTW: GPIO stands for General Purpose Input Output.

            Thanks
            Felix

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

            1 Reply Last reply Reply Quote 0
            • T Offline
              TrentD
              last edited by

              Felix,
              It worked! Thank You so much! I thought I made the most expensive Lego brick in the world! HA HA. In all my years playing with the UNO I never found a way of shutting down through code. If I did I might of given up on IOT.
              Thanks,
              Trent

              1 Reply Last reply Reply Quote 0

              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
              • First post
                Last post