[CMake] [Dev] CMake 2.5 tool chain support example

Trevor Kellaway tkellaway at asl-electronics.co.uk
Tue Jun 12 16:21:12 EDT 2007


Alex,

> I had another look at Freescale-chc12.cmake.
> 
> I guess you have different projects using this controller ?

Yes, each system will generally have its own custom link.prm.

> In the file you have the cache variables HC12_LINK_PRM_FILE, 
> HC12_MEMORY_MODEL_LETTER and HC12_CORE. I guess they don't 
> depend on preferences of the users but on how the actual 
> hardware for this project looks like. Does this mean in order 
> to build these projects correctly the user/developer has to 
> adjust these variables manually to the correct values for the 
> target hardware ?

The intention was to provide a default case, which will work for small
programs, but in most cases this will be overridden.

The layout is generally dependent on the software, data and functions
can be placed in custom segments, which are then located based on
link.prm.

The HC12 has fixed on-chip resources, FLASH (typically 64KB to 512KB)
and RAM (8KB to 32KB, yes KB not MB!), so in this case the hardware is
fixed. It can has an optional external address bus, where you can
connect additional FLASH / RAM or peripherals, in this case the memory
map is dependent on the project's hardware.


> If that's the case then IMO this is not ideal, this is what I 
> wanted to go to the Freescale-chc12-hc12.cmake file. But this 
> won't work (without repeating really a lot of code there) if 
> the "processor" file is executed after the "compiler" file, 
> because then the rules-variables will already have been set. 
> How about including the "processor" file before the "compiler" file ?
> Then you could have Freescale-chc12-product1.cmake which 
> would set HC12_CORE etc. as required for this project.

You're right, it would make more sense for Freescale-chc12-hc12.cmake to
be included first, so this could act as an override for defaults in
Freescale-chc12.cmake.

 - TrevK


More information about the CMake mailing list