Is machine.deepsleep() possible with a Core 2?



  • I have a Core 2 for AWS but figured the base hardware is the same so this should apply to the Core 2 as well.

    When I tried to do a machine.deepsleep(10000) the device just goes into a boot loop. It doesn't wait ten seconds. Seems like it might be trying to go to sleep then immediately restarting.

    Anyone have deepsleep working on a Core 2 device?

    It definitely gets the deepsleep signal, this is what I see in the serial output

    rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff0018,len:4
    load:0x3fff001c,len:5228
    load:0x40078000,len:13424
    load:0x40080400,len:3568
    entry 0x4008063c
    
           _  __ _               
     _   _(_)/ _| | _____      __
    | | | | | |_| |/ _ \ \ /\ / /
    | |_| | |  _| | (_) \ V  V / 
     \__,_|_|_| |_|\___/ \_/\_/  
    


  • Hello @greenleaf

    works fine here with:

    from m5stack import *
    from m5stack_ui import *
    from uiflow import *
    import machine
    
    screen = M5Screen()
    screen.clean_screen()
    screen.set_screen_bg_color(0xFFFFFF)
    
    machine.deepsleep(10000)
    

    When I run this code from UIFlow the screen goes white and after about 10 seconds M5Core2 restarts and connects back to UIFlow. Not sure why in your case it doesn't wait 10 seconds. Do you have the latest UIFlow firmware 1.10.2 installed on your M5Core2?

    Thanks
    Felix



  • @felmue I think I found the issue; my deepsleep() call was inside a loop. Moving it outside the loop sorted it out.