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.

To configure UART as a wake up source.

Other Parts Discussed in Thread: TM4C129ENCPDT

Hi,

I am using MCU TM4C129ENCPDT. I have configured UART7 as the wake up source when my device goes to sleep. 

However, I see that my device does not go to sleep. I am sending you the snippet of the code.

uint8_t Set_Battery_Mode(void)
{
uint8_t u8_wifi_ret;
bool benable;


/*Enable UART7 in sleep mode*/
SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_UART7);
UARTClockSourceSet(UART7_BASE, UART_CLOCK_PIOSC);/*Sleep mode clocking for UART is enabled */
/*To set wake up source*/
benable = IntMasterEnable();/*Enable interrupts to the processor*/
if(0u == benable)
{
System_printf("interrupts to the processor not enabled\r\n");
System_flush();
}

IntRegister(INT_UART7, UART7Handler); /*Registers a function to be called when an interrupt ocurs*/

IntPrioritySet(INT_UART7, 0); /*Set the UART 7 interrupt priority to the highest priority*/
IntEnable(INT_UART7); /* Enables UART7 as an interrupt in the interrupt controller*/
UARTIntEnable(UART7_BASE, UART_INT_RX);/* Rx has been set up as an interrupt source*/

/* WiFi is switched OFF in battery mode*/
u8_wifi_ret = WiFi_OFF();
if(0 == u8_wifi_ret)
{
System_printf("\nWiFi OFF Success...\r\n");
System_flush();
}
else
{
System_printf("\nWiFi OFF failed....\r\n");
System_flush();
}

/*System goes to sleep mode*/
SysCtlSleep();

gu8_current_mode = BATTERY_MODE;
return gu8_current_mode;
}

UART pin configurations are taken care in the driver level.

Kindly help. Thankyou.

Regards,

Anjana

  • Hi Anjana,

    A couple of questions...
    - Are you using TI-RTOS ? If so, which version ?
    - How are you determining that the core does not go to sleep ?

    I noticed that you are using driverlib APIs like IntRegister to manipulate interrupts. If you are using TI-RTOS then I would recommend using TI-RTOS kernel's Hwi module for registering interrupts. This is because the driverlib interrupt APIs may conflict with TI-RTOS kernel's Hwi module.

    Best,
    Ashish