I use stm32f407 microcontroller, with freertos 8.0. I want to sleep the controller, use STOP mode, which is the lowest power use mode. In this mode the micro wake up only, external pin IT, or rtc wake up. In sleep, the controller must wake up every 30 second to reset a watchdog via I2C. To wake up the the device the user must push the wake up button for 2 second. If the time less than 2 second, the micro go back sleep. I don’t know how can I do this.