AnsweredAssumed Answered

Using MQX LPM on K22 (MQX 4.2)

Question asked by Eric Bollerman on May 5, 2017
Latest reply on May 9, 2017 by Eric Bollerman

Hey All,


I have a question regarding the use of the LPM on the K22, specifically switching back and forth between LPM_OPERATION_MODE_RUN and LPM_OPERATION_MODE_WAIT. I am brand new to this so pardon any ignorance. My chip seems to be resetting after going back into LPM_OPERATION_MODE_RUN mode. I have enabled MQX_ENABLE_LOW_POWER in user_config.h and am able to successfully switch to WAIT mode. Once I am in wait mode however, I am reset and my debugger show that I am in boot.S and restarting. I have used the low power example and the flow of my program is quite simple and is similar to this:


if (CM_ERR_OK != _lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_2MHZ))
_lpm_set_operation_mode (LPM_OPERATION_MODE_WAIT);


/* wait for button press */


_lpm_set_operation_mode (LPM_OPERATION_MODE_RUN);
if (CM_ERR_OK != _lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_DEFAULT))


My problem seems to occur inside _lpm_clock_configuration() -> _cm_set_clock_configuration() -> _bsp_set_clock_configuration()


Sorry if this is too broad. Any help, or understanding of how the LPM actually works would be greatly appreciated!