Tool/software: Code Composer Studio
I am designing a library and I am willing to take advantage of RTSC system to make the code and board-specific configuration seperate. Then one piece of code can be used with different configuration.
Here are what I've planned:
- The board-specific configuration is comprised of reference clock rate, physical ram size, and other hardware stuff.
- Each board corresponds to a RTSC platform, then I got several platform packages.
- Each platform package is custom-made, but all packages have their Platform module that inherits xdc's IPlatform, so I can switch platforms in CCS projects.
- The code, especially the driver code, should not know about the platform-specific details. They may fetch platform information from a unified interface and header file.
- There are information that needs to be transferred from configuration object model to runtime environment. So I guess the RTSC Module is a must.
- But I also want to get full control of source file and header file. So I only use metaonly modules to get rid of the generated long header file by xdc. Then I have to use xdc template to generate runtime codes.
- As the user can change settings in ".cfg" file, then I cannot pre-compile and archive the codes generated by xdc template.
- So I have call genFile() in module's module$use() method, which is called after user configuration file is parsed.
- Besides, my custom codes are all written in c++.
But the problem comes, how can I make the generated codes added to CCS projects and make them compiled & linked with project code files?