AnsweredAssumed Answered

waked up RT1011 from low power idle mode

Question asked by 植渲 周 on Jun 3, 2020
Latest reply on Jun 10, 2020 by 植渲 周

Hello, everyone

 

I want to use lpuart to waked up RT1011 from low power idle mode, but I don't make sucessful. When Soc enter low power idle, and it cann't respond the Interrupt of lpuart and exit low power idle.  Please ask me how to do. 

 

This is my code.

 

void lpuart_init(void)

{

/* Configure UART divider to default */
CLOCK_SetMux(kCLOCK_UartMux, 1); /* Set UART source to OSC 24M */
CLOCK_SetDiv(kCLOCK_UartDiv, 0); /* Set UART divider to 1 */

 

lpuart_config_t config;
/*
* config.baudRate_Bps = 115200U;
* config.parityMode = kLPUART_ParityDisabled;
* config.stopBitCount = kLPUART_OneStopBit;
* config.txFifoWatermark = 0;
* config.rxFifoWatermark = 0;
* config.enableTx = false;
* config.enableRx = false;
*/
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = BOARD_DEBUG_UART_BAUDRATE;
config.enableTx = true;
config.enableRx = true;

LPUART_Init(APP_WAKEUP_LPUART_BASE, &config, APP_WAKEUP_LPUART_CLK_FREQ);

/* Enable RX interrupt. */
LPUART_EnableInterrupts(APP_WAKEUP_LPUART_BASE, kLPUART_RxDataRegFullInterruptEnable);
EnableIRQ(APP_WAKEUP_LPUART_IRQn);
NVIC_EnableIRQ(APP_WAKEUP_LPUART_IRQn);

LPM_EnableWakeupSource(APP_WAKEUP_LPUART_IRQn);

}

 

void lowpoweridle(void)

{

LPM_PreEnterWaitMode();
LPM_EnterLowPowerIdle();

LPM_ExitLowPowerIdle();
LPM_PostExitWaitMode();

}

 

 

void APP_WAKEUP_LPUART_IRQn_HANDLER(void)
{
if ((kLPUART_RxDataRegFullFlag)&LPUART_GetStatusFlags(APP_WAKEUP_LPUART_BASE))
{
recv_data = LPUART_ReadByte(APP_WAKEUP_LPUART_BASE);
PRINTF("%c", recv_data);
LPM_DisableWakeupSource(APP_WAKEUP_LPUART_IRQn);
}
}

Outcomes