SNVS Clock Scaling in i.MXRT1064

cancel
Showing results for 
Search instead for 
Did you mean: 

SNVS Clock Scaling in i.MXRT1064

Jump to solution
214 Views
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?

Labels (1)
Tags (3)
0 Kudos
1 Solution
96 Views
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!

View solution in original post

0 Kudos
5 Replies
97 Views
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!

View solution in original post

0 Kudos
96 Views
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 Kudos
96 Views
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 Kudos
96 Views
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 Kudos
96 Views
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 Kudos