imxrt1050_power_mode_switch_ca - Random "wakes" and PowerListener

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

imxrt1050_power_mode_switch_ca - Random "wakes" and PowerListener

992 Views
variable_andrew
Senior Contributor I

Two questions on LPM:

1.

For the imxrt1050_power_mode_switch_ca demo, what is the purpose of the following listener functions?

LPM_RegisterPowerListener
LPM_UnregisterPowerListener

A plain text search shows nothing in the project using them from what i can see.

 

The reason I ask is it appears that my app (LPM based off this demo) faults here when going from LPM_PowerModeLowPowerRun to OverDriveRun:

Screen Shot 2020-09-27 at 10.32.43 AM.png

Because this only happens occasionally, it's difficult to source the cause w/o even knowing what calls this.

 

2.

Usually my app goes to "sleep" and wakes up only when requested (which is great)....

BUT sometimes (rarely) my app "wakes" from LPM_PowerModeLowPowerRun (to go to OverDriveRun) even when the configured IRQ push button was not pressed.

Because of the rarity of this odd wake, hard to determine the cause. Any ideas what could cause this wake?

 

I have edited the system to treat LowPowerRun as a sleep mode by

  1. In lpm.h:  LPM_PowerModeRunEnd = LPM_PowerModeLowSpeedRun,
  2. changing lpm.c to:
void vPortPRE_SLEEP_PROCESSING(unsigned long timeoutMilliSec) {
  APP_PowerPreSwitchHook(APP_GetLPMPowerMode());
  LPM_EnableWakeupSource(vPortGetGptIrqn());

  switch (APP_GetLPMPowerMode()) {
    case LPM_PowerModeOverRun:
    case LPM_PowerModeFullRun:
    case LPM_PowerModeLowSpeedRun:
      break;
    case LPM_PowerModeLowPowerRun:
      LPM_LowPowerRun();
      break;
    case LPM_PowerModeSysIdle:
      LPM_EnterSystemIdle();
      break;
    case LPM_PowerModeLPIdle:
      LPM_EnterLowPowerIdle();
      break;
    case LPM_PowerModeSuspend:
      LPM_EnterSuspend();
      break;
    default:
      assert(false);
      break;
  }
}

void vPortPOST_SLEEP_PROCESSING(unsigned long timeoutMilliSec)
{
    switch (APP_GetLPMPowerMode())
    {
      case LPM_PowerModeOverRun:
      case LPM_PowerModeFullRun:
      case LPM_PowerModeLowSpeedRun:
      case LPM_PowerModeLowPowerRun:
          break;
      case LPM_PowerModeSysIdle:
          LPM_ExitSystemIdle();
          break;
      case LPM_PowerModeLPIdle:
          LPM_ExitLowPowerIdle();
          break;
      case LPM_PowerModeSuspend:
          break;
      default:
          assert(false);
          break;
  }

    LPM_DisableWakeupSource(vPortGetGptIrqn());
  APP_PowerPostSwitchHook(APP_GetLPMPowerMode());
}

 

 

And due to this issue with FreeRTOS w/ NXP's tickless idle causing inaccurate clocks:

https://forums.freertos.org/t/xeventgroupwaitbits-premature-timeout-cause/10432

I changed the FreeRTOSConfig by commenting out configSYSTICK_CLOCK_HZ

 

 

Labels (1)
0 Kudos
Reply
2 Replies

974 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you. 1) What is the purpose of the following listener functions? -- It seems like the log that records the power mode change. 2) According to your statement, after entering Low Power Run mode, the MCU will restore to Over RUN mode sometimes without giving any 'external trigger', is it right? If yes, can you introduce the step of replicating this phenomenon? as I've never encountered the phenomenon before. TIC ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. -------------------------------------------------------------------------------

0 Kudos
Reply

963 Views
variable_andrew
Senior Contributor I

Hi @jeremyzhou ,

Thanks for the quick response as always - I just realized a few things:

I got rid of the fault by moving more LPM code to AT_QUICKACCESS_SECTION_CODE:

AT_QUICKACCESS_SECTION_CODE(void ClockSelectXtalOsc(void));
AT_QUICKACCESS_SECTION_CODE(void ClockSelectRcOsc(void));
AT_QUICKACCESS_SECTION_CODE(void LPM_OverDriveRun(void));
AT_QUICKACCESS_SECTION_CODE(void LPM_LowPowerRun(void));

 

It would appear that perhaps after changing to LPM_PowerModeLowPowerRun, flash access isn't so reliable... for me at least... and this problem only just showed up now because I wasn't getting icache misses perhaps.

 

I'm wondering if this is related to my issue I had a while ago (clock settings for FLASH in low speed/low power modes: https://community.nxp.com/t5/i-MX-RT/Power-Mode-Switch-Demo-for-iMXRT1052-FreeRTOS/m-p/1084436#M9314 )

 

For reproducing the issue, I will try and come up with a demo you can run later in the week.

 

 

 

0 Kudos
Reply