S32K144 wakes up from VLPS and can not run on

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

S32K144 wakes up from VLPS and can not run on

743 Views
Bleach
Contributor I

When the uc executes WFI, after waking up with an interrupt, both DeepSleep and SleepOnExit are false.

In what case might it stop at WFI next instruction(e.g. suspendInt) and does not execute the following code?

 

Bleach_0-1725522438244.png

 

0 Kudos
Reply
11 Replies

547 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Bleach,

Yes, DIVCORE = 1 (/2), DIVBUS =  1 (/2).

PREDIV_SYS_CLK frequency / BUS_CLK frequency = 4

danielmartynek_0-1725964916850.png

 

I have noticed that SOSCEN = 1.

The clock must be disabled before WFI.

Also, make sure all the peripherals that re not used in VLPS are disabled.

 

Thank you,

BR, Daniel

 

0 Kudos
Reply

492 Views
Bleach
Contributor I

Hi Daniel,

Thanks for your review!

After I disabled the SOSCEN(set to 0), this issue is still here.

As the below. I found direct reason is that if interrupt is active after ResumeAllInterrupt and before wfi, mcu will be in deepsleep and can not run on with one interrupt.

If one interrupt occurs before wfi, will this situation cause the mcu to fail to run after deepsleeping?

Bleach_0-1726108041960.png

 

0 Kudos
Reply

476 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Bleach,

Refer to Application Note 321 ARM Cortex-M Programming Guide to Memory Barrier Instructions

https://developer.arm.com/documentation/dai0321/latest/

Section 4.7 Enabling interrupts using CPS instructions and MSR instructions

 

Between "CPSIE I" and "WFI" , you could write S32_SCB->SCR and read the register back so that the memory access is serialized.

S32K1xx RM, Section 3.4.1 Read-after-write sequence and required serialization of
memory operations

 

Regards,

Daniel

 

 

0 Kudos
Reply

463 Views
Bleach
Contributor I

Hi Daniel,

Thank u so much!

I'll look at these sections.

By the way, why was this bug not implemented in "wfi"?

Bleach_0-1726126061213.png

Bleach_1-1726126113479.png

 

0 Kudos
Reply

438 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Could you create a new ticket / thread about the MCAL bug,

Can you please elaborate on the description there.

Keep in mind that the MCAL version is already a legacy SW

 

Regards,

Daniel

0 Kudos
Reply

709 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Bleach,

I haven't encountered this is before.

But DeepSleep should be set in all the S32K1xx low-power modes.

 

BR, Daniel

0 Kudos
Reply

695 Views
Bleach
Contributor I

Yes.

Before WFI,  deepsleep will be set. 

After WFI, I will disable deepsleep in the wakeup interrupt.

Do you mean this deelpsleep should be kept set after WFI?

0 Kudos
Reply

678 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Bleach,

No, DeepSleep does not have to be set all the time.

It could be related to ERR011063

https://www.nxp.com/webapp/Download?colCode=S32K144_0N57U

Please double check the clock configuration.

 

Regards,

Daniel

0 Kudos
Reply

620 Views
Bleach
Contributor I

Hi Daniel

Thanks for response.

One more question: If we want to enter into VLPS, whether setting SleepOnExit bit before WFI and clearing SleepOnExit in interrupt could cause this issue? 

P.S. I confirmed that clock configuration meets the errata ERR011063. I'll double check again.

Bleach_0-1725867952112.png

 

0 Kudos
Reply

610 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Bleach,

Setting and clearing SleepOnExit should not cause any problems.

SleepOnExit can be enabled and disabled anytime.

 

 

0 Kudos
Reply

551 Views
Bleach
Contributor I

As for errata ERR011063, the below is the clock before WFI execution. 

Could you help me to find whether the clock is right? Thank u!

Bleach_0-1725960822975.png

0 Kudos
Reply