VLPS to run mode in s32k148 controller

cancel
Showing results for 
Search instead for 
Did you mean: 

VLPS to run mode in s32k148 controller

513 Views
shinodakbepu
Contributor I

Hi,

I was trying to change the power mode to VLPS to RUN. before going to deep sleep I am enabling the gpio pin interrupt and setting a flag. while wake up in the isr I am checking the flag and using the below function to change to RUN mode.

POWER_SYS_SetMode(RUN, POWER_MANAGER_POLICY_AGREEMENT);

but this is not working. I am getting the interrupt but the code is not running.

My sleep sequence is given below

sleep:

   

  POWER_SYS_Init(&powerConfigsArr, POWER_MODES, &powerStaticCallbacksConfigsArr, 0);

  //disabling interrupt

  //disable watchdog 

  //Enabling gpio interrupt
  POWER_SYS_SetMode(VLPS, POWER_MANAGER_POLICY_AGREEMENT);

Is it possible to change the state from VLPS to RUN without resetting the MCU?

Can anyone help me to share the example code to change the power mode from VLPS to RUN? 

Thanks in advance.

Regards,

Shinod A K

Labels (1)
Tags (1)
0 Kudos
1 Reply

221 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

There is this power_mode_switch_s32k148 SDK example in the S32 Design Studio.

pastedImage_1.png

The MCU wakes up into either RUN mode or VLPR mode, depending on the system mode prior to VLPS. 

Instead of this function POWER_SYS_SetMode(RUN, POWER_MANAGER_POLICY_AGREEMENT);

You can use POWER_SYS_GetCurrentMode() in the ISR to check the current mode.

The function reads the Power Mode Status register (SMC_PMSTAT).

Regards,

Daniel

0 Kudos