Solar cubeCell internal wake clock and RTC speed running at 2x speed

I have 2 CubCells for development purposes. On one of them the RTC and wake from sleep match real time. But the other CubeCell clock is running 2 times faster than normal. Is there a way to calibrate or correctly set a clock divider?

Is the same program downloaded?

Thanks navi, No, one out in the field has a slightly older version. I can see where you are going with this. So retrieved the one out in the field and programmed that one with updated code. And that one also started running the clock at double the speed.Concluded updated code being the issue. Looked at my changes as narrowed it down to me defining a flag called ‘timeSet’ whenever the node has been sent a clock sync packet. Seems timeSet is being used in some way in Time.h . So now using ‘clockSet=true’. And everything working as planned now. I would have thought Vstudio would have given me a redefined variable warning.

You use that example. I use this example and find that the time is correct.

TimerSysTime_t sysTimeCurrent;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);

  /*typedef struct TimerSysTime_s
  *{
  *  uint32_t Seconds;
  *  int16_t SubSeconds;
  *}TimerSysTime_t;
  */
  sysTimeCurrent = TimerGetSysTime( );
  Serial.printf("sys time:%u.%d\r\n",(unsigned int)sysTimeCurrent.Seconds, sysTimeCurrent.SubSeconds);
  TimerSysTime_t newSysTime ;
  newSysTime.Seconds = 1000;
  newSysTime.SubSeconds = 50;
  TimerSetSysTime( newSysTime );
  sysTimeCurrent = TimerGetSysTime( );
  Serial.printf("sys time:%u.%d\r\n",(unsigned int)sysTimeCurrent.Seconds, sysTimeCurrent.SubSeconds);
}

void loop() {
  // put your main code here, to run repeatedly:
  delay(1000);
  sysTimeCurrent = TimerGetSysTime( );
  Serial.printf("sys time:%u.%d\r\n",(unsigned int)sysTimeCurrent.Seconds, sysTimeCurrent.SubSeconds);
}

Started coding for the cubcell this morning and the clock that wakes from sleep and the code
Serial.print(hour());
printDigits(minute());
printDigits(second());

is running x2 fast again.
I normally code with Arduino.
But am using VstudioCode at the moment
Does Vstudio actively update #include files in the background?
As i can’t see how my code is effecting the clock speed.

Still having issues with the RTC. I have been trying to wake the Lora cubecell every 5 minutes based on the RTC. But it works fine for about 10 wakes and then drifts or something. So i printed out the time on the serial port every time it woke. And yes it woke at exactly 1 second after every 5 minutes. So proved my code was correct. But this obviously would not show drift as it was printing out it’s own clock. I left it running for 12hrs and looked at it in the morning and there was a jump from 6:30:01 to 16:35:01 . Is the RTC software or hardware? As there seems to be a bug in it.

Ok so testing the time clock on the Heltec cubcell by waking from sleep every 5 minutes and serial out the time.

. The RTC seems to have a bug where it jumps ahead 12 hours and and a couple of days. Anyone else seen this happen.

So what i am trying to do is sync clocks accross the mesh. So all devices wake up at exactly the same time. If after 5 wakes they have not heard from another device they consider themselves out of clock sync or there is no other node in range. So they then wake each time to request a time sync and hopefully there is another node near by that transmits it time clock so they can sync back up again Hence chipid C39FF with the dodgy clock transmits a FC code which is time request and the local node FFFF replies with its correct time code and the clock of C39FF starts displaying the correct time again.