Download GU0111 Using the TSK3000 Embedded Tools
Transcript
Using the C Compiler Select a target processor (core) If you have selected a toolset that supports several processor cores, by means of a Generic device, you need to choose a processor type first. To access the processor options: 1. From the Project menu, select Project Options... The Project Options dialog box appears. 2. Expand the Processor entry and select Processor Definition. 3. In the Select Processor box select a processor type. Processor options affect the invocation of all tools in the toolset. In Altium Designer you only need to set them once. Based on the target processor, the compiler includes a special function register file. This is a regular include file which enables you to use virtual registers that are located in memory. To access the compiler options 1. From the Project menu, select Project Options... The Project Options dialog box appears. 2. Expand the C Compiler entry. 3. Select the sub−entries and set the options in the various pages. The command line variant is shown simultaneously. Invocation syntax on the command line (Windows Command Prompt) The invocation syntax on the command line is: ctarget [ [option]... [file]... ]... The input file must be a C source file (.c or .ic). ctarget can be one of the supported C compilers. For example, c3000 (for the TSK3000). Example: c3000 test.c This compiles the file test.c and generates the file test.src which serves as input for the assembler. 2.3.1 Overview of C Compiler Options You can set the following C compiler options in Altium Designer. Menu entry Command line Build Options Include files path −Idir Processor » Processor Definition Multiply/Divide unit present −−use−hardware=flags,... C Compiler » Code Generation Alignment of composite types −−align−composites=[n|o] Enable allocation in sdata −−sdata=size Allocation in sdata for objects smaller than threshold Select call mode (default: near) −−call=[f|n] C Compiler » Preprocessing Preprocessing: Define macro,value −Dmacro[=value] Include this file before source −Hfile Store the C Compiler preprocess output (file.pre) −E 2−3