Quality RTOS & Embedded Software

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


vApplicationIdleHook and xQueueReceive

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

void vApplicationIdleHook( void )

unsigned short temp;
unsigned short queuemessage;

if (xQueueReceive(xQueueExtEepromApl2Idle, &queuemessage, 1))
temp = 2;/* for test */
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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner