How to set RTC?


How we can set RTC within ADL ?
I see there is function adl_rtcGetTime but there is no way to set it, any ideas ?


For that purpose you need to use AT+CCLK. Unfortunately there is no adl_rtcSetTime command. The problem with AT+CCLK is that you cannot set milliseconds. Internally the millisecond counter is not set to zero when using AT+CCLK, meaning that you need to introduce a time offset variable if you plan on using it in time critical applications. But time precision is a general problem with wismo modules. Even in ‘boost mode’ simple commands consume a few milliseconds. Theoretically the time can be measured up to microseconds, but on an ARMv9 processor the output is rather random. I guess you can use it as an alternative to the random number generator. However, an adl_rtcSetTime command would still be interseting in the future. When will wavecom consider introducing it?




AT Command?

Another one for the list of missing ADL support:


You have acknowledged my doubts about setting RTC …
As it seems I’ll use AT+CCLK :smiley:

Thank you for reply !


Hi All,

Just to let you know that there is now an adl_rtcSetTime() function in Oasis 2.02 (firmware R71a).

I’ve tested it on my Q2686 and it works OK - but you really need to ensure that the year is 4 digits long.

adl_rtcSetTime() will accept a time structure with a two digit date value, and appear to set the time (i.e. return with no error). However, the system time (as checked with AT+CCLK?) will be wrong, and the internal RTC hardware doesn’t appear to get updated (i.e. for me the RTC reverted to the last valid time after a reboot).

Using adl_rtcSetTime() should let you set the RTC fractional seconds - but I haven’t tested it.

cheers, Dave



I have module Q2687. I have problem with function adl_atCmdCreate, I need set RTC. This is my program:

#include “adl_global.h”
#include “adl_rtc.h”

const u16 wm_apmCustomStackSize = 1024;
static ascii buf[256];

void HelloWorld_TimerHandler ( u8 ID )
TRACE (( 1, “Embedded : Hello World” ));
adl_atSendResponse ( ADL_AT_UNS, “\r\nHello World from Open-AT\r\n” );
wm_sprintf(buf,"AT+CCLK=“08/08/08,08:08:00"”); //zapisywanie daty pod zmienna buf

void adl_main ( adl_InitType_e InitType )
TRACE (( 1, “Embedded : Appli Init” ));
adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );

When program go to adl_atCmdCreate function, program call ERROR and every thing is break. But in Terminal Emulator by at+cclk? comend a can check thay RTC was changed. Whay my program call ERROR?



Why don’t you just use the adl_rtcSetTime() call - noted by davidc nearly a year ago?