Does the S32K312 RTC support system time keeping at reset?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Does the S32K312 RTC support system time keeping at reset?

跳至解决方案
1,119 次查看
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 项奖励
1 解答
1,025 次查看
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

 

在原帖中查看解决方案

9 回复数
1,091 次查看
liangyouchao
Contributor I

Hi Lukas,

Thank you for your reply, we use SXOSC crystal.

liangyouchao_0-1684289556445.png

 

Regards,

liangyouchao

0 项奖励
1,078 次查看
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 项奖励
1,072 次查看
liangyouchao
Contributor I
OK, look forward to your feedback.
0 项奖励
1,040 次查看
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 项奖励
1,035 次查看
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 项奖励
1,026 次查看
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

 

968 次查看
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 项奖励
1,013 次查看
liangyouchao
Contributor I

Okay, I'll try it.

0 项奖励
1,096 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @liangyouchao 

which clock do you use?

lukaszadrapa_0-1684252322069.png

 

Regards,

Lukas

0 项奖励