Other Parts Discussed in Thread: MSPM0L2228, SYSCONFIG
Tool/software:
Hi,
I have 2 questions.
1)
I am using the Ti sample (sysctl_power_policy_sleep_to_stop) to change RunSleep0 to Stop2 and vice versa.
However, SYSOSC cannot be enabled after the power policy is changed from Stop2 to RunSleep0. (the return value of DL_SYSCTL_getPowerPolicyRUNSLEEP() is RunSleep3)
I also tested Stop0/1→RunSleep0, Standby0/1→RunSleep0, and all were normal. (the return value of DL_SYSCTL_getPowerPolicyRUNSLEEP() is RunSleep0)

/* * Copyright (c) 2021, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "ti_msp_dl_config.h" #define MNG_IntrSysTick SysTick_Handler volatile bool gTogglePolicy; int main(void) { SYSCFG_DL_init(); gTogglePolicy = false; NVIC_EnableIRQ(SW_INT_IRQN); DL_SYSCTL_POWER_POLICY_RUN_SLEEP runsleep; DL_SYSCTL_POWER_POLICY_STOP stop; DL_SYSCTL_POWER_POLICY_STANDBY standby; while (1) { gTogglePolicy = false; runsleep = DL_SYSCTL_getPowerPolicyRUNSLEEP(); stop = DL_SYSCTL_getPowerPolicySTOP(); standby = DL_SYSCTL_getPowerPolicySTANDBY(); DL_SYSCTL_setPowerPolicySTOP2(); //DL_SYSCTL_setPowerPolicySTANDBY0(); while (false == gTogglePolicy) { __WFI(); } gTogglePolicy = false; runsleep = DL_SYSCTL_getPowerPolicyRUNSLEEP(); stop = DL_SYSCTL_getPowerPolicySTOP(); standby = DL_SYSCTL_getPowerPolicySTANDBY(); DL_SYSCTL_setPowerPolicyRUN0SLEEP0(); } } void GROUP1_IRQHandler(void) { switch (DL_Interrupt_getPendingGroup(DL_INTERRUPT_GROUP_1)) { case SW_INT_IIDX: gTogglePolicy = true; break; default: break; } } void MNG_IntrSysTick(void) { }