Sleep mode in S32k118 and configure wakeup sources

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

Sleep mode in S32k118 and configure wakeup sources

103 Views
Arunpk
Contributor I

 

I am trying to put the S32K118 into sleep mode (VLPR or VLPS) to reduce current consumption. For this, I have configured two clock structures—one for RUN mode and another for VLPR mode. Additionally, I have disabled all peripherals except PORT A and PORT D in the .MEX file for VLPR mode.

Expected Output: Current should be reduced to below 1–2mA.
Actual Output: Current is not reduced.

I need assistance in achieving microampere-level current consumption in sleep mode. Please provide the correct code sequence to configure the S32K118 from RUN mode to sleep mode. I have already tested an example project :power_mode_switch_s32k118:, which reduced the current to 6mA.

Additionally, I need to configure a wakeup source to wake up the MCU from sleep mode. In S32K344, there is a dedicated WKPU driver available for configuring the wakeup source. However, in S32K118, as per my understanding, there is no separate driver for wakeup configuration.

Please help me resolve these two issues as soon as possible.

Thank you!

0 Kudos
Reply
3 Replies

77 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Arunpk,

Please check the clock bias disable bit. CLKBIASDIS must be enabled during VLPS always to achieve the datasheet current. 

Julin_AragnM_0-1743198245931.png

Yes, the K3 goes through a system reset after the wakeup unit (WKPU) detects an interrupt. On the other hand, the K1 family simply goes through the Wakeup ISR → Code after WFI. Switching to RUN/VLPR mode directly after waking up from low power mode (VLPS).

For wakeup, simply configure ISR for dedicated wakeup pin. In the power_mode_switch example, you can see the interrupt service routine for SW3 declared as ButtonISR.

Best regards,
Julián

0 Kudos
Reply

27 Views
Arunpk
Contributor I

Hi @Julián_AragónM,

Thanks for your response.

Here’s what we have implemented for switching from RUN mode to VLPS mode:

  1. Initialized the clock with RUN mode configuration.
  2. Configured PMC registers:  PMC->REGSC |= PMC_REGSC_BIASEN(1) | PMC_REGSC_CLKBIASDIS(1) | PMC_REGSC_LPODIS(1);(This line did not impact the current consumption).
  3. Put the MCU into VLPS mode. Debugging mode disabled Automatically (Current reduced to 10mA).

I need to know if there are additional configurations (clock settings, peripheral configurations, etc.) required before putting the MCU into VLPS mode.

Could you also share an example application code for configuring registers correctly for VLPS mode?

0 Kudos
Reply

14 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Arunpk,

The steps for entering VLPS are shared in this community post:

  1. Disable all the peripherals that are not used in VLPS.
  2. Switch the system clock to SIRC (measure BUS_CLK at CLKOUIT)
  3. Disable all the other clock sources.
  4. Enabled wakeup interrupt
  5. Enter VLPS.

The community post also mentions some additional examples:

Best regards,
Julián

0 Kudos
Reply