-->
Page 1 of 1

What is it in address 0x3FF20C00?

PostPosted: Wed Sep 02, 2015 3:44 am
by thuSkywalker
Found following example codes in hardware timer

Code: Select all#define REG_READ(_r)
#define WDEV_NOW()
(*(volatile uint32 *)(_r))
REG_READ(0x3ff20c00)
uint32 tick_now2 = 0;
void hw_test_timer_cb(void)
{
    static uint16 j = 0;
    j++;
   
    if( (WDEV_NOW() - tick_now2) >= 1000000 )
    {
    static u32 idx = 1;
        tick_now2 = WDEV_NOW();
        os_printf("b%u:%d\n",idx++,j);
        j = 0;
    }
}
void ICACHE_FLASH_ATTR user_init(void)
{
        hw_timer_init(FRC1_SOURCE,1);
        hw_timer_set_func(hw_test_timer_cb);
        hw_timer_arm(100);
}


Through some testing, I found that the 32-bit unsigned integer in address 0x3FF20C00 is not hardware timer related. It always increases every microsecond and seems(not tested) not reloading until reaches 0xFFFFFFFF.

The code here suggests it is MAC time, but I wish more detailed information about this register.
https://github.com/pvvx/esp8266web/blob ... add_func.h

Re: What is it in address 0x3FF20C00?

PostPosted: Tue Oct 06, 2015 9:54 am
by pvvx
SDK:
Code: Select alluint32 system_get_time(void)
{
   return WdevTimOffSet + *((uint32*)0x3FF20C00);
}

uint32 system_relative_time(void)
{
   return *((uint32*)0x3FF20C00);
}