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

    How is the M5StickC Plus 2 turned off in the User Demo?

    Scheduled Pinned Locked Moved M5 Stick/StickC
    4 Posts 2 Posters 2.0k 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.
    • F Offline
      foudrou
      last edited by

      Hello everyone,

      I am enjoying using my M5StickC Plus 2 since I found the User Demo (https://github.com/m5stack/M5StickCPlus2-UserDemo) and started modifying it for my needs.

      Everything works flawlessly but I don't understand how the device is turned off.

      I think the function

      void TEST::power_off()

      in test.cpp does the magic (it no longer works when I comment it out along with its declaration in test.h) but I don't see it being called.

      Sorry for the rookie question. I tried searching and was unable to find anything useful so far.

      Thanks a lot,

      Ben

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

        Hello @foudrou

        there is an alternate way which can turn off the device: if is_test_mode is true then at the end of test_loop() rtc_wakeup_test() is called which at the end sets POWER_HOLD_PIN to LOW turning off the device.

        Note: not sure why it doesn't work when you comment out power_off() function as I also don't see it being called anywhere either.

        Thanks
        Felix

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

        F 1 Reply Last reply Reply Quote 0
        • F Offline
          foudrou @felmue
          last edited by

          Thanks @felmue,

          I'll continue to play around with the demo to get a better grasp of it.

          If anyone has another (ideally PlatformIO-based) demo to propose I will have a look at it.

          Thanks again,

          Ben

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

            Hello @foudrou

            M5StickCPlus2 has dedicated hardware (U8 etc.) to power off when the power button is pressed and hold. See schematic here.

            Instead of setting POWER_HOLD_PIN low, the power off hardware pulls 3V3EN low which disables the 3.3 V DC/DC converter and thus killing the power to the ESP32.

            Note: when the power button is hold long enough you'll see the green LED being turned on, indicating that 3V3EN is low.

            Note: power off only works when run from battery.

            Thanks
            Felix

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

            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