prvIdleTask issue (GCC)

iammrt wrote on Friday, 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?

rtel wrote on Friday, 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.


iammrt wrote on Friday, 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  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.

rtel wrote on Friday, 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 - 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.


iammrt wrote on Monday, 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.