Absolute time not maintained on BSoM with deviceOS 5.3.1

Is there any particular reason why when my BSoM device goes to sleep on DeviceOS 5.3.1 (ULTRA_LOW_POWER), RTC seems to work and device wakes up on time, BUT absolute time is not maintained (Time.IsValid() returns false). I tried in both SEMI_AUTOMATIC and MANUAL mode and the same happens.

I suspect it could be related to backupRAM, but I had 3 STARTUP statements (one for retained memory, one for reset reason and one for a special startup function I use to immediately detect if a pin was down at boot) and it didn't work either when I combined them into only 1 STARTUP statement (calling my startup function and adding the 2 enable feature statements at the beginning of it).

Am I doing things wrong? the 3 STARTUPs worked fine on an E-Series in the past (older deviceOS though).

Hi Phil,

I think this is getting you:

source

Some alternatives are to use an external RTC, like explained in this AN, or sync it time at connection time.

Best

1 Like

Thanks Gustavo. But it says ULTRA_LOW_POWER mitigates that restriction, and I'm using that mode for sleep... so is that not supposed to work?

Also, I just noticed that time is not maintained either on RESET. This is weird.

I also tested on 4.1.0 and get the same issues. Note that retained memory seems to work fine.

So, I created a very simple firmware to test things further.

I noticed that right after wakeup, time is correct/valid, but if I reset the device (hardware or software), it gets lost.

So a reset clears the RTC? (which likely was the issue with my normal firmware, since I was resetting the device fully on the E-Series to get a clean slate on start and initialize various peripherals/sensors)

Yes, the reset button and System.reset() will clear the RTC, because there is no dedicated RTC peripheral on the nRF52840.

1 Like

Thanks for the confirmation, Rick.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.