AnsweredAssumed Answered

LPC4357 can't wakeup from deep power down by wakeup0 pin

Question asked by lpcware Employee on Jun 15, 2016
Latest reply on Nov 10, 2016 by Justin Fuller
Content originally posted in LPCWare by tkggitfk24 on Wed Mar 02 22:38:04 MST 2016
I am using the lpcopen library and Keil MCB 4357 Board. After power up, the board will enter deep power down mode, then I press the wakeup0 key, but the board can't be waked up(as good as reset).

My questions are:
1. Chip_EVRT_Init() function will clear all status bit in event router, but actually, it does not really clear all the status. the status register is read as 0x1F7FBFE, why can't be cleared?

2. After entering deep power down mode, why can't be waked up?I already enabled this.


bool power_enabled = false;
bool key_pressed = false;

int main(void)
{
    SystemCoreClockUpdate();
    Board_Init();

    DEBUGSTR("In main()\r\n");

    /* Initialize the Event Router */
    Chip_EVRT_Init();
    PMC_Evrt_Configure(EVRT_SRC_WAKEUP0);

    if (key_pressed)
    {
        DEBUGSTR("Power Enabled\r\n");
        power_enabled = true;
    }
    else
    {
        DEBUGSTR("Enter Sleep Mode in mian()\r\n");

        /* Call Pre SleepPowerDown function */
        PMC_Pre_SleepPowerDown();

        /* Goto Deep Sleep mode */
        Chip_PMC_Set_PwrState(PMC_DeepPowerDown);

        /* Wake up from Deep power down state is as good as RESET */
        while (1) {}
    }

    for(;;)
    {
        Board_LED_Toggle(0);
        DelayUs(200000);
    }
}

void EVRT_IRQHandler(void)
{
    if (Chip_EVRT_IsSourceInterrupting(EVRT_SRC_WAKEUP0))
    {
        Chip_EVRT_ClrPendIntSrc(EVRT_SRC_WAKEUP0);
       
        if (power_enabled)
        {   
            power_enabled = false;
            /* Call Pre SleepPowerDown function */
            PMC_Pre_SleepPowerDown();

            /* Goto Deep Sleep mode */
            Chip_PMC_Set_PwrState(PMC_DeepPowerDown);

            /* Wake up from Deep power down state is as good as RESET */
            while (1) {}
        }
        else
        {
            key_pressed = true;
        }
    }
}

Outcomes