waked up RT1011 from low power idle mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

waked up RT1011 from low power idle mode

1,853 Views
1668834026
Contributor I

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. 

pastedImage_5.png

pastedImage_6.png

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);
}
}

Labels (1)
0 Kudos
Reply
6 Replies

1,700 Views
1668834026
Contributor I

I add  the function which data match wake up MCU , but it does not work.

pastedImage_1.png

this is my code.

APP_WAKEUP_LPUART_BASE->CTRL &= ~(1 << LPUART_CTRL_DOZEEN_SHIFT);

APP_WAKEUP_LPUART_BASE->CTRL |= LPUART_CTRL_RWU(1)|LPUART_CTRL_WAKE(1);
APP_WAKEUP_LPUART_BASE->BAUD |= LPUART_BAUD_MATCFG(3)|LPUART_BAUD_MAEN1(1)|LPUART_BAUD_MAEN2(1);
APP_WAKEUP_LPUART_BASE->MATCH = LPUART_MATCH_MA1(0x81)|LPUART_MATCH_MA2(0xAA);

0 Kudos
Reply

1,700 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Uart clock source is set to pll3_80m when initialization. When entering into low power idle, pll3 is closed. You should switch to osc clock.

Regards,

Jing

0 Kudos
Reply

1,700 Views
1668834026
Contributor I

Hi, Pan

According  to RM, the lpuart should work and remain enabled in low power idle . And I have switched to osc clock and didn't close it. . However, when it enter low power idle or system idle, the uart didn't work. Why?

pastedImage_1.png

0 Kudos
Reply

1,700 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

How do you set the  CTRL[DOZEEN] bit? In 40.2.2 it says the LPUART will remain functional during Stop mode, provided the CTRL[DOZEEN] bit is clear and the asynchronous transmit and receive clock remain enabled. The
LPUART can generate an interrupt or DMA request to cause a wakeup from Stop mode.

Regards,

Jing

0 Kudos
Reply

1,700 Views
1668834026
Contributor I

Hi, Pan

I change the  CTRL[DOZEEN] bit to zero.  This is reflected in my code.

pastedImage_1.png

0 Kudos
Reply

1,700 Views
1668834026
Contributor I

Hello, Pan

I have switched to osc clock in my code. However, when it enter low power idle or system idle, the uart didn't work.

pastedImage_1.png

0 Kudos
Reply