This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432P401R进入LPM3模式后P1.1无法唤醒

问题如题,简要描述下条件:

1.复位后,初始化了DCO时钟,3MHz,使能了SMCLK,初始化了UART、I2C接口;

2.两个接口通信一些数据后准备进入深度休眠模式,开始Disable UART、I2C,并配置其中IO为输入,配置PCM为AM_LDO_V0,配置REFO为32768Hz,使能BCLK,ACLK,同时,配置P1.0为上拉输入,开中断,在中断中反转P2.0上的LED, 调用函数MAP_PCM_gotoLPM3InterruptSafe()进入休眠。  可进入休眠;

3.按下P1.0上的按钮,却无法唤醒MCU,请问问题出在哪儿了。

  • 先试试单独运行LPM3列程是否正常
  • 同意楼上的看法,建议您将问题分离开分析。先不要使用UART和I2C,直接测试低功耗的休眠与唤醒
  • 单独运行库中的示例,是进LPM45模式,可以唤醒。 还有,在我主题中描述的,中断中反转LED信号的操作确实已经发生,但就是无法唤醒。
  • 使用了TI库simplelink_msp432p4_sdk_3_10_00_08\examples\nortos\MSP_EXP432P401R\driverlib\pcm_go_to_lpm3 中的示例代码,也无法唤醒。

     /* Setting LFXT to lowest drive strength and current consumption */
        MAP_CS_startLFXT(CS_LFXT_DRIVE0);
        MAP_CS_initClockSignal(CS_ACLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
        MAP_CS_initClockSignal(CS_BCLK, CS_LFXTCLK_SELECT, CS_CLOCK_DIVIDER_1);
    
        /* Disable retention for SRAM banks */
        /* SRAM Bank 0 is always retained and cannot be powered down and
         * the stack is held in Bank 7, be aware of the size of your stack when
         * disabling and enabling SRAM Bank Retention */
        MAP_SysCtl_disableSRAMBankRetention(SYSCTL_SRAM_BANK1 | SYSCTL_SRAM_BANK2 |
                                            SYSCTL_SRAM_BANK3 | SYSCTL_SRAM_BANK4 |
                                            SYSCTL_SRAM_BANK5 | SYSCTL_SRAM_BANK6);
    
        /* Disabling high side voltage monitor/supervisor */
        MAP_PSS_disableHighSide();
    
        /* Enabling "rude" mode which forces device to go to sleep regardless of
         * outstanding clock requests */
        MAP_PCM_enableRudeMode();
    
        /* Enabling MASTER interrupts */
        MAP_Interrupt_enableMaster();
    
        /* Going to LPM3 */
        while (1)
        {
            /* Note that while this examples just goes to LPM3, LPM4 is essentially
                just LPM3 with WDT_A/RTC_C disabled. For convenience, the user can 
                use the MAP_PCM_gotoLPM4() function if they want the API to handle
                the disabling of these components */
            MAP_PCM_gotoLPM3();
            for( uint32_t n = 0; n < 1000000; n++ )
            {
                memcpy(abDst, abStr, sizeof(abDst) );
                if( (n % 10000) == 0 )
                {
    /*!< 无法运行到此。*/ MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P2, GPIO_PIN0); } } }

  • 解决了,仔细看了看手册中,在进入LPM3模式前,未清除Sleep-on-exit 位,即SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk;要设置一下,不然,只向应中断,中断退出后又休眠了。
  • 很高兴您能解决问题,谢谢分享答案

  • 另外我们有对应的文档,您也可以参考一下

    Proper Sleep and Interrupt Use on the SimpleLink™ MSP432™ ARM® Cortex®-M4 Microcontrollers

    www.ti.com/.../slaa739.pdf