Does the S32K312 RTC support system time keeping at reset?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Does the S32K312 RTC support system time keeping at reset?

Jump to solution
1,784 Views
liangyouchao
Contributor I

liangyouchao_0-1684227461102.png

My device is battery powered and I found in my testing that a reset also causes the system time to be reset, is there any solution to keep the system time on reset?

0 Kudos
Reply
1 Solution
1,690 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I do not have test code, I just tested it using a debugger. All I did - I selected SIRC clock (I do not have a board with XOSC here right now) and I enabled the RTC by CNTEN. Then I can see that the counter is running in RTCCNT:

lukaszadrapa_0-1684822882407.png

Then I generated SW functional reset - also by debugger. I set FUNC_RST in MODE_CONF register,  then I set MODE_UPD bit in MODE_UPD register and finally I wrote keys to CTL_KEY register. The MCU was reset, I reconnected debugger (hot attach without reset) and I saw that the RTC is still configured and running.

Regards,

Lukas

 

View solution in original post

9 Replies
1,756 Views
liangyouchao
Contributor I

Hi Lukas,

Thank you for your reply, we use SXOSC crystal.

liangyouchao_0-1684289556445.png

 

Regards,

liangyouchao

0 Kudos
Reply
1,743 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Please give me more time, I can see that on my side too, I need to clarify this with AE team.I will let you know later.

Regards,

Lukas

0 Kudos
Reply
1,737 Views
liangyouchao
Contributor I
OK, look forward to your feedback.
0 Kudos
Reply
1,705 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Well, my problem was that I used external reset for test. But external reset is destructive reset. RTC keeps running only during functional resets. If I used software functional reset, for example, it's working as expected.

Which reset did you use?

Regards,

Lukas

0 Kudos
Reply
1,700 Views
liangyouchao
Contributor I

We will use both functional reset and external reset, the reset reset is an external watchdog chip, if the external reset is not holdable, we can also accept this case, can you share the test code with me?

Regards,

liangyouchao

0 Kudos
Reply
1,691 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

I do not have test code, I just tested it using a debugger. All I did - I selected SIRC clock (I do not have a board with XOSC here right now) and I enabled the RTC by CNTEN. Then I can see that the counter is running in RTCCNT:

lukaszadrapa_0-1684822882407.png

Then I generated SW functional reset - also by debugger. I set FUNC_RST in MODE_CONF register,  then I set MODE_UPD bit in MODE_UPD register and finally I wrote keys to CTL_KEY register. The MCU was reset, I reconnected debugger (hot attach without reset) and I saw that the RTC is still configured and running.

Regards,

Lukas

 

1,633 Views
liangyouchao
Contributor I

Thank you very much, Lukas. I have used the RTD driver to implement that the clock will not be lost when the RTC function is reset.

 

Regards,

liangyouchao

0 Kudos
Reply
1,678 Views
liangyouchao
Contributor I

Okay, I'll try it.

0 Kudos
Reply
1,761 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @liangyouchao 

which clock do you use?

lukaszadrapa_0-1684252322069.png

 

Regards,

Lukas

0 Kudos
Reply