Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

vApplicationIdleHook and xQueueReceive

Posted by Karsten Klein on January 12, 2009
Hi,
I have the following code:

void vApplicationIdleHook( void )
{

unsigned short temp;
unsigned short queuemessage;

if (xQueueReceive(xQueueExtEepromApl2Idle, &queuemessage, 1))
{
temp = 2;/* for test */
}
else
{
temp = 1; /* for test */
}

The call of the function "xQueueReceive" causes an "Bus Error Data Fetch" - exception.

If i use the same in any other Task, everything seams to be fine.

Is it not possible to use the queues inside the vApplicationIdleHook() ?

Very you very much in advance
Regards
Karsten



}

RE: vApplicationIdleHook and xQueueReceive

Posted by Dave on January 12, 2009
You cannot make a blocking function call in the idle hook. If you change the last parameter to 0 it will work. 0 means don't block to wait for data.

RE: vApplicationIdleHook and xQueueReceive

Posted by Richard Damon on January 12, 2009
The Idle task is not allowed to block.
The Idle hook runs as part of the Idle task

xQueueReceive, unless given a 0 timeout parameter might block, violating the above rule.

If Idle blocks, suddenly there is no task to run and schedule dies.

RE: vApplicationIdleHook and xQueueReceive

Posted by Karsten Klein on January 12, 2009
Ok, I see.
But does it work reliable if the xTicksToWait will be changed to 0 ?


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS