system_get_rst_info() reason value with deep sleep wakeup

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

system_get_rst_info() reason value with deep sleep wakeup

Postby dkinzer » Sun Aug 23, 2015 7:11 am

With SDK v1.3.0 I'm using the system_deep_sleep() call to put the device to sleep for a short period of time and using the XPD pin tied to RST (via a diode) to reset the device at the end of the sleep period. The app calls system_get_rst_info() when it runs and the 'reason' member has the value 6 (external reset) after wakeup. I expected to see the value 5 (deep sleep wakeup). Is 6 the expected value with this arrangement? If so, how can I use the XPD output to wake up the device and get a reason value of 5?

As a side note, I get a reason value of 0 on power-up and a reason value of 3 if I put the code in a tight loop. These are both expected and demonstrate that I'm calling system_get_rst_info() correctly.
Don Kinzer
Beaverton, OR, USA

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: system_get_rst_info() reason value with deep sleep wakeup

Postby ESP_Faye » Tue Aug 25, 2015 12:00 pm

Hi,

Thanks for your valuable advice !

We will optimize the SDK to get a reason value of 5 while using the XPD output to wake up from deep-sleep.

Please have a try with this new lib based on esp_iot_sdk_v1.3.0.
Attachments
libmain_1.3.0_deepsleep_reason.zip
(48.48 KiB) Downloaded 442 times

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Re: system_get_rst_info() reason value with deep sleep wakeup

Postby dkinzer » Tue Aug 25, 2015 11:24 pm

Espressif_Faye wrote:Please have a try with this new lib based on esp_iot_sdk_v1.3.0.
That works, thanks. However, there is much more output on UART0 using this libmain.a. Upon calling system_deep_sleep, I see this:
bcn 0
del if1
usl
sul 0 0
deep sleep 5s

Then, upon awakening, there a lot of "garbage" emitted, more than normal. The terminal program monitoring UART0 output is set to 230400 baud. I can eliminate the legible part quoted above by installing a do-nothing print output function (using os_install_putc1()) but, of course, the unintelligible part remains. Does this libmain.a have extra debugging output enabled?
Don Kinzer
Beaverton, OR, USA

Who is online

Users browsing this forum: No registered users and 48 guests