FreeRTOS as static library or ROM

For my project, I need to place FreeRTOS in ROM section and keep rest of the associted application firmware (including tasks) in the program RAM. Currently FreeRTOS ports are compiled with the application firmware. Is there any port or example avaialble which shows how to build FreeRTOS as static library?

To make FreeRTOS a static library, you would just need to provide a STATIC version of FreeRTOSConfig.h, that becomes the only version that all applications that link to it use.

If you do that, you would just need to compile the needed code and link it into a library.

To put it into ROM, you would also need to either eliminate (or provide the implementation of to put in ROM) for all of the Application Call Backs. You could with some effort establish a fixed location to contain a pointer to the call back function (and initialize it to something safe) and let applications that need that overwrite those pointers.

1 Like

I have done this before for SafeRTOS - which was build into the ROM of an LM3S6965 (I think I have that part number right) chip from Luminary Micro, later acquired by TI and rebranded Tivo, if my memory serves. We did that by building the code without stripping out any symbols. Then using the map file to create a header file that mapped function pointers to physical addresses. Basically just a load of #defines in a header file. The application code then included the header file and called the API as normal - the preprocessor then mapping the API calls to the correct addresses in ROM. Worked like a charm, with the added benefit of being able to patch any bugs accidentally burned into ROM by having the patch in the application code and updating the header file to map the buggy API to the version in the application.


Thank you, will try to implement it.