Trouble with bare new dsPIC project

johnbaker70 wrote on Monday, July 13, 2009:

I was able to compile, link and run the dsPIC demo on my eval board but cannot get the bare project to compile. Getting error:
In function `prvIdleTask’:
C:\FreeRTOS_5.3.1\FreeRTOS\source\tasks.c:1789: undefined reference to `vApplicationIdleHook’

My main code is:

/* Standard includes. */
//#include <stdio.h>

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "task.h"
//#include "queue.h"
//#include "croutine.h"

* Setup the processor ready for the demo.
static void prvSetupHardware( void );

int main( void )
    /* Configure any hardware required for this demo. */

    /* Create the tasks. */
    //xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", mainCHECK_TAKS_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );

    /* Finally start the scheduler. */

    /* Will only reach here if there is insufficient heap available to start
    the scheduler. */
    for (;;);
return 0;

static void prvSetupHardware( void )

Am I missing something or including something that shouldn’t be there?


richard_damon wrote on Monday, July 13, 2009:

Sounds like you have configUSE_IDLE_HOOK set to one, and don’t have the vApplicationIdleHook function defined. If you don’t need the IdleHook function, change configUSE_ILDE_HOOK to 0, if you want to use an IdleHook, you need to define vApplicationIdleHook.

The idle hook gives a good point to put some simple processing that want to run at idle priority without needing to define a task. the IdleHook function can not block, as the Idletask can not block or the kernel crashes with nothing to run. One use I use for the idleHook is to go to sleep mode.

johnbaker70 wrote on Monday, July 13, 2009:

Ah yes. It was right there in front of me and I still missed it. Read the manual, eh?

Thanks very much Richard.