# Setting Permanent Clock

Source: https://forum.modalai.com/topic/2856/setting-permanent-clock
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-11-13 21:01:55 UTC by mrawding
Replies: 3 · Views: 1081

## mrawding · 2023-11-13 21:01:55 UTC

I'm trying to debug a kernel issue that seems like it is rebooting on kernel panic. I see that the parameter is set to -1 (reboot immediately) , which I changed to 0 (disable). But viewing the journalctl logs is quite annoying. Especially since the date is always set to Dec 15 2021.

I see there might be RTC support in the kernel setting the /dev/rtc0 clock to beginning of UTC time.

```
Dec 10 09:15:49 voxl kernel: rtc-pm8xxx c440000.qcom,spmi:qcom,pm8150@0:qcom,pm8150_rtc: rtc core: registered pm8xxx_rtc as rtc0
Dec 10 09:15:49 voxl kernel: rtc-pm8xxx c440000.qcom,spmi:qcom,pm8150@0:qcom,pm8150_rtc: setting system clock to 1970-01-01 00:00:05 UTC (5)
```

So couple questions

1) Is that actually a RTC or is it virtual?
2) Where is Dec 15 2021 set? Is it in the BIOS? I can't find it anywhere.
3) timedatectl set-time does not stick after reboot, guessing date is defaulting to BIOS
4) How can I modify BIOS either pre/post firmware flash to update the time I want?

## Reply by Eric Katzfey (ModalAI staff) · 2023-11-13 21:43:40 UTC

@mrawding There is no RTC. If you have an Internet connection it will use NTP to set the time and it will save that time. If you start again but do not have an Internet connection it will use that saved time. It will not update that saved time until NTP is available again.

## Reply by mrawding · 2023-11-14 14:46:48 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Thanks for the response. Chrony is our timesync service we use, but it doesn't stick after reboot. I'll have to look into mimicking the NTP sync in a different service. Thanks!

## Reply by mrawding · 2023-11-14 16:32:41 UTC (in reply to mrawding)

@mrawding Just answering my own forum for those who don't have access to internet based NTP server. A few solutions to stop it being synced back to Dec 15 2021

1) Run  a local NTP server on the groundstation

2) If running a timesync service like chrony - write a system service to detect a difference between the system time and the last modification time of ```/var/lib/systemd/timesync/clock``` and then running ```touch /var/lib/systemd/timesync/clock``` to reset this time - probably 1-5s daemon rate would make sense.
