usTaskCheckFreeStackSpace undefined?

weinerschizel wrote on Monday, October 27, 2008:

I get an error when trying to compile the "ARM7_AT91SAM7X256_Eclipse" demo.

It states:
Description Resource Path Location    Type …/…/…/Source/tasks.c undefined reference to usTaskCheckFreeStackSpace’    RTOSDemo 1825 C/C++ Problem

Anybody know how to address this error?  I cannot seem to figure out where I went wrong.


weinerschizel wrote on Monday, October 27, 2008:

I went a head and tried all the other Eclipse demos.  They gave me either that same error during compile or couldn’t find the compiler “cs-make”.

I’m assuming the other demos were not for Yagarto.  Still stumped.

cuffia wrote on Monday, October 27, 2008:

I got the same error compiling ARM7_LPC2368_Eclipse:

> make
…/…/…/Source/tasks.o: In function `prvListTaskWithinSingleList’:
…\freertos\Demo\ARM7_LPC2368_Eclipse\RTOSDemo/…/…/…/Source/tasks.c:1825: undefined reference to `usTaskCheckFreeStackSpace’

I think the problem arises in the fact that the function is declared if ONE of the following macros is set to 1:

configUSE_TRACE_FACILITY == 1 || INCLUDE_uxTaskGetStackHighWaterMark == 1

The function is finally defined only if the INCLUDE_uxTaskGetStackHighWaterMark macro is set, but it is used in prvListTaskWithinSingleList, which is defined only if configUSE_TRACE_FACILITY is set.

I cannot test the following fix, but changing line 1835 of tasks.c from

#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )


#if (configUSE_TRACE_FACILITY == 1) || ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )

should fix this issue.

rtel wrote on Wednesday, October 29, 2008:

Somebody opened a bug report on this a couple of days ago.  See

I will try to get this fixed today if possible.


rtel wrote on Wednesday, October 29, 2008:

This is now fixed in SVN and will get incorporated into the next release.


w555 wrote on Wednesday, November 12, 2008:

I tried the fix recommended by cuffia on an LPC2138 board and it worked fine. 
Thanks Cuffia.