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.

CCS/CC1312R: Uart0 cannot be traced by EnergyTrace

Part Number: CC1312R
Other Parts Discussed in Thread: ENERGYTRACE

Tool/software: Code Composer Studio

Hi,

we would like to optime the power consumption of our custom board. We have test the EnergyTrace with RF Core and we got really good results. We would like to optimze the power consumption while reading some sensor values through UART, but we cannot get any state changes related with uart from EnergyTrace.  (The sensor and Uart communication is working)

Here is our test code for Energy consumption:

void TestUartPower()
{
    UART_Params_init(&scd30UartParams);
    scd30UartParams.writeDataMode = UART_DATA_BINARY;
    scd30UartParams.readDataMode = UART_DATA_BINARY;
    scd30UartParams.readReturnMode = UART_RETURN_FULL;
    scd30UartParams.readEcho = UART_ECHO_OFF;
    scd30UartParams.readMode = UART_MODE_CALLBACK;
    scd30UartParams.readCallback = SCD30UartReadCallback;
    scd30UartParams.writeMode = UART_MODE_BLOCKING;
    scd30UartParams.baudRate = 19200;
    scd30UartParams.dataLength = UART_LEN_8;
    scd30UartParams.stopBits = UART_STOP_ONE;
    scd30UartParams.parityType = UART_PAR_NONE;
    scd30UartParams.readTimeout = BIOS_WAIT_FOREVER;
    scd30UartParams.writeTimeout = BIOS_WAIT_FOREVER;
    while (1)
    {

        scd30UartHandle = UART_open(Board_UART1, &scd30UartParams);
        if (scd30UartHandle == NULL)
        {
            LOG(LOG_SENSOR_LEVEL, "Cannot UART_open");
            return STATUS_FAIL;
        }
        UART_control(*handle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL);
        UART_control(*handle, UARTCC26XX_CMD_RX_FIFO_FLUSH, NULL);

        UART_read(scd30UartHandle, readBuffer_, sizeof(readBuffer_));
        UART_control(scd30UartHandle, UART_CMD_RXDISABLE, NULL);
        Task_sleep(200 * SC_MILLISECOND);
        UART_control(scd30UartHandle, UART_CMD_RXENABLE, NULL);
        Task_sleep(200 * SC_MILLISECOND);
        UART_readCancel(scd30UartHandle);
        UART_close(scd30UartHandle);
        Task_sleep(200 * SC_MILLISECOND);
    }
}

Here is the output of EnergyTrace:

Here are my questions:

1- I could not see ant state transition in UART1, why?

2- The SERIAL_PD is seems to be off, is that correct?

3- There are no UART related interrupts, is that correct?

Best Regards

  • Hi, 

    Let us try to reproduce this and get back to you.

    -Simon

  • Hi,

    I would like to share the test setup:

    my operating system is Ubuntu 18.04, CCS version is  9.1.0.00010.  I'm using Simplelink CC13X2 26x2 SDK version 3.30.0.03.  (I have also tested under CCS 9.2.0.00013 , no change )

    Do you need other information?

  • Hi.

    I have tried to recreate your code, but I get stuck in a power policy error when disabling the UART. I think there is some setup you are doing that I can't see in your code snippet.  Are you able to share more of your code?

    Regards,
    Vegard

  • Hi,

    unfortunately, the code is distributed among different processes and threads. I can share with you my initialization (I think the power policy could be related with this, since the UART RX should be in not blocking mode to power it down)

    Here is my initialization code for UART:

      UART_Params_init(&scd30UartParams);
        scd30UartParams.writeDataMode = UART_DATA_BINARY;
        scd30UartParams.readDataMode = UART_DATA_BINARY;
        scd30UartParams.readReturnMode = UART_RETURN_FULL;
        scd30UartParams.readEcho = UART_ECHO_OFF;
        scd30UartParams.readMode = UART_MODE_CALLBACK;
        scd30UartParams.readCallback = SCD30UartReadCallback;
        scd30UartParams.writeMode = UART_MODE_BLOCKING;
        scd30UartParams.baudRate = 19200;
        scd30UartParams.dataLength = UART_LEN_8;
        scd30UartParams.stopBits = UART_STOP_ONE;
        scd30UartParams.parityType = UART_PAR_NONE;
        scd30UartParams.readTimeout = BIOS_WAIT_FOREVER;
        scd30UartParams.writeTimeout = BIOS_WAIT_FOREVER;
        *handle = UART_open(SCD30_UART, &scd30UartParams);
        if (*handle == NULL)
        {
            LOG(LOG_ERR, "Cannot UART_open");
            return STATUS_FAIL;
        }
        UART_control(*handle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL);
        UART_control(*handle, UARTCC26XX_CMD_RX_FIFO_FLUSH, NULL);
        return STATUS_OK;

    If you need anything, please let me know. If you cannot create my case, can you please share your in which the UART changes its state in EnergyTrace++?

    Best Regards

  • Hi Vegard,

    is there any update?

    Best Regards

  • Hi

    Sorry for the delayed response. 

    Why are you using the UART_control function? The UART driver should be able to handle the different things like FIFO flushing, etc. 

    For example. why do you want to disable the UART RX on line 30 in your first code snippet?

    Regards, 
    Vegard

  • Hi,

    due to power consumption issues, in our project a larger state machine is working which need such events and procedures to sleep external sensors/devices. 

    Anyway, whether I'm using control functions or not, the EnergyTrace should show me a change in the status of UART when we are activating and deactivating the UART by using UART_Open and UART_Close functions. Am I right? Now, there is no change in the state and SERIAL_PD is seems to be off.

    Best Regards

  • Hi,

    is there any progress in this threat? If you need and if it will be helpful, we can supply all project files in private.

    Best Regards

  • Hi.

    That would be very helpful, as I have not been able to reproduce it on my own.

    If you add me as a friend on E2E, you can send the code through a private message. 

    Regards, 
    Vegard

  • Hi Vegard,

    I will sent the code to you in private but you need some sensors connected to board. You can create a basic UART transmit-receive code so that you can directly connect to a PC, then you can use Energytrace++ to trace the state of Serial_PD. I think the problem is not related with external sensors etc. Still, I will sent you my code for your review.

    Best Regards

  • Hi

    I have now looked at your code. I couldn't get it to run, due to a library that was not included in the files you sent me, but I was able to set up the UART similar to how you implemented in the test case. I am able to get transitions for the UART with EnergyTrace.

    When you run the test code, are you able to get data on the UART? Can you check the UART pins with a logic analyser?

    Regards, 
    Vegard

  • Hi Vegard,

    actually, the UART is working. We are sure about it because there is a sensor connected to MCU through UART and we can get sensor values from the Sensor. We have also connected an FTDI to be sure that the data is on the line and it is.

    Best Regards