LPIT Interrupt is not working after VLPS to RUN mode transition

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPIT Interrupt is not working after VLPS to RUN mode transition

ソリューションへジャンプ
2,423件の閲覧回数
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.

ラベル(1)
0 件の賞賛
返信
1 解決策
2,242件の閲覧回数
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 件の賞賛
返信
8 返答(返信)
2,255件の閲覧回数
ab1995
Contributor II

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

0 件の賞賛
返信
2,265件の閲覧回数
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 件の賞賛
返信
2,412件の閲覧回数
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 件の賞賛
返信
2,400件の閲覧回数
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. 

タグ(1)
0 件の賞賛
返信
2,380件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @ab1995,

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

 

Thanks,

BR, Daniel

0 件の賞賛
返信
2,263件の閲覧回数
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?

タグ(1)
0 件の賞賛
返信
2,243件の閲覧回数
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 件の賞賛
返信
2,141件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

The issue will be fixed in the next revision.

 

Thank you,

BR, Daniel

0 件の賞賛
返信