Tool/software: Code Composer Studio
Following on from a suggestion in this forum a couple of years back, I've been playing with some ideas for ensuring a common MSP variant is defined through multiple levels of projects (we build common code for multiple processors). The concept was to remove the specific MSP variant from each projects properties, and use some sort of common include file to provide the specific processor variant.
The model I have been playing with has the following (I'm using the GNU toolchain, but don't think that matters)
- All projects use a "Custom MSP Device", and all properties related to the specific processor (-mmcu etc) are set to null.
- All projects include any compile options from a compiler options file. This can include anything that may vary across processors (-mmcu obviously, but also -mlarge and -code and -mdata regions etc)
- Similarly with the linker command file, which is normally inserted automatically into the properties. This field is set to null, and a generic linker command file inserted into the linker -T options. This generic command file does nothing more than INCLUDE the appropriate linker command file for the processor variant.
- I've located the two include files in a project of their own, which all other projects are dependent on.
- The idea was that any change of processor is simply made in the compile and linker options files, and everything automatically builds with these, but...
I struggled to get the normal projects to detect any changes in the dependent options files. Then (a bit of a stab in the dark) I renamed these to .h's, and everything started to work as expected. I'm guessing that CCS automagically builds the inter project dependencies based on normal C file extensions (.c and .h). While this would work as a workaround, it seems a bit ugly. Is there any easy way to tell CCS that there are dependencies that are not standard C files?
A couple of secondary questions.
- Is what I am doing sensible, or am I likely to trip over or break something in CCS.
- CCS normally imports a copy of the linker command file directly into the project, rather than referencing it from the TI CCS directories. Any idea what the rationale behind this is? It does give the option of tweaking this on a per project basis (or I suppose archiving these as another artifact with production code), but I would have thought these were pretty static?
Thanks for any insights! Andrew