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.

CC2652P: whether uart need close or not when CC2652P cpu enter sleep for lowest power consumption?

Part Number: CC2652P


Hi, I use CC2652P on my target, SimpLink SDK v4.20,.

When I test sleep current on my target, I found this:

If I close uart with UART_close(UartHandle) in TI Drivers, then sleep current on my target is 14uA.

If I didn't close uart, then sleep current on my target is 1.7mA.

And I initialized spi, i2c, adc in my code. Spi, i2c, adc remains open in init procedure, and they have no influence to sleep current.

In a word : 

SPI, I2C, ADC open, UART open: 1.7mA

SPI, I2C, ADC open, UART close: 14uA.

So, is closing uart a necessary step for low power application?

  • Hi Yingtao,

    You do not need to close it to go into full standby. You do however need to make sure that it is in idle, meaning that there is no read/write operation being left active.

    You could try to for example call UAR_readCancel() before going into standby to see if you might be having an active read.

  • Thank you, I use UART_readCancel() before going into standby, and it still remains 1.7mA.

    UART_close can be 14uA.

  • Hi Yingtao,

    Could you share the code that relates to UART in your application so that I could better understand what you are doing and what could be the issue?

  • This is app_uart_init():

    void app_uart_init(void)
    {
        UART_init();
    
        UART_Params_init(&uartParams);
    
        uartParams.baudRate         = 460800;
    
        uartParams.writeMode        = UART_MODE_BLOCKING;
        uartParams.writeDataMode    = UART_DATA_BINARY;
        uartParams.writeTimeout     = 1000;
    
        uartParams.readMode         = UART_MODE_CALLBACK;
        uartParams.readDataMode     = UART_DATA_BINARY;
        uartParams.readReturnMode   = UART_RETURN_FULL;
        uartParams.readEcho         = UART_ECHO_OFF;
        uartParams.readCallback     = UartReadCallback;
    
    
        UartHandle = UART_open(UART_Debug, &uartParams);
    
        // rx pull up
        IOCIOPortPullSet(IOID_12, IOC_IOPULL_UP);
    
        if (UartHandle == NULL) {
            /* UART_open() failed */
            while (1);
        }
    
        UART_control(UartHandle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL);
        UART_read(UartHandle, uartrx_buf, sizeof(uartrx_buf));
    }

    This is app_uart_close():

    void app_uart_close(void)
    {
        UART_close(UartHandle);
    }

    This is entering standby code in a app TI-RTOS task:

    app_uart_close();
    
    while (1)
    {
    	Semaphore_pend(gSem, BIOS_WAIT_FOREVER);
    }

    The phenomenon is:

    If I use code above , the current is 14uA;

    If I comment app_uart_close() so that uart stays open, the current goes to 1.7mA.

  • Hi,

    Based on the code above, that would be the expected behavior yes. Without the "close", your initial UART_read() would remain active and keep you out of standby. If you said that using "readCancel" did not work, consider if you might be restarting the read again inside the callback?

  • Thank you.

    Use uart_cancel() in readcallback works.