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.

RTOS/CC1350: Power_enablePolicy()

Part Number: CC1350

Tool/software: TI-RTOS

Hi,

I'm using CCS 7.3.0.00019 and SimpleLink 1.50.00.08 on CC1350 Launchpad.

With previous releases I had to use the command Power_enablePolicy() to get standby mode for the device, but now I get 10uA of current consumption even if I don't use the command.

So is it now an useless command?

Or is better that I continuer to use it, even if I don't see differences in consumption?

Thanks.

Regards.

  • Hi,

    applications are usually not supposed to call Power_enablePolicy(), because the kernel standby policy is enabled by default. But calling it explicitly shouldn't do any harm either. Could you please show where in your application and how you are calling this function?

  • I'm trying it in the main_tirtos.c file, in a project derived from uartecho example:

    int main(void)
    {
        pthread_t           thread;
        pthread_attr_t      attrs;
        struct sched_param  priParam;
        int                 retc;
        int                 detachState;

        /* Call driver init functions */
        Board_initGeneral();
        Power_enablePolicy();
        SPI_init();

        /* Set priority and stack size attributes */
        pthread_attr_init(&attrs);
        priParam.sched_priority = 1;

        detachState = PTHREAD_CREATE_DETACHED;
        retc = pthread_attr_setdetachstate(&attrs, detachState);
        if (retc != 0) {
            /* pthread_attr_setdetachstate() failed */
            while (1);
        }

        pthread_attr_setschedparam(&attrs, &priParam);

        retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
        if (retc != 0) {
            /* pthread_attr_setstacksize() failed */
            while (1);
        }

        retc = pthread_create(&thread, &attrs, mainThread, NULL);
        if (retc != 0) {
            /* pthread_create() failed */
            while (1);
        }

        BIOS_start();

        return (0);
    }

  • Hi,

    calling this function is only necessary when Power_disablePolicy() has been called before. This is not the case in the above code. The kernel standby policy is enabled by default, you don't need to do anything. Any call to a blocking function, for instance slee(), usleep(), Task_sleep(), Semaphore_pend(), DriverXXX_blockingCall() will cause the TI-RTOS kernel to set the power driver into the deepest possible sleep mode.

    However, the function Power_enablePolicy() is just a setter and calling it cannot lead to higher power consumption:

    void Power_enablePolicy(void)
    {
        PowerCC26XX_module.enablePolicy = true;
    }

    There is either a peripheral enabled or you have some current leaking from one of the pins.

  • Ok, I understand.
    This closes the issue.

    Thanks.
    Regards.