Skip to main content
Associate II
August 20, 2026
Solved

Cannot Set Local Time on STM32MP257

  • August 20, 2026
  • 6 replies
  • 84 views

Failed to set local time on STM32MP257.

Firstly, I tried to use the command

date -s "yyyy-mm-dd xx:xx:xx"

, and system can successfully return the time I set. But when I again use “date” to get the local time, system still return the wrong time in 2024.

Then I tried to write into RTC, but still failed.

Now because of the failure of time setting, all the apt command are unavailable.

So I want to know how to correctly change the local time and RTC time, or to find an alternate way to apt-get package.

Thank you.

Best answer by ElbertFu

@Erwan SZYMANSKI 

Hello,

I’ve found out that there was some wrong with deptp and connman service, and what was more, my RTC battery ran out of power.

Now the problem has been resolved.

Thank you for your help and kindness.

Best wishes,

Elbert

6 replies

Erwan SZYMANSKI
ST Technical Moderator
August 20, 2026

Hello ​@ElbertFu ,
Which board do you use ?

Can you try below command as mentioned in this article:
 

Board $> date +%y%m%d -s "yyyymmdd"

Board $> date +%T -s "hh:mm:ss"

 

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
ElbertFuAuthor
Associate II
August 20, 2026

Hello,

I am using STM32MP257.

I’ve tried the command mentioned above, and here is the result:


root@ATK-DLMP257:~# date +%y%m%d -s "20260820"
+%T -s "22:22:25"
260820
root@ATK-DLMP257:~# date +%T -s "22:22:25"
22:22:25
root@ATK-DLMP257:~# [ 4497.195510] systemd-journald[266]: Time jumped backwards, rotating.

root@ATK-DLMP257:~# date
Wed Feb 28 02:41:01 AM CST 2024

The situation is a little bit troublesome.:-(

Thank you.

Erwan SZYMANSKI
ST Technical Moderator
August 20, 2026

Hello ​@ElbertFu ,
I tested it on the STM32MP257F-DK board (and eval board), and I do not face a such issue on my side:

root@stm32mp276-33-ac-c7-cc-39:~# date
Sat Apr 20 00:00:03 UTC 2024
root@stm32mp276-33-ac-c7-cc-39:~# date +%y%m%d -s "20260820"
260820
root@stm32mp276-33-ac-c7-cc-39:~# date +%T -s "22:22:25"
22:22:25
root@stm32mp276-33-ac-c7-cc-39:~# date
Thu Aug 20 22:22:26 UTC 2026

Don’t you have an additional service on your Linux distribution that automatically detect date derivation ? Or is it not Ethernet connected to a time synchronization system that is wrong dated ? 

Kind regards,
Erwan. 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.