Compile "FreeRTOS_library" w...

alejandro79 wrote on Wednesday, July 20, 2011:

Hi, i´d like to compile the project “FreeRTOS_library” into a static library but without the portable layer, i´d like the portable to be part of the project at hand.
I tried it, but couldn´t get the library to build without portmacro.h and port.c. Is there a way around this?
The main benefits would be that i wouldn´t have to touch my project files when there´s a FreeRTOS update and that the same static library would work with different ports without needing it to rebuild.


rtel wrote on Wednesday, July 20, 2011:

Please read then provide more details about what it is you are trying to do.  I can only guess otherwise, and as 27 architectures and 17 development tools are supported, it is highly unlikely I will guess right.


richard_damon wrote on Wednesday, July 20, 2011:

Your should give a bit of thought to what you are trying to do. The main thing that the portable layer provides are the details of how a given processor works. When you compile a static library, you generally need to define which processor you are targeting (at least to the processor family. which is normally most of what the portable layer needs to know).  It is very unlikely that you are going to be able to get a static library that works with many “ports”, unless you are in the habit of changing the resources used by the portable layer  for what timer resource you use, or change the clock frequency you run the system at, and for that you just need to not bundle port.c into the library, and provide it separately.

The other issue you are going to run into is that the FreeRTOS files need the FreeRTOSConfig.h file to define certain resource limits that are compiled into the library. If you want to pre-compile the library, you are going to need to lock down the values/options specified therein.