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.

deepsleep question vApplicationIdleHook does not work

Other Parts Discussed in Thread: CC3200

I  want to test the deepsleep powermode of cc3200 . I have runned the project of deepsleep_nw. It works well.

Then i copy these function (vApplicationIdleHook( void))  to my project .I find it does not work.There are no message reported .

This is my function . What should i do .

#include "FreeRTOS.h"
#include "osi.h"

void
vApplicationIdleHook( void )
{
    int iRetVal;

    //
    // Enter SLEEP...WaitForInterrupt ARM intrinsic
    //
    Report("DEEPSLEEP: Entering DeepSleep\n\r");

    //MAP_UtilsDelay(80000);
    for(iRetVal = 0; iRetVal < 80000; iRetVal++);


    //
    // Disable the SYSTICK interrupt
    //
    MAP_IntDisable(FAULT_SYSTICK);
    MAP_PRCMDeepSleepEnter();

    //
    // Enable the SYSTICK interrupt
    //
    MAP_IntEnable(FAULT_SYSTICK);
    Report("DEEPSLEEP: Exiting DeepSleep\n\r");
}

IN FreeRTOSConfig.h

#define configUSE_PREEMPTION            1
#define configUSE_IDLE_HOOK                1
#define configUSE_TICK_HOOK                0 // 1

  • Hi Weilsng Li,

    Does the main task in your application block on some OS construct in order to relinquish the CPU for the low priority idle task to execute?

    Best regards,

    Naveen

  • sorry,i can't understand the meaning (block on some OS construct),

    I creat four tasks. In every task i used while(1);

    I want to know when the function will be executed.

  • Hi Weilsng Li,

    By blocking on OS construct, i meant for ex., waiting on semaphore. Or if you invoke a blocking simplelink API (for ex. sl_recv) it will inturn block on a semaphore. This will allow the OS to schedule the low priority idle task.

    Having while(1) loop will not allow the idle task to run.

    Best regards,

    Naveen 

  • Hi Naveen,

    Wouldn't Task_Sleep() also qualify as an OS construct in this context?  I have a similar situation as Weilsng, in that I have an app with a number of tasks running, each with a main while(1) loop, but within each there is always a Task_sleep() call.  Some of these also wait on semaphores and/or make simplelink calls, but all will at some point reach the Task_sleep call.  I tried to just print out a message in the vApplicationIdleHook function but it never runs.

    Could it be that there is never a point where all tasks are idle (in the Task_sleep call) at the same time?  I've tried disabling most tasks but it doesn't change.

    Also, I'm using TI-RTOS, so I'm not sure the vApplicationIdleHook function applies here.  I found this function (empty) in the network_if.c file, but within a #ifdef USE_FREERTOS switch and it was greyed out since I'm not using FreeRTOS.  Is vApplicationIdleHook applicable to TI-RTOS?  This call is used in the deepsleep_nw example but it's not too clear to me if this is using FreeRTOS or TI-RTOS.


    Thanks,

    Angelo