🤖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?

    M5 Stick/StickC
    2
    4
    402
    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
      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
        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
          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
            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
            • First post
              Last post