Project Templates in CCS

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

Introduction

Project Templates are a new feature in CCS4.2 and are used to support the creation of ready-made projects. Templates essentially define the inputs and processes required to create a project for a particular device.

Project templates are enabled through an Eclipse plugin. The template, at a minimum, requires a plugin.xml and manifest.mf file, and can additionally include directories with source files. The plugin manifest file plugin.xml contains bare minimum amount of information to make it an Eclipse plugin and the rest of it is XML that describes the actual template.


Using Templates

Templates are selected as part of the CCS New Project Wizard as shown in the screenshot below. The templates presented to the user are based on matching criteria defined by the templates. When the user selects a template from the list, the plug-in processes the selected template and creates a CCS project with the defined set of source files and build options.

Project Template in New Project Wizard


Example Templates

Example MSP430 and Stellaris templates are attached in this page which give an idea of how such templates can be created. The page also includes details on how to add the template to CCS and test it out.


Example MSP430 Template

The attached zip file contains a simple example template for MSP430. This example only comprises a single source file, hence the source is included with the template and can be packaged and installed as part of the CCS installation.

To understand the template structure, unzip the attached file and open the plugin.xml file.

The XML code describing the template is shown below:

    <extension point="com.ti.common.project.core.projectTemplates">

		<templateSet>
			<applicability>
                <when>
                    <context 
			deviceFamily="MSP430"               
			toolChain="TI"   
			deviceId="MSP430F54*"
                    />
		</when>
			</applicability>
			<template
				name="%msp430x54x_adc12_01_title"
				id="com.ti.msp430.example.ADC12_01.MSP430F54x"
				description="%msp430x54x_adc12_01_description"

				compilerBuildOptions="-vmspx -g --opt_level=2"
				linkerBuildOptions="--heap_size=200"
				postBuildStep="${CG_TOOL_ROOT}/bin/hex${CG_TOOL_SUFFIX}.exe --ti_txt
 ${BuildArtifactFileName} -o ${BuildArtifactFileBaseName}.txt -order MS -romwidth 16">

				<file path="resources/F54x_C_examples/msp430x54x_adc12_01.c"/>
				<group id="com.ti.common.project.core.otherExampleTemplates"/>
				
			</template>

			<template
				name="%msp430x54x_dma_01_title"
				id="com.ti.msp430.example.DMA_01.MSP430F54x"
				description="%msp430x54x_dma_01_description">
				
				<file path="resources/F54x_C_examples/msp430x54x_dma_01.c"/>
				<group id="com.ti.common.project.core.otherExampleTemplates"/>
				
			</template>

		</templateSet>

		<templateSet>
            		<applicability>
                <when>
                    <context
                          deviceFamily="MSP430"
			  toolChain="TI"
		  	  deviceId="MSP430F552*"
                    />
	
               </when>
            		</applicability>
			<template
				name="%msp430x552x_adc_01_title"
				id="com.ti.msp430.example_1"
				description="%msp430x552x_adc_01_description">
				
				<file path="resources/F552x_IAR_CCE_C_Code_Examples/MSP430F552x_adc_01.c"/>
				<group id="com.ti.common.project.core.otherExampleTemplates"/>
			</template>

			<template
				name="%msp430x552x_flashwrite_01_title"
				id="com.ti.msp430.example_2"
				description="%msp430x552x_flashwrite_01_description">
				
				<file path="resources/F552x_IAR_CCE_C_Code_Examples/MSP430F552x_flashwrite_01.c"/>
				<group id="com.ti.common.project.core.otherExampleTemplates"/>
			</template>

		</templateSet>

Testing the MSP430 Template

Project settings in New Project Wizard

MSP430 Project Templates


Example Stellaris Template

The attached zip file contains a example template for Stellaris Cortex M3. Basically it creates a template out of a couple of Stellarisware examples. Due to the size and directory structure of Stellarisware, the resources, in this case, are not copied into the CCS installation path as in the MSP430 example. Instead the plugin is included in the Stellarisware folder itself and CCS is made aware of it.

The XML code describing the template is shown below:

	<extension point="com.ti.common.project.core.projectTemplates">
		<templateSet>
<applicability>
                <when>
                    <context 
						deviceFamily="ARM"               
						toolChain="TI"   
						deviceId="Cortex M.LM3S9B92"
                    />
		</when>
            </applicability>
			<template
				name="%aes_expanded_key_title"
				id="com.ti.stellarisware.example.AES.LM9B92"
				description="%aes_expanded_key_description"
				linkerCommandFile="../../../boards/ek-lm3s9b92/aes_expanded_key/aes_expanded_key_ccs.cmd"
				compilerBuildOptions="-g --diag_warning=225 -me --define=ccs --define=PART_LM3S9B92 --define=TARGET_IS_TEMPEST_RB1 --gen_func_subsections --ual 
--include_path=${SW_ROOT}/boards/ek-lm3s9b92/aes_expanded_key/ccs/.. --include_path=${SW_ROOT}/third_party/aes 
--include_path=${SW_ROOT}/third_party --include_path=${SW_ROOT} 
--include_path=${SW_ROOT}/boards/ek-lm3s9b92/aes_expanded_key/ccs/../.. 
--include_path=${SW_ROOT}/boards/ek-lm3s9b92/aes_expanded_key/ccs/../../../.."
				linkerBuildOptions="-z -m${ProjName}.map --warn_sections -i${CG_TOOL_ROOT}/lib 
-i${CG_TOOL_ROOT}/include --reread_libs --rom_model --library=${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib"
				postBuildStep="${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat 
${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin ${CG_TOOL_ROOT}/bin/ofd470.exe 
${CG_TOOL_ROOT}/bin/hex470.exe ${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe">
				
				<file path="../../../boards/ek-lm3s9b92/aes_expanded_key/aes_iv.c"/>
				<file path="../../../boards/ek-lm3s9b92/aes_expanded_key/aes_expanded_key.c"/>
				<file path="../../../boards/ek-lm3s9b92/aes_expanded_key/startup_ccs.c"/>
				<file path="../../../utils/uartstdio.c" targetDirectory="utils"/>
				<file path="../../../boards/ek-lm3s9b92/drivers/rit128x96x4.c" 
targetDirectory="drivers"/>
				<file path="../../../third_party/aes/aes.c" targetDirectory="third_party/aes" />
				<file path="../../../boards/ek-lm3s9b92/aes_expanded_key/aes_expanded_key_ccs.cmd"/>
				<group id="com.ti.common.project.core.otherExampleTemplates"/>
				
			</template>
		</templateSet>


		<templateSet>
			 <applicability>
                <when>
                    <context 
						deviceFamily="ARM"               
						toolChain="TI"   
						deviceId="Cortex M.LM3S8962"


                    />
				</when>
            </applicability>

			<template
				name="%enet_lwip_title"
				id="com.ti.stellarisware.example.LWIP.LM8962"
				description="%enet_lwip_description"
				linkerCommandFile="../../../boards/ek-lm3s8962/enet_lwip/enet_lwip_ccs.cmd"
				compilerBuildOptions="--include_path=${SW_ROOT}/boards/ek-lm3s8962/enet_lwip 
--include_path=${SW_ROOT}/boards/ek-lm3s8962 --include_path=${SW_ROOT}/third_party 
--include_path=${SW_ROOT}/third_party/lwip-1.3.2/apps --include_path=${SW_ROOT}/third_party/lwip-1.3.2/apps/httpserver_raw 
--include_path=${SW_ROOT} --include_path=${SW_ROOT}/third_party/lwip-1.3.2/src/include 
--include_path=${SW_ROOT}/third_party/lwip-1.3.2/ports/stellaris/include 
--include_path=${SW_ROOT}/third_party/lwip-1.3.2/src/include/ipv4 --include_path=${SW_ROOT}/boards/ek-lm3s8962/drivers 
--include_path=${SW_ROOT}/third_party/fatfs/src"
				linkerBuildOptions="-z -m${ProjName}.map --warn_sections -i${CG_TOOL_ROOT}/lib 
-i${CG_TOOL_ROOT}/include --reread_libs --rom_model --library=${SW_ROOT}/driverlib/ccs/Debug/driverlib.lib"
				postBuildStep="${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat ${BuildArtifactFileName} 
${BuildArtifactFileBaseName}.bin ${CG_TOOL_ROOT}/bin/ofd470.exe ${CG_TOOL_ROOT}/bin/hex470.exe 
${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe">
				
				<file path="../../../boards/ek-lm3s8962/enet_lwip/enet_lwip.c"/>
				<file path="../../../boards/ek-lm3s8962/enet_lwip/lmi_fs.c"/>
				<file path="../../../boards/ek-lm3s8962/enet_lwip/startup_ccs.c"/>
				<file path="../../../utils/locator.c" targetDirectory="utils"/>
				<file path="../../../utils/lwiplib.c" targetDirectory="utils"/>
				<file path="../../../utils/uartstdio.c" targetDirectory="utils"/>
				<file path="../../../utils/ustdlib.c" targetDirectory="utils"/>
				<file path="../../../third_party/lwip-1.3.2/apps/httpserver_raw/httpd.c" 
targetDirectory="third_party/lwip-1.3.2/apps/httpserver_raw" />
				<file path="../../../third_party/fatfs/port/mmc-ek-lm3s8962.c" 
targetDirectory="third_party/fatfs/port" />
				<file path="../../../third_party/fatfs/src/ff.c" targetDirectory="third_party/fatfs/src"/>
				<file path="../../../boards/ek-lm3s8962/drivers/rit128x96x4.c" targetDirectory="drivers" />	
				<file path="../../../boards/ek-lm3s8962/enet_lwip/enet_lwip_ccs.cmd"/>

				<group id="com.ti.common.project.core.otherExampleTemplates"/>
				
			</template>

		</templateSet>

Testing the Stellaris Template

(where C:/Stellarisware is the root folder where Stellarisware is installed)

Creating a new Template

To create a new template, start with one of the attached examples and customize plugin.xml and plugin.properties for your needs. Follow the above procedure to have CCS recognize the template and test out your template.


References

There are several examples of setting up BIOS project templates included in CCS4.2.

For BIOS 5.41.xx examples, take a look at
C:\<ccs42_installdir>\bios_5_41_07_24\eclipse\plugins\com.ti.rtsc.DSPBIOS.product.ui_5.41.7.24\plugin.xml

For BIOS 6.30.xx examples, take a look at
C:\<ccs42_installdir>\bios_6_30_02_42\eclipse\plugins\com.ti.rtsc.SYSBIOS.product.ui_6.30.2.42\plugin.xml

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox