so, another try.
to avoid any impact of nodemcu firmware, I changed sysinfo demo.
My source in user_main.c is :
Code: Select all/*
Print some system info
*/
#include <ets_sys.h>
#include <osapi.h>
#include <os_type.h>
#include <gpio.h>
#include "driver/uart.h"
#define DELAY 3000 /* milliseconds */
extern int ets_uart_printf(const char *fmt, ...);
void user_init(void)
{
// Configure the UART
uart_init(BIT_RATE_74880, BIT_RATE_74880);
// Set up a timer to send the message
os_printf("\r\n");
char temp[80];
ets_uart_printf("System info:\r\n");
os_sprintf(temp, "SDK version: %s\r\n", system_get_sdk_version());
ets_uart_printf(temp);
os_sprintf(temp, "RTCTime = %ld\r\n", system_get_rtc_time());
ets_uart_printf(temp);
os_sprintf(temp, "Time = %ld\r\n", system_get_time());
ets_uart_printf(temp);
os_sprintf(temp, "Chip id = 0x%x\r\n", system_get_chip_id());
ets_uart_printf(temp);
os_sprintf(temp, "Free heap size = %d\r\n", system_get_free_heap_size());
ets_uart_printf(temp);
ets_uart_printf("==========================================\r\n");
ets_uart_printf("going to deep sleep\r\n");
deep_sleep_set_option(4);
system_deep_sleep(1000*1000);
}
and the output I get each second on uart is like this ( made shorter by asterisks ) :
******
RTCTime = 8161
Time = 54468
******
going to deep sleep
******
RTCTime = 8159
Time = 54471
*******
going to deep sleep
*******
RTCTime = 8158
Time = 54471
******
going to deep sleep
*****
So it means RTC is really reseted after each deepsleep ?
This makes RTC not so much usefull ...
RTCTime is a little varying, simillar to Time. It looks like temperature dependand ( differs more before the chip heats up to stable temperature ). Or maybe only main oscillator frequency changes ( affecting execution speed), while RTC is fixed.
btw. SDK is 0.9.5 ( I guess)