Quality RTOS & Embedded Software

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


prvIdleTask issue (GCC)

Posted by iammrt on November 27, 2009
Hey there,

i want to compile FreeRTOS (v6.0.1) with gcc 4.2.3. I get the Error "prvIdleTask undeclared (first use in function)" in tasks.c line 1027. As i can see there is the implementation of the function as macro in line 1781 where i get the Warning ("return type default to int") and there is the Prototype declaration in line 325 where i get the warning "parameter names without types in function declaration".
Is this a compiler specific problem? I havent touched the Kernel code, so this can only be a problem with the port, an problem with the compiler or a general issue in the OS (what i dont think can be).

Is there someone getting the same error with GCC?

RE: prvIdleTask issue (GCC)

Posted by Richard on November 27, 2009
tasks.c is part of the core code, not the port code, so this is not a port issue as such. Although portTASK_FUNCTION_PROTO and portTASK_FUNCTION, which are used in the prototype and definition of prvIdleTask(), should be defined in portmacro.h which is part of the port layer.

+ Which port are you using? Are these macros in the portmacro.h file you are including?
+ Where did you get your GCC version from, I didn't realise there was a 4.2.3 version.
+ Did you build your GCC exe yourself?

In nearly all ports the macros don't actually do anything and expand to

void prvIdleTask( void *pvParameters );

You could manually change the offending lines to that to get running, but I would be interested to know what the problem is.


RE: prvIdleTask issue (GCC)

Posted by iammrt on November 27, 2009
- I'am using this Port: "FreeRTOS\Source\portable\GCC\ARM_CM3" I think the macros are included in the file, and the header file is included to the build.
- You can find GCC 4.2.3 here http://gcc.gnu.org/gcc-4.2 I know there is 4.4.x allready avaible but the 4.2.x is still working fine for me, and why change it when there is everything working fine.
- Since i'm using openSuse I compiled GCC bymyself, yes.

RE: prvIdleTask issue (GCC)

Posted by Richard on November 27, 2009
Are you sure that version of GCC supports THUMB2 instructions. It might do, but if it does I would guess it was one of the first versions that does. See http://www.codesourcery.com/sgpp/lite/arm/download.html - EABI is the build you want.

I would suggest getting a pre-built version of GCC. You can get the CodeSourcery Lite version for free with a convenient installer. That should compile the code with no problem.

Also, start with a pre-configured makefile, that is what they are there for. You should be able to build the makefile found in the directory FreeRTOS\Demo\CORTEX_LM3Sxxxx_Eclipse\RTOSDemo using the CodeSourcery build without any problems (unless you are using Linux, in which case you may find the occasional case sensitivity problem in file names or include file names). The makefile uses files from the directory you say you are trying to use.


RE: prvIdleTask issue (GCC)

Posted by iammrt on November 30, 2009
Thanks for advice. I installed latest version of GCC and it worked. So the problem was probably the Thumb-2 Support of the 4.2.x Version of GCC. It supports Thumb code for sure, but Thumb-2 not.

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

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

Latest News

Version 10.1.0 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