Quality RTOS & Embedded Software

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


IAR tasks.c linker error

Posted by Peter Eisenhower on June 4, 2010
I am using IAR cortex M3 Kick Start to work with the energyMicro EFM32 G290F128.

I am using all the files from the freeRTOS website to start my project. I used the configuration files and source code from that demo and moved it into a project I have been working on.

When I go to build my project I get the following error:

Error[Li005]: no definition for "vApplicationStackOverflowHook" [referenced from C:\repo\Embedded\Energy Micro Sandbox\Telit\Debug\Obj\tasks.o]

I put a #error in the StackMacro.h file to make sure the function was being declared and it is.
What doesnt make sense to me is that a macro is defined in StackMacro.h taskFIRST_CHECK_FOR_STACK_OVERFLOW() and that macro has a function definition and declartion in it (extern void vApplicationStackOverflowHook...). But that macro is then called within another function. I did not think that was even possible.

I can fix this error by pulling out the macro and making it a function in the task.c file but i dont thing that is the correct fix.

If someone undestands this error I would greatly appreciate the help.


RE: IAR tasks.c linker error

Posted by Richard Damon on June 4, 2010
the extern void vApplicationStackOverflowHook in the macro is a function DECLARATION not a DEFINITION. It tells the compiler how to call the function, but not what is in it. FreeRTOS does not include a definition of this function, because it doesn't know what you want to be done once the error occurs. You program needs to provide the definition of this function, which could be as simple as just an infinite loop.

RE: IAR tasks.c linker error

Posted by Peter Eisenhower on June 4, 2010
Fantastic thanks a bunch.

RE: IAR tasks.c linker error

Posted by Peter Eisenhower on June 4, 2010
That fixed it. The only file I did not copy from the demo was main and thats where vApplicationStackOverflowHook was defined.

thanks again,

RE: IAR tasks.c linker error

Posted by Richard on June 4, 2010
Thanks to Richard_Damon for his excellent support - as always.

Anything that starts vApplication is intended for definition by the application code. These are always optional, with settings in FreeRTOSConfig.h being used to either enable or disable the option.


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

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

Latest News

FreeRTOS kernel V10.0.1 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