CONFIGURING RTC ALARM AS LLWU SOURCE K65 - MQX

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

CONFIGURING RTC ALARM AS LLWU SOURCE K65 - MQX

Jump to solution
1,185 Views
annamol
Contributor IV

Hi,

I am trying to configure RTC alarm as wakeup source for K65F180M processor. The following changes were made in bsp and application for the same.

In init_lpm.c,

// LPM_OPERATION_MODE_STOP

    {

        LPM_CPU_POWER_MODE_LLS,                     // Index of predefined mode

        0,                                          // Additional mode flags

        LLWU_PE1_WUPE3(1),                                          // Mode wake up events from pins 0..3

        0,                                          // Mode wake up events from pins 4..7

        0,                                          // Mode wake up events from pins 8..11

        LLWU_PE4_WUPE13(1),                                          // Mode wake up events from pins 12..15

        LLWU_ME_WUME5_MASK    //    LLWU_ME_WUME0_MASK Mode wake up events from internal input sources -

    },

as RTC alarm is mapped onto LLWU_ME5.

 

But the core is not coming out of LLS mode. RTC alarm works fine independently and transition between power modes VLPR and LLS also works fine.  I want the core to out of LLS mode when RTC interrupt occurs at the predefined period.  I am attaching the MQX code written for the same. Please do help me with the configuration, as i believe I am missing something in configuration. The development environment is IAR and a K65 eval kit.

  • Do we need to use RTC wakeup pin?
  • Is it because RTC clock gets disabled in LLS?

I have attached the code being used. One more doubt, is it possible to use debugger in low power modes like LLS, VLLSx. The bare metal implementation of power down modes allows debugger to be used even in low power modes. Is it possible in mqx? If yes, how can we do that

Original Attachment has been moved to: main.c.zip

0 Kudos
1 Solution
516 Views
soledad
NXP Employee
NXP Employee

Hi,

MQX integrates a Low-Power Management (LPM) driver to take advantage of the low-power operating modes in MQX applications.

Please check the below application note:

http://cache.freescale.com/files/32bit/doc/app_note/AN4447.pdf

I would recommend running the LPM example located at [mqx_dir]\mqx\examples\lowpower on a supported Kinetis tower board. It shows using the RTC to wakeup out of various low power modes, including the LPM_OPERATION_MODE_STOP that you are interested in. The clocks are restored after wake-up to enable the UART to output the results. This is done in the LPM driver, in the file [mqx_dir]\mqx\source\io\lpm\lpm_kinetis.c

Also note that you cannot go into LLS mode while using the debugger, so the register readings after waking up will have to be done via a UART printf.

I hope this helps, have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
517 Views
soledad
NXP Employee
NXP Employee

Hi,

MQX integrates a Low-Power Management (LPM) driver to take advantage of the low-power operating modes in MQX applications.

Please check the below application note:

http://cache.freescale.com/files/32bit/doc/app_note/AN4447.pdf

I would recommend running the LPM example located at [mqx_dir]\mqx\examples\lowpower on a supported Kinetis tower board. It shows using the RTC to wakeup out of various low power modes, including the LPM_OPERATION_MODE_STOP that you are interested in. The clocks are restored after wake-up to enable the UART to output the results. This is done in the LPM driver, in the file [mqx_dir]\mqx\source\io\lpm\lpm_kinetis.c

Also note that you cannot go into LLS mode while using the debugger, so the register readings after waking up will have to be done via a UART printf.

I hope this helps, have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
515 Views
annamol
Contributor IV

Hi,

The core was not waking up because of a silly mistake i did in code. I forgot to enable interrupt for and had registered call back alone.

// Enable RTC interrupt

    _bsp_int_init(INT_RTC , 2 , 0 , TRUE);      // enable interrupt

    _bsp_int_enable(INT_RTC);

Anyways thanks for the help.

0 Kudos