AnsweredAssumed Answered

Power Mode Switch Demo for iMXRT1052 + FreeRTOS

Question asked by variable_andrew on Jun 23, 2020
Latest reply on Jul 7, 2020 by variable_andrew

What modification is necessary to run the Power Mode Switch Demo for iMXRT1052 in FreeRTOS assuming FreeRTOS is running in low power tickless mode?

 

I'm trying to do this - but code is crashing when I add the following to my application after Board Clock / Peripheral init:

LPM_Init();
LPM_OverDriveRun();

1. Does altering the clocks w/ the LPM code breaks the freertos low power tickless logic (ie - low power tickless timer executes and tries to run WFI when the device might already be in low power state?

 

2. Does the Power Mode Switch Demo doesn't account for other peripherals? Our device is using lpspi, lpuart, lpi2c, usb, semc, flexspi...  Do I need to do extra stuff just to run in LPM_OverDriveRun? (I want to eventually run in LPM_PowerModeSysIdle mode)

 

3. Any insight regarding restrictions if using LPM code from the ^^^ demo in a FreeRTOS project would be much appreciated. 

3a. Should I freeze all tasks / timers before changing LPM modes?

3b. Do I need to completely de-init all peripherals and re-init just to change modes from run to idle?

 

4. Does LPM_EnableWakeupSource need to be executed every time you want to go to sleep, or can it just be executed once @ startup assuming you have a dedicated push button.

Can you use the same GPIO IRQ for wake up and standard ISR code? (ie - is it OK for me to override void GPIO1_Combined_16_31_IRQHandler(void) in my code - this won't break the wake-up logic?)

 

5. I noticed the Power Mode Switch Demo actually alters the USB related PLLs - I thought this was NOT recommended when running code from XIP? (as per here from clock_config.c):

Outcomes