I am new in FreeRTOS and currently trying to implement my first project. I have followed the basic guidelines about the files tree setup, but when compiling I get an error that seems to be associated with the linker. Specifically, despite of including the “task.h” file, as well as it being part of the project, for some reason the xTaskCreate() function is not recognized. The question is, there is any specific library that need to be added to the linker path? I am using the latest version of CCS v12 (TI) and the target is the Tiva C’s TM4C123GH6PM processor.
I had this same problem before. It was resolved by including a CCS library in the search path for the linker. But I am not aware of a similar type of file for FreeRTOS, beyond the sources and headers in the package, which are included as seen above.
It’s probably not the problem, because when the #include “task.h” line is commented out, the implicit error message appears, which shows the compilation reads this file.
Sorry that I missed this figure.
Could you help to check if all source files are compiled in your project?
From the figure, these source files in FreeRTOS/Source are under includes folder.
I’m not sure if they’re compiled in this IDE.
I guess the IDE / the generated project doesn’t compile the FreeRTOS sources like task.c because they are added as ‘Includes’ ? Is there a ‘Source’ node where you can add the source files ? It should be documented for this IDE howto setup a project correctly.
You can verify the Build output to see which files are compiled.
(BTW better post text as text. Code blocks quoted by enclosing it by 3 tildes ‘~’ or backticks ‘`‘.)
You can put some non-compilable code in tasks.c and see if you get the compilation error from that. This will verify if you are compiling tasks.c and other FreeRTOS source files. As others have suggested, you likely are not compiling them.
Wow interesting, I took care of the paths to each relevant folder and expected the compiler and the linker to freely access the necessary files. Did so to keep the original tree that FreeRTOS comes with so nothing is missed. There is any other way? Should I put all the relevant files in a single folder, maybe the same folder where the “main” function is?
I commented out all the included files in tasks.c and had no effect in the compilation (the same error as before), so is likely this file is being ignored.
I bet there is a way to organize the project tree in your IDE to have 1 ore more tree nodes containing Source files (getting compiled on build ). This should be documented somewhere.
But as a first step you can probably add all source files plain in the project tree root where your main.c is located.
I am not familiar with CCS, but most tools allow you to define a list of SOURCE file locations to compile.
Often, I will just start with one common directory and make an “application” sub-folder, and a “library” sub-folder, and put all the various libraries I am using as sub-folders to library. For FreeRTOS, to do this do NOT copy the full repositiory with all the demo and portable files, but only those that you will be using.