LPIT Interrupt is not working after VLPS to RUN mode transition

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

LPIT Interrupt is not working after VLPS to RUN mode transition

Jump to solution
2,427 Views
ab1995
Contributor II

Hello,

I'm using S32K148 MCU and RTD as MCAL. In my current project the MCU goes to VLPS mode and every 60ms wakes up using LPTMR interrupt. LPTMR uses LPO 1K as clock source. While waking up, a piece of code executes and MCU goes to VLPS again. This scenario repeats 5 times and then MCU stays in RUN mode till the end. At this time the clock is reinitialized and LPIT is started to generate periodic interrupts.

The problem is that LPIT ISR never executes in this case. I checked MCU registers and realized that LPIT interrupt stays pending and the routine doesn't execute.

LPIT uses SIRC as clock source.
I also tried initializing LPIT after the last wakeup when MCU doesn't go to VLPS mode anymore. but the same thing happened.

Labels (1)
0 Kudos
Reply
1 Solution
2,246 Views
danielmartynek
NXP TechSupport
NXP TechSupport

The S32K3xx RTD resumes the interrupts within the same function after the wakeup but not the S32K1xx RTD.

Let me trigger a discussion with the RTD team.

danielmartynek_0-1680608752236.png

 

BR, Daniel

View solution in original post

0 Kudos
Reply
8 Replies
2,259 Views
ab1995
Contributor II

I don't understand why do we need to suspend interrupts after wfi.

0 Kudos
Reply
2,269 Views
ab1995
Contributor II

Hi @danielmartynek ,

I checked the PRIMASK, before mode change, it is 0, and after wakeup it turns to 1 and remains 1. I tried to change it manually to 0 so I could get the interrupt. But I didn't understand the reason why it's happening.

0 Kudos
Reply
2,416 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello @ab1995,

Where do you see the LPIT interrupt pending?

In the NVIC_ISPRn register or in the LPIT_MSR register.

If it is pending in NVIC_ISPRn, is the interrupt enabled in NVIC_ISERn?

 

BR, Daniel

0 Kudos
Reply
2,404 Views
ab1995
Contributor II

Hi @danielmartynek ,

thank you for your quick response.

I see that interrupt is pending in NVIC_ISPRn register. Also it is enabled.

If I don’t switch between modes, I can get LPIT interrupt with the current configuration. 

Tags (1)
0 Kudos
Reply
2,384 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ab1995,

Just to be sure, can you double-check PRIMASK?

 

Thanks,

BR, Daniel

0 Kudos
Reply
2,267 Views
ab1995
Contributor II

Hi @danielmartynek ,

I checked the PRIMASK, before mode change, it is 0, and after wakeup it turns to 1 and remains 1. I tried to change it manually to 0 so I could get the interrupt.

The function EXECUTE_WAIT() is called when entering low power modes by driver. It is implemented as bellow:

#define EXECUTE_WAIT() \
do \
{ \
OsIf_ResumeAllInterrupts(); \
ASM_KEYWORD(" wfi"); \
OsIf_SuspendAllInterrupts(); \
} while (0)

if we enter run mode after wakeup interrupts stay suspended (PRIMASK = 1) because of OsIf_SuspendAllInterrupts(), so we need to resume interrupts and the driver doesn't do this.

If we repeatedly enter vlps mode interrupts get executed because of OsIf_ResumeAllInterrupts before wfi, my question is why are interrupts suspended in driver code after wakeup?

Tags (1)
0 Kudos
Reply
2,247 Views
danielmartynek
NXP TechSupport
NXP TechSupport

The S32K3xx RTD resumes the interrupts within the same function after the wakeup but not the S32K1xx RTD.

Let me trigger a discussion with the RTD team.

danielmartynek_0-1680608752236.png

 

BR, Daniel

0 Kudos
Reply
2,145 Views
danielmartynek
NXP TechSupport
NXP TechSupport

The issue will be fixed in the next revision.

 

Thank you,

BR, Daniel

0 Kudos
Reply