I am using one of the NXP MIMXRT1062EVK to work with FreeRTOS.
Unfortunately, I found out that there are a lot of troubles using the FreeRTOS. Anyway, I will post more questions regarding the other matters in another topic. But, first, I could not figure out why vApplicationIdleHook function was not able to work at all in my code.
- In the FreeRTOSConfig.h:
#define configUSE_PREEMPTION 1
#define configUSE_TICKLESS_IDLE 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_IDLE_HOOK 1
- In the main.c
void vApplicationIdleHook(void)
{
PRINTF(“IdleHook is working\r\n”);
}
- In the tasks.c (Original code)
static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
…
#if ( configUSE_IDLE_HOOK == 1 )
{
extern void vApplicationIdleHook( void );
/* Call the user defined function from within the idle task. This
* allows the application designer to add background functionality
* without the overhead of a separate task.
* NOTE: vApplicationIdleHook() MUST NOT, UNDER ANY CIRCUMSTANCES,
* CALL A FUNCTION THAT MIGHT BLOCK. */
vApplicationIdleHook();
}
#endif /* configUSE_IDLE_HOOK */
…
}
This is rather straightforward code but, I have no idea why this is not working at all.
I am checking the other tasks running and I noticed I have put all the tasks around 10mins delay interval and I was think if the IdleHook will be able to call but I did not get any response at all (the breakpoint is not trigger at all).
Can any FreeRTOS experts let me know if I have missed out/set wrongly on any settings in order for me to trigger the ApplicationIdleHook functions?
Thanks.