About low power / sleep problems

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

About low power / sleep problems

2,840 Views
eautopower
Contributor IV

Hi:

S32DS gives an example of power management. If MCU goes into sleep, what external interrupts can wake it up? How do you wake up?

best wish

xie

0 Kudos
Reply
16 Replies

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

 

All available wake-up sources are listed in Table 7.3.1 of the RM.

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

Hi Daniel:

   I use the power management example in S32DS. I can only switch between HSRUN and RUN mode. I can't enter VLPR or VLPS mode. Why?I switched  from module to logical diagram in datasheet,How can I to do if I want to enter VLPR and VLPS?

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

 

LVPS and VLPR modes cannot be entered from HSRUN mode but only from RUN mode. I would recommend to simplify the example code and use the POWER_SYS_SetMode function directly without UART in debug mode.

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

That's what I did,I also switched from RUN mode to VLPR/VLPS, but not into VLPR/VLPS mode,like this:

pastedImage_1.png

pastedImage_3.png

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

I have checked the SDK example. I can enter every mode except for VLPR. A hard fault is triggered on an attempt to enter this mode.

 

There seems to be a problem with a peripheral clock for UART which is set at 8MHz by default. In VLPR mode all peripheral clock must be configured to 4MHz or less. But even though I change SIRCDIV2 to 4MHz, it doesn’t help.  

 

I’m able to enter this VLPR mode only when SIRC frequency range is changed to 2MHz.

SIRC_2MHz.png 

I will check with designers.

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

Daniel:

  yes,Now ,it can enter VLPR,But if that's changed. The VLPS model seems to be having problems.

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

 

What problems do you have with VLPS?  I have noticed from the code you attached that you enter VLPS or STOP mode and then you are trying to get frequency. But when the MCU is in stop mode, the debugger is disconnected from the MCU. Also, at the time the CLOCK_SYS_GetFreq function is being executed, the MCU is already awake and the function will return RUN mode frequency.  

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

Daniel:

   I have a 33 ohm precision resistor at the MCU power supply terminal. I confirm the current on the basis of the voltage across the resistor to determine the power consumption of the MCU. When the SIRC is switched to 2M, the current is about 10mA in the VPLR mode, but the power consumption in the VPLS mode is almost the same as that in the RUN mode.
   Also, I changed the SIRC, I run my other programs will run to fly, I did not change the SIRC before, there are also running when flying, such as SPI, baud rate is 500K, CAN 500K,and then open PIT, timed 1ms. Later, I changed the SPI baud rate to 1M is ok.

pastedImage_1.png

This time, I changed the SIRC to 2M, the program opens SYSTICK 1ms, SPI, CAN, the program runs as long as a fly, the probability is 100%, but I changed to 8M on all right.It's like a chip bug, and I'm worried about the chip right now.

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

I’m not sure if I understand. You were unable to enter VLPR, then you changed SIRC range to 2M and it helped. So you are able to enter the VLPR mode now but some peripherals don’t work, right?

The change of SIRC range also changes SIRCDIV1, SIRCDIV2 frequency for all the peripherals that use these clocks.

Are you sure the MCU is in VLPS mode when the current you measure is almost the same as the current in RUN mode?

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

Hi:

I mean SIRC change to 2M, peripherals can not work under the RUN mode, if we only test whether it can into  VLPR mode, current consumption is about 10mA, power consumption is reduced a lot, but it doesn't mean much, because I am in the RUN mode, other peripherals are unable to work, as long as other peripherals, program run fly,it will run to the following picture position:

pastedImage_1.png

What we need is how to get MCU into sleep, the current after sleep, as Datasheet explains.and in RUN/HSRUN mode, the program doesn't run fly.

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Well, the SDK seems to be having some problems because you should be able to enter the VLPR mode while the SIRC range is set to 8MHz. I have already reported the issue. The DefaultISR might be a hardfault due to some overclocking.

I would recommend to leave the SIRC range at 8MHz and use the code which is described in the AN5425 Power Management for S32K14x to enter the VLPR/VLPS modes.

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

   Hi Daniel:

      What's the progress regarding power management?Do all IO interrupts interrupt sleep?

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

 

The SDK team have found the cause of the VLPR issue.

It is caused by a bug in a clock manager component.

To fix it, in the PowerManager example project in DSK/platform/hal/scr/scg/scg_hal.c

change regAddr = &base->VCCR  to regAddr = &base->HCCR (line 186)

remove line 187 with base->HCCR = value

sdk_bug_fix.png 

This bug will be fixed in the release after RTM SDK (0.8.3).

Regards,

Daniel

0 Kudos
Reply

2,200 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Sorry for the delay.

I have received a response from the SDK team. They still investigate the issue.

Wake-up sources are listed in Table 7.3.1 in RM. Pin interrupts are configurable in Port module (PORT_PCRn), during a stop mode they also generates a wake-up signal to exit low-power modes.

 

Regards,

Daniel

0 Kudos
Reply

2,200 Views
eautopower
Contributor IV

Daniel:

 pastedImage_2.png

Debugger can't go in when it run this program,Now mode is STAT_VLPR,Do you have following source codepastedImage_3.png

0 Kudos
Reply

2,199 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The application note AN5425 Power Management for S32K14x doesn’t contain any additional software.

But all the functions are described. You only need to disable all clock monitors in SCG module and set all clock frequencies so that they meet requirements for VLPR mode. Core, System and Bus clock frequecy must be max 4 MHz and flash clock max 1MHz. Also, all peripheral clock frequencies must be equal or less than 4MHz.

 

Regards,

Daniel

0 Kudos
Reply