S32K116 RUN to VLPS Mode and Interrupt AWIC/NVIC for wakeup

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

S32K116 RUN to VLPS Mode and Interrupt AWIC/NVIC for wakeup

2,926 Views
mumumilmil
Contributor II

Hi, I used S32K116 ARM v2.2 tool. 

I'm trying to apply Run Mode -> VLPS Mode 

By 61mA -> 32mA - it means go to VLPR Mode. (I should be reduce Current to ~1mA)

But, I think that example code doesn't go deepsleep Mode.

mumumilmil_0-1747202148718.pngmumumilmil_0-1747202148718.png

It seems to go VLPR Mode but, Not going to VLPS Mode(deepsleep)

 

void enable_low_power_modes(void)
{
SMC->PMPROT |= SMC_PMPROT_AVLP(1);  /* Allow very low power run mode */
SMC->PMCTRL |= SMC_PMCTRL_RUNM(2);
}
 
void go_to_sleep(void)
{
    unsigned long int regValue = ((*(unsigned long int *)0x4007E014u) & 0xFFu);
 
    /* Very low power stop mode can be entered only from Run mode or Very low power run mode*/
    if ((regValue != 1UL) && (regValue != 4UL)) { 
        return;
    }
 
    /* Set the SLEEPDEEP bit to enable deep sleep mode (STOP)*/
    (*(unsigned long int *) 0xE000ED10u) |= (1 << 2);
 
    /* Set power mode to specified STOP mode*/
    /* SMC_HAL_SetStopModeControl(baseAddr, stopMode); */
    SMC->PMCTRL |= SMC_PMCTRL_STOPM(2);
 
 
    /* Wait For Interrupt */
#if defined (__GNUC__)
    __asm volatile ("wfi");
#endif
}
 
And if VLPS mode needs to SIRC Clock, I should adjust VCCR? ( Now, Using RCCR for SYS, Core clock)
 

mumumilmil_1-1747202367059.pngmumumilmil_1-1747202367059.png

 

 

0 Kudos
Reply
10 Replies

2,909 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mumumilmil,

Do you have an NXP EVB or you own board?

Where do you measure the current?

Make sure the power supply does not power other components on the board and that the MCU does not drive anything on its outputs as they remain active in all S32K1xx low power modes.

 

Can you use the functions from this example?

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-RTC-VLPS/ta-p/1119655

 

Regards,

Daniel

0 Kudos
Reply

2,890 Views
mumumilmil
Contributor II

Hi, @danielmartynek

I measured current to multimeter from board to power supply.

so, it is difficult to measure each IC's current..

Then, If FIRC have converted to SIRC, how to check applied SIRC Clock? 

 

0 Kudos
Reply

2,873 Views
danielmartynek
NXP TechSupport
NXP TechSupport

On S32K116 EVB, there is J15 for this purpose.

danielmartynek_0-1747224340498.pngdanielmartynek_0-1747224340498.png

The example I linked here has this function that enables CLKOUT, so you can measure BUS_CLK before and after the switch from FICR to SIRC.

/*******************************************************************************
Function: clkout_bus
*******************************************************************************/
void clkout_bus(void)
{
  SIM->CHIPCTL &= ~(1 << 11); //Disable CLKOUT
  SIM->CHIPCTL |= (9 << 4); //BUS_CLK
  SIM->CHIPCTL |= (1 << 11); //Enable CLKOUT
  // [11] CLKOUTEN = 1 CLKOUT enable
  // [7-4] CLKOUTSEL = 0b1001 BUS_CLK
}

 

0 Kudos
Reply

2,848 Views
mumumilmil
Contributor II

I have some question @danielmartynek.

 

1. In case of S32K116 MCU, Can I switch the Normal Run → VLPS? or Normal Run → VLPR → VLPS? 

I'm trying to access Sleep mode to LPIT_Inturrupt 

 

2. MCU has Sleep of status, can I wake up to LPIT_IRQ or CAN-FD?

 

 

0 Kudos
Reply

2,831 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mumumilmil,

1. Yes

danielmartynek_1-1747376614512.pngdanielmartynek_1-1747376614512.png

 

2.

LPIT is a wakeup source in VLPS, but FlexCAN is not (PNET in STOP1/2 only).

danielmartynek_0-1747376561745.pngdanielmartynek_0-1747376561745.png

 

0 Kudos
Reply

2,820 Views
mumumilmil
Contributor II

I completed Run to VLPS Mode. but Current is 2.5mA...

Thank you for @danielmartynek

 

0 Kudos
Reply

2,818 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Can you power-cycle the the MCU run it standalone without the debugger?

 

Regards,

Daniel

0 Kudos
Reply

2,815 Views
mumumilmil
Contributor II

Yes, I checked OSC voltage.

When MCU has been Run status, SOSC send output .

If MCU go to sleep-mode, OSC output's power is 0V. go to sleep by removed wire.(LPIT_Inturrupt)

 

But, I should be Wake-up by CAN signal. I think that needs to change VLPS to STOP mode.

0 Kudos
Reply

2,787 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @mumumilmil,

The SOSC module is disabled by the application not by the MCU, test BUS_CLK via CLKOUT instead.

You can use the pin interrupt of the CAN RX pin as a wakeup source in VLPS.

The first message will be lost though as the FlexCAN is disabled at the time.

 

BR, Daniel

 

 

 

0 Kudos
Reply

2,655 Views
mumumilmil
Contributor II

VLPS Mode should be use Port-inturrupt.

 

Thank you @danielmartynek .