SNVS Clock Scaling in i.MXRT1064

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

SNVS Clock Scaling in i.MXRT1064

跳至解决方案
1,757 次查看
chris_evans
Contributor III

We have an issue where SVNS RTC alarm runs at half speed during sleep compared to when running. Other than this, the wake up functions as expected. I cannot see any documentation on clock scaling for the RTC and I am under the impression it should just run from the 32kHz XTAL always. Are there any settings that affect this feature?

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
1,639 次查看
chris_evans
Contributor III

Two problems have been found in my project:

  1. We had another external interrupt triggering, which was not supposed to be enabled and so the micro got stuck in a interrupt loop there.
  2. The interrupt flag was not cleared correctly and we did not understand the behaviour of the micro when waking on SNVS LP alarm - we were expecting the chip reboot and re-initialisation of the SNVS to clear the interrupts, however, the NVIC pending flag remained active after a sleep / wake. Therefore on configuring the next sleep until LP alarm, the interrupt would immediately trigger and get stuck in an interrupt loop there.

Solution: Clear interrupt flag on used interrupts always, even if nothing else is done!

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,640 次查看
chris_evans
Contributor III

Two problems have been found in my project:

  1. We had another external interrupt triggering, which was not supposed to be enabled and so the micro got stuck in a interrupt loop there.
  2. The interrupt flag was not cleared correctly and we did not understand the behaviour of the micro when waking on SNVS LP alarm - we were expecting the chip reboot and re-initialisation of the SNVS to clear the interrupts, however, the NVIC pending flag remained active after a sleep / wake. Therefore on configuring the next sleep until LP alarm, the interrupt would immediately trigger and get stuck in an interrupt loop there.

Solution: Clear interrupt flag on used interrupts always, even if nothing else is done!

0 项奖励
回复
1,639 次查看
chris_evans
Contributor III

Hi Victor,

After using the SNVS RAM to store reset reasons, it seams that it is not the SNVS waking the device at all, but rather the device entering hard fault on shutdown and triggering watchdog, which just happens to be twice the sleep period.

If i find something relevant to the how I am setting up SNVS that is causing this issue, I will update this thread for future reference.

Regards,

Chris

0 项奖励
回复
1,639 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Christopher, 

As long as the external oscillator is present the RTC will always run from there. 

Are you using one of our evaluation boards to make this test? Could you please share a project with the minimum requirements so I can replicate this behavior on my side? 

Regards, 

Victor 

0 项奖励
回复
1,639 次查看
chris_evans
Contributor III

Hi Victor,

Thanks, this is good to know. Project is currently running on a custom board, however, I can get the MIMXRT1064-EVK board so will try it on there. All I am doing is setting a 15 second alarm then putting the device into stop mode using LPM_PreEnterStopMode() and LPM_EnterSuspend() from the SDK provided with MCUXPresso IDE.

Regards,

Chris

0 项奖励
回复
1,639 次查看
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Chris, 

If you can reproduce the behavior with our evaluation board, please share the project you use so I can replicate the behavior on my side. 

Regards, 

Victor 

0 项奖励
回复