🤖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

    Core2 for AWS
    2
    5
    4.6k
    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
      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
        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
          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
            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
              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
              • First post
                Last post