Embedded IDE Link™ CC 3 User’s Guide
How to Contact The MathWorks Web Newsgroup www.mathworks.com/contact_TS.html Technical Support www.mathworks.com comp.soft-sys.matlab suggest@mathworks.com bugs@mathworks.com doc@mathworks.com service@mathworks.com info@mathworks.com Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information 508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc.
Revision History July 2002 October 2002 May 2003 September 2003 June 2004 October 2004 December 2004 March 2005 September 2005 March 2006 April 2006 September 2006 March 2007 September 2007 March 2008 October 2008 March 2009 Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only Online only New for Version 1.0 (Release 13) Revised for Version 1.1 Revised for Version 1.
Contents Getting Started 1 Product Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Components of Embedded IDE Link CC Software . . . . . . . Automation Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Project Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Product Features Supported for Each Processor Family . .
Constructing ticcs Objects . . . . . . . . . . . . . . . . . . . . . . . . . . Example — Constructor for ticcs Objects . . . . . . . . . . . . . . 2-46 2-46 ticcs Properties and Property Values . . . . . . . . . . . . . . . . 2-48 Overloaded Functions for ticcs Objects . . . . . . . . . . . . . . 2-49 ticcs Object Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quick Reference to ticcs Object Properties . . . . . . . . . . . . . Details About ticcs Object Properties . . . . . . .
Setting Code Generation Parameters for TI Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-48 Setting Model Configuration Parameters . . . . . . . . . . . . Target File Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Build Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Custom Storage Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Report Options . . . . . . . . . . . . . . . . . . . . . . .
Verification 4 What Is Verification? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 Using Processor in the Loop . . . . . . . . . . . . . . . . . . . . . . . . Processor-in-the-Loop Overview . . . . . . . . . . . . . . . . . . . . . . PIL Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PIL Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating and Using PIL Blocks . . . . . . . . . . . . . . . . . . . . . .
Preventing Memory Corruption When You Export Coefficients to Processor Memory . . . . . . . . . . . . . . . . . Allocating Sufficient or Extra Memory for Filter Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example: Using the Exported Header File to Allocate Extra Processor Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replacing Existing Coefficients in Memory with Updated Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Core Support (ccslinklib_core) . . . . . . . . . . . . . . . . . . . . . . 8-3 Target Preferences (ccslinklib_tgtpref) . . . . . . . . . . . . . . 8-3 Blocks — Alphabetical List 9 Embedded IDE Link CC Configuration Parameters 10 Embedded IDE Link CC Pane . . . . . . . . . . . . . . . . . . . . . . . Embedded IDE Link CC Overview . . . . . . . . . . . . . . . . . . . Export IDE link handle to base workspace . . . . . . . . . . . . . IDE link handle name . . . . . . . . . . . . . . . . . . . . . . . . .
Supported Hardware A Supported Platforms for Embedded IDE Link CC . . . . . Supported Hardware and Simulators . . . . . . . . . . . . . . . . . Product Features Supported by Each Processor or Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OMAP Coemulation Support . . . . . . . . . . . . . . . . . . . . . . . . Custom Hardware Support . . . . . . . . . . . . . . . . . . . . . . . . . . A-2 A-2 Supported Versions of Code Composer Studio . . . . . . . .
Using Mapped Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Getting Started • “Product Overview” on page 1-2 • “Configuration Information” on page 1-6 • “Requirements for Embedded IDE Link CC Software” on page 1-10
1 Getting Started Product Overview In this section... “Components of Embedded IDE Link CC Software” on page 1-3 “Automation Interface” on page 1-3 “Project Generator” on page 1-4 “Verification” on page 1-5 “Product Features Supported for Each Processor Family” on page 1-5 Embedded IDE Link™ CC software enables you to use MATLAB® functions to communicate with Code Composer Studio™ software and with information stored in memory and registers on a processor.
Product Overview Embedded IDE Link CC consists of these components: • Project Generator—generate C code from Simulink models • Automation Interface—use functions in the MATLAB command window to access and manipulate data and files in the IDE and on the processor • Verification—verify how your programs run on your processor With Embedded IDE Link CC, you create objects that connect MATLAB software to Code Composer Studio software.
1 Getting Started • Automate project creation, including adding source files, include paths, and preprocessor defines. • Configure batch building of projects. • Debug projects and code. • Execute API Library commands. The automation interface provides an application program interface (API) between MATLAB software and Code Composer Studio. Using the API, you can create new projects, open projects, transfer data to and from memory on the processor, add files to projects, and debug your code.
Product Overview • Highly customized code generation with the system target file ccslink_ert.tlc and ccslink_grt.tlc that enable you to use the Configuration Parameters in your model to customize your generated code. • Automate the process of building and downloading your code to the processor, and running the process on your hardware. Verification Verifying your processes and algorithms is an essential part of developing applications.
1 Getting Started Configuration Information To determine whether Embedded IDE Link CC is installed on your system, type this command at the MATLAB software prompt. ver When you enter this command, MATLAB software displays a list of the installed products. Look for a line similar to the following: Embedded IDE Link CC Version 3.
Configuration Information ccsdebug/display - Display properties of a TICCS object. ccsdebug/halt - Immediately terminate execution of the processor. ccsdebug/info - Return information about the processor. ccsdebug/insert - Add a debug point into CCS. ccsdebug/isreadable - Check if the specified memory block can be read. ccsdebug/isrtdxcapable - Check if the processor has RTDX capability. ccsdebug/isrunning - Check if the processor is executing.
1 Getting Started If you do not see the listing, or MATLAB software does not recognize the command, you need to install Embedded IDE Link CC. Without the software, you cannot use MATLAB software with the objects to communicate with CCS. Note For up-to-date information about system requirements, refer to the Embedded IDE Link CC system requirements page, available in the products area at the MathWorks Web site (http://www.mathworks.com).
Configuration Information • Connections to the RTDX™ (RTDX) interface. This object is a subset of the object that refers to the CCS IDE. Concepts to know about the objects in this toolbox are covered in these sections: • Constructing Objects • Properties and Property Values • Overloaded Functions for Links Refer to MATLAB Classes and Objects in your MATLAB documentation for more details on object-oriented programming in MATLAB software.
1 Getting Started Requirements for Embedded IDE Link CC Software For detailed information about the software and hardware required to use Embedded IDE Link CC software, refer to the Embedded IDE Link CC system requirements area for the product on the MathWorks Web site—http://www.mathworks.com. For information about the hardware that the software supports, refer to the Embedded IDE Link CC supported hardware area for the product on the MathWorks Web site—http://www.mathworks.com.
2 Automation Interface • “Getting Started with Automation Interface” on page 2-2 • “Getting Started with RTDX” on page 2-21 • “Constructing ticcs Objects” on page 2-46 • “ticcs Properties and Property Values” on page 2-48 • “Overloaded Functions for ticcs Objects” on page 2-49 • “ticcs Object Properties” on page 2-50 • “Managing Custom Data Types with the Data Type Manager” on page 2-58
2 Automation Interface Getting Started with Automation Interface In this section...
Getting Started with Automation Interface 1 Select your processor. 2 Create and query objects to CCS IDE. 3 Use MATLAB software to load files into CCS IDE. 4 Work with your CCS IDE project from MATLAB software. 5 Close the connections you opened to CCS IDE. The tutorial provides a working process (a workflow) for using Embedded IDE Link CC and your signal processing programs to develop programs for a range of Texas Instruments™ processors.
2 Automation Interface Function Description clear Remove a specific object to CCS IDE or remove all existing objects. ticcs Construct an object to communicate with CCS IDE. When you construct the object you specify the processor board and processor.
Getting Started with Automation Interface Method Description run Execute the program loaded on the processor. visible Set whether CCS IDE window is visible on the desktop while CCS IDE is running. write Write data to memory on the processor.
2 Automation Interface Running Code Composer Studio Software on Your Desktop — Visibility When you create a ticcs object , Embedded IDE Link CC starts CCS in the background. When CCS IDE is running in the background, it does not appear on your desktop, in your task bar, or on the Applications page in the Task Manager. It does appear as a process, cc_app.exe, on the Processes tab in Microsoft® Windows Task Manager. You can make the CCS IDE visible with the function visible.
Getting Started with Automation Interface To run the tutorial in MATLAB software, click run ccstutorial. This command opens the tutorial in an interactive mode where the tutorial program provides prompts and text descriptions to which you respond to move to the next portion of the lesson. The interactive tutorial covers the same information provided by the following tutorial sections. You can view the tutorial M-file used here by clicking ccstutorial.m.
2 Automation Interface 3 Select a board name and processor name from the lists. You are selecting a board and processor number that identifies your particular processor. When you create the object for CCS IDE in the next section of this tutorial, the selected board and processor become the processor of the object. 4 Click Done to accept your board and processor selection and close the dialog box.
Getting Started with Automation Interface 1 Create an object that refers to your selected board and processor. Enter the following command at the prompt. cc=ticcs('boardnum',boardnum,'procnum',procnum) If you were to watch closely, and your machine is not too fast, you see Code Composer Studio software appear briefly when you call ticcs. If CCS IDE was not running before you created the new object, CCS starts and runs in the background.
2 Automation Interface 4 Type linkinfo = info(cc).
Getting Started with Automation Interface In this part of the tutorial, you load the executable code for the processor CPU in CCS IDE. Embedded IDE Link CC includes a CCS project file. Through the next tasks in the tutorial, you locate the tutorial project file and load it into CCS IDE. The open method directs CCS to load a project file or workspace file. Note CCS has workspace and workspace files that are different from the MATLAB workspace files and workspace. Remember to monitor both workspaces.
2 Automation Interface C:\Temp\LinkForCCSDemos_v3.2\ccstutorial\c6x\c67x\ccstut.pjt demoPjt.DemoDir ans = C:\Temp\LinkForCCSDemos_v3.2\ccstutorial\c6x\c67x Your paths may be different if you use a different processor. Note where the software stored the demo files on your machine. In general, Embedded IDE Link CC software stores the demo project files in LinkforCCS_vproduct_version Embedded IDE Link CC creates this directory in a location where you have write permission.
Getting Started with Automation Interface 4 To determine the memory address of the global symbol ddat, enter the following command at the prompt: ddata = address(cc,'ddat') ddata = 1.0e+009 * 2.1475 0 Your values for ddata may be different depending on your processor. Note The symbol table is available after you load the program file into the processor, not after you build a program file.
2 Automation Interface ccstut.c has two global data arrays — ddat and idat — that you declare and initialize in the source code. You use the functions read and write to access these processor memory arrays from MATLAB software. Embedded IDE Link CC provides three functions to control processor execution — run, halt, and restart. 1 To demonstrate these commands, use the following function to add a breakpoint to line 64 of cctut.c. insert(cc,'cctut.
Getting Started with Automation Interface a Enter ddatv = read(cc,address(cc,'ddat'),'double',4). MATLAB software responds with ddatv = 16.3000 -2.1300 5.1000 11.8000 b Enter idatv = read(cc,address(cc,'idat'),'int16',4). Now MATLAB software responds idatv = -1 508 647 7000 If you used 8-bit integers (int8), the returned values would be incorrect.
2 Automation Interface The Stdout tab in CCS IDE reveals that ddat and idat contain new values. Next, read those new values back into MATLAB software. f Enter ddatv = read(cc,address(cc,'ddat'),'double',4). ddatv = 3.1416 12.3000 0.3679 0.7071 ddatv contains the values you wrote in step c. g Verify that the change to idatv occurred by entering the following command at the prompt: idatv = read(cc,address(cc,'idat'),'int16',4) MATLAB software returns the new values for idatv.
Getting Started with Automation Interface -1 508 647 7000 If you used 8-bit integers (int8), the returned values would be incorrect. idatv=read(cc,address(cc,'idat'),'int8',4) idatv = 1 0 -4 1 c Change the values stored in ddat by entering write(cc,address(cc,'ddat'),double([pi 12.3 exp(-1)... sin(pi/4)])) The double argument directs MATLAB software to write the values to the processor as double-precision data.
2 Automation Interface MATLAB software returns the new values for idatv. idatv = 1 2 3 4 h Use restart to reset the program counter for your program to the beginning. Enter the following command at the prompt: restart(cc); 4 Embedded IDE Link CC offers more functions for reading and writing data to your processor. These functions let you read and write data to the processor registers: regread and regwrite. They let you change variable values on the processor in real time.
Getting Started with Automation Interface c Verify that the PC register contains the value you wrote. cc.regread('PC','binary') C6xxx processor family — regread and regwrite let you access the processor registers directly. Enter the following commands to get data into and out of the A0 and B2 registers on your processor. a To retrieve the value in register A0 and store it in a variable in your MATLAB workspace. Enter the following command: treg = cc.
2 Automation Interface during the tutorial, the tutorial program executes the following command at the prompt: clear cvar cfield uintcvar This tutorial also closes the project in CCS with the following command: close(cc,projfile,'project') To delete your link to CCS, enter clear cc at the prompt. Your development tutorial using Code Composer Studio IDE is done. During the tutorial you 1 Selected your processor. 2 Created and queried links to CCS IDE to get information about the link and the processor.
Getting Started with RTDX™ Getting Started with RTDX In this section... “Introducing the Tutorial for Using RTDX” on page 2-22 “Creating the ticcs Objects” on page 2-27 “Configuring Communications Channels” on page 2-30 “Running the Application” on page 2-32 “Closing the Connections and Channels or Cleaning Up” on page 2-39 “Listing the Functions in Embedded IDE Link CC software” on page 2-43 Support for using RTDX with C5000 and C6000 processors will be removed in a future release.
2 Automation Interface hardware simulator in CCS IDE to run this tutorial. The tutorial uses the TMS320C6711 DSK as the board, with the C6711 DSP as the processor. After you complete the tutorial, either in the demonstration form or by entering the functions along with this text, you are ready to begin using RTDX with your applications and hardware.
Getting Started with RTDX™ Functions From Objects for CCS IDE Function Description ticcs Create connections to CCS IDE and RTDX. cd Change your CCS IDE working directory from MATLAB software. open Load program files in CCS IDE. run Run processes on the processor. Functions From the RTDX Class Function Description close Close the RTDX links between MATLAB software and your processor. configure Determine how many channel buffers to use and set the size of each buffer.
2 Automation Interface Function Description isreadable Determine whether MATLAB software can read the specified memory location. iswritable Determine whether MATLAB software can write to the processor. msgcount Determine how many messages are waiting in a channel queue. open Open channels in RTDX. readmat Read data matrices from the processor into MATLAB software as an array. readmsg Read one or more messages from a channel. writemsg Write messages to the processor over a channel.
Getting Started with RTDX™ Creating the links in Task 1 did not open communications to the processor. With the links in place, you open as many channels as you need to support the data transfer for your development work. This task includes configuring channel buffers to hold data when the data rate from the processor exceeds the rate at which MATLAB software can capture the data. 3 Run your application on the processor. You use MATLAB software to investigate the results of your running process.
2 Automation Interface Note To be able to open and enable channels over a link to RTDX, the program loaded on your processor must include functions or code that define the channels. Your C source code might look something like this to create two channels, one to write and one to read. rtdx_CreateInputChannel(ichan); % processor reads from this. rtdx_CreateOutputChannel(ochan); % processor writes to this. These are the entries we use in int16.c (the source code that generates rtdxtutorial_6xevm.
Getting Started with RTDX™ rx = cc.rtdx; Creating the ticcs Objects With your processing model converted to an executable suitable for your desired processor, you are ready to use the objects to test and run your model on your processor.
2 Automation Interface cc=ticcs('boardnum',0); boardnum defines which board the new link accesses. In this example, boardnum is 0. Embedded IDE Link CC connects the link to the first, and in this case only, processor on the board. To find the boardnum and procnum values for the boards and simulators on your system, use ccsboardinfo.
Getting Started with RTDX™ % Go to processor directory cd(cc,processor_dir);cd(cc,tgt_dir); % Or cc.cd(tgt_dir) dir(cc); % Or cc.dir To load the appropriate project file to your processor, enter the following commands at the MATLAB software prompt. getDemoProject is a specialized function for loading Embedded IDE Link CC demo files. It is not supported as a standard Embedded IDE Link CC function.
2 Automation Interface Notice where the demo files are stored on your machine. In general, Embedded IDE Link CC software stores the demo project files in LinkforCCS_vproduct_version For example, if you are using version 3.2 of Embedded IDE Link CC software, the project demos are stored in LinkforCCS_v3.2\. Embedded IDE Link CC software creates this directory in a location on your machine where you have write permission.
Getting Started with RTDX™ a string that does not identify an existing channel in the executable, the open operation fails. In this tutorial, two channels exist on the processor — ichan and ochan. Although the channels are named ichan for input channel and ochan for output channel, neither channel is configured for input or output until you configure them from MATLAB software or CCS IDE. You could configure ichan as the output channel and ochan as the input channel. The links would work just the same.
2 Automation Interface cc.rtdx.enable; You could do this step before you configure the channels — the order does not matter. 6 Reset the global time-out to 20s to provide a little room for error. ticcs applies a default timeout value of 10s. In some cases this may not be enough. cc.rtdx.get('timeout') ans = 10 cc.rtdx.set('timeout', 20); % Reset timeout = 20 seconds 7 Check that the timeout property value is now 20s and that your object has the correct configuration for the rest of the tutorial. cc.
Getting Started with RTDX™ Restarting the processor does not start the program executing. You use run to start program execution. 2 Type cc.run('run'); Using ’run’ for the run mode tells the processor to continue to execute the loaded program continuously until it receives a halt directive. In this mode, control returns to MATLAB software so you can work in MATLAB software while the program runs.
2 Automation Interface and exit the program, or respond in some way. When you are writing or reading data to your processor in a script or M-file, checking the status of the channels can help you avoid errors during execution. As your application runs you may find it helpful to display progress messages. In this case, the program directed MATLAB software to print a message as it reads the data from the processor by adding the function disp('writing to processor...') Function cc.rtdx.
Getting Started with RTDX™ num_of_msgs should be zero. Using this process to check the amount of data can make your reads more reliable by letting you or your program know how much data to expect. 6 Type the following to verify that your read channel ochan is enabled for communications. cc.rtdx.isenabled('ochan') You should get back ans = 0 — you have not enabled the channel yet. 7 Now enable and verify ’ochan’. cc.rtdx.enable('ochan'); cc.rtdx.
2 Automation Interface 2 3 4 5 6 7 8 9 10 11 Notice the ’int16’ represent option. When you read data from your processor you need to tell MATLAB software the data type you are reading. You wrote the data in step 4 as 16-bit integers so you use the same data type here. While performing reads and writes, your process continues to run. You did not need to stop the processor to get the data or send the data, unlike using most debuggers and breakpoints in your code.
Getting Started with RTDX™ To specify the number of messages to read and the data format in your workspace, you used the siz and nummsgs options set to [2 5] and 2. 14 You can look at both matrices in outdata by dereferencing the cell array again. outdata{1,:} ans = 6 8 10 12 14 7 9 11 13 15 ans = 7 9 11 13 15 8 10 12 14 16 15 For a change, read a message from the queue into a column vector. outdata = cc.rtdx.
2 Automation Interface 12 17 13 18 Because a 5-by-2 matrix requires ten elements, MATLAB software reads one message into outdata to fill the matrix. 17 To check your progress, see how many messages remain in the queue. You have read eight messages from the queue so 12 should remain. num_of_msgs = cc.rtdx.msgcount('ochan') num_of_msgs = 12 18 To demonstrate the connection between messages and a matrix in MATLAB software, read data from 'ochan' to fill a 4-by-5 matrix in your workspace. outdata = cc.
Getting Started with RTDX™ 15 16 14 18 19 16 17 18 19 20 17 18 19 20 21 18 19 20 21 22 19 20 21 22 23 20 21 22 23 24 21 22 23 24 25 21 Recheck the number of messages in the queue to see that five remain. 22 flush lets you remove messages from the queue without reading them. Data in the message you remove is lost. Use flush to remove the next message in the read queue. Then check the waiting message count. cc.rtdx.flush('ochan',1) num_of_msgs = cc.rtdx.
2 Automation Interface We use four functions in this section; each has a purpose — the operational details in the following list explain how and why we use each one. They are • clear — remove all RTDX objects and handles associated with a CCS and RTDX link. When you finish a session with RTDX, clear removes all traces of the specified link, or all links when you use the ’all’ option in the syntax. When you clear one or more links, they no longer exist and cannot be reopened or used.
Getting Started with RTDX™ Your processor may already be stopped at this point. In a script, you might put the function in an if-statement as we have done here. Consider this test to be a safety check. No harm comes to the processor if it is already stopped when you tell it to stop. When you direct a stopped processor to halt, the function returns immediately. 2 You have stopped the processor. Now disable the RTDX channels you opened to communicate with the processor. cc.rtdx.
2 Automation Interface The following if statement checks the CCS IDE visibility and changes it if needed. if cc.isvisible, cc.visible(1); end Visibility can cause problems. When CCS IDE is running invisibly on your desktop, do not use clear all to remove your links for CCS IDE and RTDX. Without a ticcs object that references the CCS IDE you cannot access CCS IDE to change the visibility setting, or close the application.
Getting Started with RTDX™ Instruments processors. While the processor may change, the essentials of the process remain the same. Listing the Functions in Embedded IDE Link CC software To review a complete list of functions and methods that operate with ticcs objects, either CCS IDE or RTDX, enter either of the following commands at the prompt.
2 Automation Interface boardnum. On boards with more than one processor, use this value to specify the processor on the board. On boards with one processor, use the default property value 0 to specify the processor. This value is read-only after you create the object. * 'timeout' - the maximum period (in seconds) that a TICCS method waits for a processor operation to complete (e.g. load). If this time is exceeded, a time-out error is thrown. The default value is 10 seconds.
Getting Started with RTDX™ PROFILE Return execution and stack profile report READ Return a block of data from the memory of the processor REGREAD Return data stored in a processor register REGWRITE Modify the contents of a processor register RELOAD Reload most recently loaded program file REMOVE Remove a file from a project or a debug point from memory RESET Reset the processor RESTART Return PC to the beginning of a program RUN Initiate execution of the processor SAVE Save the changes m
2 Automation Interface Constructing ticcs Objects When you create a connection to CCS IDE using the ticcs command, you are creating a “ticcs object for accessing the CCS IDE and RTDX interface”. The ticcs object implementation relies on MATLAB software object-oriented programming capabilities. The discussions in this section apply to the ticcs objects in Embedded IDE Link CC. Like other MATLAB software structures, objects in Embedded IDE Link CC have predefined fields called object properties.
Constructing ticcs Objects RTDX channels : 0 Inspecting the output reveals two objects listed—a CCS IDE object and an RTDX object. CCS IDE and RTDX objects cannot be created separately. By design they maintain a member class relationship; the RTDX object is a class, a member of the CCS object class. In this example, cc is an instance of the class CCS. If you enter rx = cc.rtdx rx is a handle to the RTDX portion of the CCS object. As an alias, rx replaces cc.
2 Automation Interface ticcs Properties and Property Values Objects in Embedded IDE Link CC software have properties associated with them. Each property is assigned a value. You can set the values of most properties, either when you create the link or by changing the property value later. However, some properties have read-only values. And a few property values, such as the board number and the processor to which the link attaches, become read-only after you create the object.
Overloaded Functions for ticcs Objects Overloaded Functions for ticcs Objects Several functions in this Embedded IDE Link CC have the same name as functions in other MathWorks toolboxes or in MATLAB software. These behave similarly to their original counterparts, but you apply these functions directly to an object. This concept of having functions with the same name operate on different types of objects (or on data) is called overloading of functions.
2 Automation Interface ticcs Object Properties In this section... “Quick Reference to ticcs Object Properties” on page 2-50 “Details About ticcs Object Properties” on page 2-52 Embedded IDE Link CC provides an interface to your processor hardware so you can communicate with processors for which you are developing systems and algorithms. Each ticcs object comprises two objects—a CCS IDE object and an RTDX interface object. The objects are not separable; the RTDX object is a subclass of the CCS IDE object.
ticcs Object Properties Property Name Applies to Which Connection? User Settable? apiversion CCS IDE No Reports the version number of your CCS API. boardnum CCS IDE Yes/initially Specifies the index number of a board that CCS IDE recognizes. ccsappexe CCS IDE No Specifies the path to the CCS IDE executable. Read-only property. No Contains the number of open RTDX channels for a specific link.
2 Automation Interface Details About ticcs Object Properties To use the links for CCS IDE and RTDX interface you set values for: • boardnum — specify the board with which the link communicates. • procnum — specify the processor on the board. If the board has multiple processors, procnum identifies the processor to use. • timeout — specify the global timeout value. (Optional. Default is 10s.
ticcs Object Properties Note that the API version is not the same as the CCS IDE version. boardnum Property boardnum identifies the board referenced by a link for CCS IDE. When you create a link, you use boardnum to specify the board you are using. To get the value for boardnum, use ccsboardinfo or the CCS Setup utility from Texas Instruments software. The CCS Setup utility assigns the number for each board installed on your system.
2 Automation Interface rx=cc.rtdx RTDX channels : 0 open(rx,'ichan','r','ochan','w'); get(cc.rtdx) ans = numChannels: Rtdx: RtdxChannel: procType: timeout: 2 [1x1 COM ] {'' '' ''} 103 10 page Property page contains the default value CCS IDE uses when the user does not specify the page input argument in the syntax for a function that access memory. procnum Property procnum identifies the processor referenced by a link for CCS IDE.
ticcs Object Properties rtdx Property rtdx is a subclass of the ticcs link and represents the RTDX portion of a link for CCS IDE. As shown in the example, rtdx has properties of its own that you can set, such as timeout, and that report various states of the link. get(cc.rtdx) ans = version: numChannels: Rtdx: RtdxChannel: procType: timeout: 1 0 [1x1 COM ] {'' [] ''} 103 10 In addition, you can create an alias to the rtdx portion of a link, as shown in this code example. rx=cc.
2 Automation Interface rtdxchannel Property rtdxchannel, along with numchannels and proctype, is a read-only property for the RTDX portion of a link for CCS IDE. To see the value of this property, use get with the link. Neither set nor invoke work with rtdxchannel. rtdxchannel is a cell array that contains the channel name, handle, and mode for each open channel for the link. For each open channel, rtdxchannel contains three fields, as follows: .
ticcs Object Properties get(rx) % rx is an alias for cc.rtdx.
2 Automation Interface Managing Custom Data Types with the Data Type Manager Using custom data types, called typedefs (using the C keyword typedef), is one of the complications you encounter when you use hardware-in-the-loop (HIL) to run a function in your project from MATLAB.
Managing Custom Data Types with the Data Type Manager at the MATLAB command line opens the DTM, with the Data Type Manager dialog box shown here: When the DTM opens, a variety of information and options displays in the Data Type Manager dialog box: • Typedef name (Equivalent data type) — provides a list of default data types. When you create a typedef, you see it added to this list.
2 Automation Interface when you pass the cc object to the DTM, and then add a typedef, the command cc.type returns the list of data types in the type property of your cc object, including the typedefs you added. • Remove typedef — removes a selected typedef from the Typedef name (Equivalent data type) list. • Load session — loads a previously saved session so you can use the typedefs you defined earlier without reentering them. • Refresh list — updates the list in Typedefs name (Equivalent data type).
Managing Custom Data Types with the Data Type Manager Each custom type definition added in the DTM becomes part of the ticcs object passed to the DTM in datatypemanager(objectname). The list of data types in the object, both default and custom, is available by entering objectname.type at the command prompt. The same list appears in the DTM on the Typedef name (Equivalent data type) MATLAB uses the type definitions when you run a function residing on your processor from MATLAB.
2 Automation Interface • Typedefs that use pointers or typedefs in the type definition To define custom data types that use structs, enums, or unions from a project, the project must be loaded on the processor before you add the custom type definitions. Either load the project and .out file before you start the DTM, or use the Load Program option in the DTM to load the .out file. Note After a successful load process, you see the name of the file you loaded in Loaded program.
Managing Custom Data Types with the Data Type Manager 2-63
2 Automation Interface 4 Click Add typedef to add your first custom data type. The List of Known Data Types dialog box appears as shown. Add a MATLAB type definition. 5 In Typedef, enter the name of the typedef as you defined it in your code. For this example, use typedef1_matlab.
Managing Custom Data Types with the Data Type Manager 6 Select an appropriate MATLAB data type from the MATLAB Types in Known Types. uint16 is the choice. Choose the data type that best represents the data type in your code. 7 Click OK to close the dialog box and add the new type definition to the Typedef name list. Add an enumerated type definition. 8 Click Add Typedef. 9 From the Known Types list, select Struct, Enum, Union Types.
2 Automation Interface 11 From the Struct, Enum, Union Types list, select the appropriate enumerated data type to use with typedef_enum. The enum_TAG_myEnum choice fills the enumerated type chosen. 12 Click OK to close the dialog box and add typedef_enum to your defined types that MATLAB software recognizes. Add a structure typedef. 13 Click Add Typedef. 14 From the Known Types list, select Struct, Enum, Union Types. 15 To define your type definition, give it a name in Typedef, such as typedef_struct.
Managing Custom Data Types with the Data Type Manager After you close the dialog box, the Typedef name list in the Data Type Manager looks like this. To check the data types in the cc object, enter cc.type which returns Defined types : Void, Float, Double, Long, Int, Short, Char, typedef1_matlab, typedef_enum, typedef struct If your function declaration uses any of the types listed by cc.type, MATLAB software can interpret the data correctly.
2 Automation Interface Clicking Close in the DTM prompts you to save your session. Saving the session creates an M-file that contains operations that create your final list of data types, identical to the data types in the Typedef name list. The first line of the M-file is a function definition, where the name of the function is the filename of the session you saved.
3 Project Generator • “Introducing Project Generator” on page 3-2 • “Project Generation and Board Selection” on page 3-3 • “About the CCSLinkLib Blockset” on page 3-5 • “Schedulers and Timing” on page 3-12 • “Project Generator Tutorial” on page 3-39 • “Setting Code Generation Parameters for TI Processors” on page 3-48 • “Setting Model Configuration Parameters” on page 3-51 • “Using Custom Source Files in Generated Projects” on page 3-65 • “Optimizing Embedded Code with Target Function Libraries” on page 3-7
3 Project Generator Introducing Project Generator Project generator provides the following features for developing project and generating code: • Support automated project building for Texas Instruments’ Code Composer Studio software that lets you create projects from code generated by Real-Time Workshop and Real-Time Workshop Embedded Coder products. The project automatically populates CCS projects in the CCS development environment.
Project Generation and Board Selection Project Generation and Board Selection Project Generator uses ticcs objects to connect to the IDE. Each time you build a model to generate a project, the build process starts by issuing the ticcs method, as shown here: cc=ticcs('boardnum',boardnum,'procnum',procnum) The software attempts to connect to the board (boardnum) and processor (procnum) associated with the Board name and Processor number parameters in the Target Preferences block in the model.
3 Project Generator CCS Board Configuration State Response by Software Code Composer Studio has more than one board configured. The board name specified in the Target Preferences block is one of the configured boards. Connects to the specified board. Code Composer Studio has more than one board configured. The board name specified in the Target Preferences block is not one of the configured boards.(*) Returns a message asking you to select a board from the list of configured boards.
About the CCSLinkLib Blockset About the CCSLinkLib Blockset Embedded IDE Link CC block library ccslinklib comprises block libraries that contain blocks designed for generating projects for specific processors. The libraries are Library Description C280x/C28x3x DSP Chip Support (ccslinklib_c280x) Block for managing asynchronous scheduling on C280x-based hardware or simulators. C281x DSP Chip Support (ccslinklib_c281x) Block for managing asynchronous scheduling on C281x-based hardware or simulators.
3 Project Generator • Memory Allocate block • Memory Copy block Blocks for the processor families are almost identical. The following descriptions about each block, such as the Hardware Interrupt block, present all options for the block. Notes indicate when an option applies only to a processor-specific version of the block. Here is the main library of blocks for Embedded IDE Link CC.
About the CCSLinkLib Blockset The following figure shows the C280x/C28x3x DSP Chip Support library. The C281x DSP Chip Support library contains the block in the following figure.
3 Project Generator For the C5000 processor family, the C5000 DSP Chip Support library appears in the following figure.
About the CCSLinkLib Blockset The C6000 DSP Chip Support library appear in the next figure. The Core Support library appears in the next figure.
3 Project Generator The Target Preferences library appears in the next figure.
About the CCSLinkLib Blockset 3-11
3 Project Generator Schedulers and Timing In this section...
Schedulers and Timing Note Models in this section are for example purposes only. You cannot build and run them without additional blocks. Also, you can schedule multiple tasks for asynchronous execution using the blocks. The following figures show a model updated to use the asynchronous scheduler by converting the model to a function subsystem and then adding a scheduling block (Hardware Interrupt) to drive the function subsystem in response to interrupts.
3 Project Generator Algorithm Inside the Function Call Subsystem Block Here’s the model inside the function call subsystem in the previous figure. It is the same as the original model that used synchronous scheduling.
Schedulers and Timing The function generated for this task normally runs in free-running mode—repetitively and indefinitely. Subsystem execution of the reverberation function is the same as the subsystem described for the Free-Running DSP/BIOS Task. It is data driven via a background DMA interrupt-controlled ISR, shown in the following figure. f() function 0.8 Feedback Gain 1 In1 −2400 z Integer Delay .
3 Project Generator In this model, the Hardware Interrupt block installs a task that runs when it detects an external interrupt. This task performs the specified function with an LED. Comparing Synchronous and Asynchronous Interrupt Processing Code generated for periodic tasks, both single- and multitasking, runs via a timer interrupt. A timer interrupt ensures that the generated code representing periodic-task model blocks runs at the specified period.
Schedulers and Timing • Generated code that incorporates DSP/BIOS real-time operating system (RTOS) • Generated code that does not include DSP/BIOS RTOS Note In timer-based models, the timer counts through one full base-sample-time before it creates an interrupt. When Simulink software finally execute the model, it is for time 0. The following figure shows the relationship between model startup and execution.
3 Project Generator When you plan your project or algorithm, select your scheduling technique based on your application needs.
Schedulers and Timing Timer _ Period = (CPU _ Clock _ Rate) * ( Base _ Sample _ Time) * Prescaler Low _ Resolution _ Clock _ Divider The software configures the timer so that the base rate sample time for the coded process corresponds to the interrupt rate. Embedded IDE Link CC calculates and configures the timer period to ensure the desired sample rate. Different processor families use the timer resource and interrupt number differently.
3 Project Generator • Connecting the ISRs to the corresponding interrupt service vector table entries Note You are responsible for mapping and enabling the interrupts you specify in the block dialog box. Connect the output of the Hardware Interrupt block to the control input of a function-call subsystem. By doing so, you enable the ISRs to call the generated subsystem code each time the hardware raises the interrupt.
Schedulers and Timing One way to add the custom code to your generated code is to add a System Outputs block to your model. In the System Outputs block, you add the code to enable and map the interrupts. Real-Time Workshop includes the System Outputs block in the Custom Code library. When you add the System Outputs block to your model and open the block dialog box, you see the following dialog box.
3 Project Generator To enable and map the interrupts, add the code to the dialog box as shown in the following figure.
Schedulers and Timing Generating code from your model that includes the System Outputs block adds the enabling and mapping code to your project so the interrupts work.
3 Project Generator The following figure shows a top-level model c6000_hwi_interrupts that includes the System Outputs block in the Function-Call Subsystem2 submodel. Multitasking Scheduler Examples Embedded IDE Link CCEmbedded IDE Link MUEmbedded IDE Link VS provides a scheduler that supports multiple tasks running concurrently and preemption between tasks running at the same time. The ability to preempt running tasks enables a wide range of scheduling configurations.
Schedulers and Timing Multitasking scheduling also means that overruns, where a task runs beyond its intended time, can occur during execution. To understand these example, you must be familiar with the following scheduling concepts: • Preemption is the ability of one task to pause the processing of a running task to run instead. With the multitasking scheduler, you can define a task as preemptible—thus, another task can pause (preempt) the task that allows preemption.
3 Project Generator • Sub-Rate 1. The first subrate task. Sub-Rate 1 task runs more slowly than the Base-Rate task. Sub-Rate 1 task rate is 2ms in the examples so that the task should execute every 2ms. • Sub-Rate 2. In examples with three tasks, the second subrate task is called Sub-Rate 2. Sub-Rate 2 tasks run more slowly than Sub-Rate 1. In the examples, Sub-Rate 2 runs at either 4ms or 3ms. - When Sub-Rate 2 is 4ms, the example is called even. When Sub-Rate 2 is 3ms, the example is called odd.
Schedulers and Timing Three Odd-Rate Tasks Without Preemption and Overruns In this three task scenario, all of the tasks run as scheduled. No overruns or preemptions occur.
3 Project Generator Two Tasks with the Base-Rate Task Overrunning, No Preemption In this two rate scenario, the Base-Rate overruns the 1ms time intended and prevents the subrate task from completing successfully or running every 2ms. • Sub-Rate 1 does not allow preemption and fails to run when scheduled, but is never interrupted. • The Base-Rate runs every 2ms and Sub-Rate 1 runs every 4ms instead of 2ms.
Schedulers and Timing Task Identification Intended Execution Schedule Actual Execution Schedule Base-Rate 1ms 2ms (overrunning) Sub-Rate 1 2ms 4ms (overrunning) 3-29
3 Project Generator Two Tasks with Sub-Rate 1 Overrunning Without Preemption In this example, two rates running simultaneously—the Base-Rate task and one subrate task. Both the Base-Rate task and the Sub-Rate 1 task overrun. • Base-Rate runs every 2ms instead of 1ms. - The Sub-Rate 1 task both overruns and is affected by the Base-Rate task overrunning. - The Base-Rate task overrun delays Sub-Rate 1 task execution by a factor of 4. • Sub-Rate 1 runs every 8ms rather than every 2ms.
Schedulers and Timing Task Identification Intended Execution Schedule Actual Execution Schedule Base-Rate 1ms 2ms (overrunning) Sub-Rate 1 2ms 8ms (overrunning) Three Even-Rate Tasks with Preemption and No Overruns In the following three task scenario, the Base-Rate runs as scheduled and preempts Sub-Rate 1.
3 Project Generator • Both the Base-Rate and Sub-Rate 1 tasks preempt Sub-Rate 2 task execution. • Preempting the subrate tasks does not prevent the subrate tasks from running on schedule.
Schedulers and Timing Three Odd-Rate Tasks Without Preemption and the Base and Sub-Rate1 Tasks Overrun Three tasks running simultaneously—the Base-Rate task and two subrate tasks. • Both the Base-Rate task and the Sub-Rate 1 task overrun. • The Base-Rate task runs every 2ms instead of 1ms. • Sub-Rate 1 and Sub-Rate 2 task execution is delayed by a factor of 2—Sub-Rate 1 runs every 4ms rather than every 2ms and Sub-Rate 2 runs every 6ms instead of 3ms.
3 3-34 Project Generator Task Identification Intended Execution Schedule Actual Execution Schedule Base-Rate 1ms 2ms (overrunning) Sub-Rate 1 2ms 4ms (overrunning) Sub-Rate 2 3ms 6ms (overrunning)
Schedulers and Timing Three Odd-Rate Tasks with Preemption and Sub-Rate 1 Task Overruns In this three task scenario, the Base-Rate preempts Sub-Rate 1 which is overrunning. • The overrunning subrate causes Sub-Rate 1 to execute every 4ms instead of 2ms. • Every other fourth execution of Sub-Rate 2 does not occur. • Instead of executing at t=0, 3, 6, 9, 12, 15, 18,…, Sub-Rate 2 executes at t=0, 3, 9, 12, 15, 21, and so on. • The t=6 and t=18 instances do not occur.
3 3-36 Project Generator Task Identification Intended Execution Schedule Actual Execution Schedule Base-Rate 1ms 2ms (overrunning) Sub-Rate 1 2ms 4ms (overrunning) Sub-Rate 2 3ms 6ms (overrunning and skipping every other fourth execution)
Schedulers and Timing Three Even-Rate Tasks with Preemption and the Base-Rate and Sub-Rate 1 Tasks Overrun In this three-task scenario, two of the tasks overrun—the Base-Rate and Sub-Rate 1. • The overrunning Base-Rate executes every 2ms. • Sub-Rate 1 overruns due to the Base-Rate overrun, doubling the execution rate. • Also, Sub-Rate 1 is overrunning as well, doubling the execution rate again, from the intended 2ms to 8ms.
3 3-38 Project Generator Task Identification Intended Execution Schedule Actual Execution Schedule Base-Rate 1ms 2ms (overrunning) Sub-Rate 1 2ms 8ms (overrunning) Sub-Rate 2 3ms 16ms (overrunning)
Project Generator Tutorial Project Generator Tutorial In this section... “Creating the Model” on page 3-40 “Adding the Target Preferences Block to Your Model” on page 3-40 “Specify Configuration Parameters for Your Model” on page 3-44 In this tutorial you build a model and generate a project from the model using Embedded IDE Link CC software. Note The model demonstrates project generation. You cannot not build and run the model on your processor without additional blocks.
3 Project Generator Creating the Model To create the model for audio reverberation, follow these steps: 1 Start Simulink software. 2 Create a new model by selecting File > New > Model from the Simulink menu bar. 3 Use Simulink blocks and Signal Processing Blockset blocks to create the following model. Look for the Integer Delay block in the Discrete library of Simulink blocks and the Gain block in the Commonly Used Blocks library. Do not add the Custom Board block at this time.
Project Generator Tutorial Adding a Target Preferences block to a model triggers a dialog box that asks about your model configuration settings. The message tells you that the model configuration parameters will be set to default values based on the processor specified in the block parameters. To set the parameters automatically, click Yes. Clicking No dismisses the dialog box and does not set the parameters. When you click Yes, the software sets the system target file to ccslink_ert.
3 Project Generator ccslink_grt.stf system target file from the System Target File list in the Real-Time Workshop pane options. To add the Target Preferences block to your model, follow these steps: 1 Double-click Embedded IDE Link CC in the Simulink Library browser to open the ccslinklib blockset. 2 Double-click the library Target Preferences to see the blocks available for your processor. 3 Drag and drop the Custom Board block to your model as shown in the following model window figure.
Project Generator Tutorial 5 In the Block dialog box, select your processor from the Processor list. 6 Verify the CPU clock value and, if you are using a simulator, select Simulator.
3 Project Generator 7 Verify the settings on the Memory and Sections tabs to be sure they are correct for the processor you selected. 8 Click OK to close the Target Preferences dialog box. You have completed the model. Now configure the model configuration parameters to generate a project in CCS IDE from your model. Specify Configuration Parameters for Your Model The following sections describe how to configure the build and run parameters for your model.
Project Generator Tutorial Ignore the Data Import/Export, Diagnostics, and Optimization categories in the Configuration Parameters dialog box. The default settings are correct for your new model. Setting Real-Time Workshop Code Generation Parameters To configure Real-Time Workshop software to use the correct processor files and to compile and run your model executable file, set the options in the Real-Time Workshop category of the Select tree in the Configuration Parameters dialog box.
3 Project Generator 3 Under Code Generation, select Inline run-time library functions. Clear the other options. 4 Under Link Automation, verify that Export IDE link handle to base workspace is selected and provide a name for the handle in IDE handle name (optional). 5 Set Byte ordering to Little endian. 6 Change the category back to Embedded IDE Link CC. 7 Set the following Runtime options: • Build action: Create_project. • Interrupt overrun notification method: None.
Project Generator Tutorial When you click Build with Create_project selected for Build action, the automatic build process starts CCS IDE and populates an new project in the development environment. 3 To stop model execution, use the Halt option in CCS. You could enter halt at the MATLAB command prompt as well.
3 Project Generator Setting Code Generation Parameters for TI Processors Before you generate code with Real-Time Workshop software, set the fixed-step solver step size and specify an appropriate fixed-step solver if the model contains any continuous-time states. At this time, you should also select an appropriate sample rate for your system. Refer to your Real-Time Workshop User’s Guide documentation for additional information.
Setting Code Generation Parameters for TI Processors In the Select tree, the categories provide access to the options you use to control how Real-Time Workshop software builds and runs your model. The first categories under Real-Time Workshop in the tree apply to all Real-Time Workshop software processors. They always appear on the list. The last category under Real-Time Workshop is specific to the Embedded IDE Link CC system target filesccslink_grt.tlc and ccslink_ert.
3 Project Generator The following sections present each configuration parameters Select tree category and the relevant options available in each.
Setting Model Configuration Parameters Setting Model Configuration Parameters In this section...
3 Project Generator Target File Selection System target file Clicking Browse opens the processor File Browser where you select ccslink_grt.tlc as your Real-Time Workshop System target file for Embedded IDE Link CC. If you are using Real-Time Workshop Embedded Coder software or plan to use PIL, select the ccslink_ert.tlc processor in System target file.
Setting Model Configuration Parameters Build Process Embedded IDE Link CC software does not use makefiles or the build process to generate code. Code generation is project based so the options in this group do not apply. Custom Storage Class When you generate code from a model employing custom storage classes (CSC), make sure to clear Ignore custom storage classes. This setting is the default value for Embedded IDE Link CC and for Real-Time Workshop Embedded Coder.
3 Project Generator Create Code Generation report After you generate code, this option tells the software whether to generate an HTML report that documents the C code generated from your model. When you select this option, Real-Time Workshop writes the code generation report files in the html subdirectory of the build directory. The top-level HTML report file is named modelname_codegen_rpt.html or subsystemname_codegen_rpt.html.
Setting Model Configuration Parameters For details about using the options in Debug, refer to “About the TLC Debugger” in your Real-Time Workshop processor Language Compiler documentation. Optimization Pane Parameters On the Optimization pane in the Configuration Parameters dialog box, you set options for the code that Real-Time Workshop generates during the build process. You use these options to tailor the generated code to your needs.
3 Project Generator These are the options typically selected for Real-Time Workshop: • Conditional input branch execution • Signal storage reuse • Enable local block outputs • Reuse block outputs • Eliminate superfluous local variables (Expression folding) • Loop unrolling threshold • Optimize initialization code for model reference For more information about using these and the other Optimization options, refer to your Real-Time Workshop documentation.
Setting Model Configuration Parameters Embedded IDE Link CC Pane Parameters On the select tree, the Embedded IDE Link CC entry provides options in these areas: • Runtime — Set options for run-time operations, like the build action • Project Options — Set build options for your project code generation • Code Generation — Configure your code generation requirements • Link Automation — Export a ticcs object to your MATLAB workspace • Diagnostic options — Determine how the code generation process responds when
3 Project Generator working directory. This file set contains many of the same files that Real-Time Workshop software generates to populate a CCS project when you choose Create_Project for the build action. • Create_Project — Directs Real-Time Workshop software to start CCS and populate a new project with the files from the build process. This option offers a convenient way to build projects in CCS. • Archive_library — Directs Real-Time Workshop software to archive the project for this model.
Setting Model Configuration Parameters • Print_message — When the DSP encounters an overrun condition, it prints a message to the standard output device, stdout. • Call_custom_function — Respond to overrun conditions by calling the custom function you identify in Interrupt overrun notification function. Maximum time allowed to build project (s) Specifies how long, in seconds, the software waits for the project build process to return a completion message.
3 Project Generator Compiler options string To determine the degree of optimization provided by the TI optimizing compiler, enter the optimization level to apply to files in your project. For details about the compiler options, refer to your CCS documentation. When you create new projects, Embedded IDE Link CC does not set any optimization flags. Click Get From IDE to import the compiler option setting from the current project in the IDE. To reset the compiler option to the default value, click Reset.
Setting Model Configuration Parameters To enable the real-time execution profile capability, select Profile real-time task execution. With this selected, the build process instruments your code to provide performance profiling at the task level or for atomic subsystems. When you run your code, the executed code reports the profiling information in an HTML report.
3 Project Generator When you inline a block function, the compiler replaces each call to a block function with the equivalent function code from the static run-time library. If your model use the same block four times, your generated code contains four copies of the function. While this redundancy uses more memory, inline functions run more quickly than calls to the functions outside the generated code.
Setting Model Configuration Parameters If you have used Embedded IDE Link CC, you are familiar with function ticcs, which creates objects the reference between the IDE and MATLAB. This option refers to the same object, called cc in the function reference pages. Although MATLAB to CCS is a bridge to a specific instance of the CCS IDE, it is an object that contains information about the IDE instance it refers to, such as the board and processor it accesses.
3 Project Generator code replacement files. Use none when the replacement process is correct and you do not want to see multiple messages during your build. Embedded IDE Link CC Default Project Configuration — Custom Although CCS offers two standard project configurations, Release and Debug, models you build with Embedded IDE Link CC use a custom configuration that provides a third combination of build and optimization settings—Custom. Project configurations define sets of project build options.
Using Custom Source Files in Generated Projects Using Custom Source Files in Generated Projects In this section... “Preparing to Replace Generated Files With Custom Files” on page 3-65 “Replacing Generated Source Files with Custom Files When You Generate Code” on page 3-67 The Board custom code options on the Board Info pane in the model’s Target Preferences block enable you to replace a generated file with a custom file you provide.
3 Project Generator • Modify a library file, such as a chip support library (.csl file) • Add commands to a header file • Modify data in a data file • Add comments to a file for tracking or identifying the file or project . Determining the Name of the File to Replace To replace a file created when you generate a project, you need the name of the file to replace; the content to change; and the replacement file, including the path to the file.
Using Custom Source Files in Generated Projects The build process stores the project files in the directory modelname_multilink in your MATLAB working directory, and shows the project directory information in the MATLAB Command window. The build process stores the project files in the directory modelname_vdsplink in your MATLAB working directory, and shows the project directory information in the MATLAB Command window. 7 Note the file name and location.
3 Project Generator Follow these steps to configure the build process to use a replacement file. 1 Double-click Target Preferences in your model. The block dialog box opens as shown in the following figure.
Using Custom Source Files in Generated Projects 2 In the Board custom code options, select the type of file to replace—Source files or Libraries. 3 Enter the name of your replacement file and path in the text field. The build process recognizes two directory path tokens: • $MATLAB to refer to your MATLAB root directory • $install_dir to refer to the root of your IDE installation. 4 Click OK to close the dialog box.
3 Project Generator Optimizing Embedded Code with Target Function Libraries In this section...
Optimizing Embedded Code with Target Function Libraries Code Generation Using the Target Function Library The build process begins by converting your model and its configuration set to an intermediate form that reflects the blocks and configurations in the model. Then the code generation phase starts. Note Real-Time Workshop refers to the following conversion process as replacement and it occurs before the build process generates a project.
3 Project Generator For more information about target function libraries in the build process, refer to “Introduction to Target Function Libraries” in the Real-Time Workshop Embedded Coderdocumentation. Using a Processor-Specific Target Function Library to Optimize Code As a best practice, you should select the appropriate target function library for your processor after you verify the ANSI C implementation of your project.
Optimizing Embedded Code with Target Function Libraries With the target function library selected, your generated code uses the specific functions in the library for your processor. To stop using a processor-specific target function library, open the Interface pane in the model configuration parameters. Then, select the C89/C90 (ANSI) library from the Target function library list.
3 Project Generator Reviewing Processor-Specific Target Function Library Changes in Generated Code Use one of the following techniques or tools to see the target function library elements where they appear in the generated code: • Review the Code Manually. • Use Model-to-Code Tracing to navigate from blocks in your model to the code generated from the block. • Use a File Differencing Scheme to compare projects that you generate before and after you select a processor-specific target function library.
Optimizing Embedded Code with Target Function Libraries 4 Press Ctrl+B to generate code from your model. The Real-Time Workshop Report window opens on your desktop. For more information about the report, refer to “Creating and Using a Code Generation Report” in the Real-Time Workshop Embedded Coder documentation.
3 Project Generator 5 Save the project with a new name—newproject2 6 Compare the contents of the modelname.c files from newproject1 and newproject2. The differences between the files show the target function library induced code changes. Reviewing Target Function Library Operators and Functions Real-Time Workshop Embedded Coder software provides the Target Function Library viewer to enable you to review the arithmetic operators and functions registered in target function library tables.
Model Reference and Embedded IDE Link™ CC Model Reference and Embedded IDE Link CC Model reference lets your model include other models as modular components. This technique provides useful features because it: • Simplifies working with large models by letting you build large models from smaller ones, or even large ones. • Lets you generate code once for all the modules in the entire model and only regenerate code for modules that change. • Lets you develop the modules independently.
3 Project Generator an executable (a MEX file, .mex) for each reference model that is used to simulate the top model. When you rebuild reference models for simulations or when you run or update a simulation, Simulink software rebuilds the model reference files. Whether reference files or models are rebuilt depends on whether and how you change the models and on the Rebuild options settings. You can access these setting through the Model Reference pane of the Configuration Parameters dialog box.
Model Reference and Embedded IDE Link™ CC The Configuration Parameters dialog box opens. 3 From the Select tree, choose Embedded IDE Link CC. 4 In the right pane, under Runtime, select set Archive_library from the Build action list. If your top model uses a reference model that does not have the build action set to Archive_library, the build process automatically changes the build action to Archive_library and issues a warning about the change.
3 Project Generator • No blocks from the C62x DSP Library (in c6000lib) (because these are noninlined S-functions) • No blocks from the C64x DSP Library (in c6000lib) (because these are noninlined S-functions) • No noninlined S-functions • No driver blocks, such as the ADC or DAC blocks from any Target Support Package™ TC2 or Target Support Package TC6 block library Configuring processors to Use Model Reference processors that you plan to use in Model Referencing must meet some general requirements.
Model Reference and Embedded IDE Link™ CC Models that you develop with versions 2.4 and later of Embedded IDE Link CC automatically include the model reference capability. You do not need to set the flag.
3 3-82 Project Generator
4 Verification • “What Is Verification?” on page 4-2 • “Using Processor in the Loop” on page 4-3 • “Real-Time Execution Profiling” on page 4-11 • “System Stack Profiling” on page 4-19
4 Verification What Is Verification? Verification consists broadly of running generated code on a processor and verifying that the code does what you intend. The components of Embedded IDE Link CC combine to provide tools that help you verify your code during development by letting you run portions of simulations on your hardware and profiling the executing code.
Using Processor in the Loop Using Processor in the Loop Processor in the loop provides one powerful verification capability in your development process. This section discusses the following PIL topics: In this section...
4 Verification Your starting point in developing a plant/controller system is to model the system as two subsystems in closed-loop simulation. As your design progresses, you can use Simulink software external mode with standard Real-Time Workshop software processors (such as GRT or ERT) to help you model the control system separately from the plant.
Using Processor in the Loop PIL Algorithm The algorithmic code, such as the control algorithm, to be tested during the PIL cosimulation. The PIL algorithm resides in compiled object form to allow verification at the object level. PIL Application The executable application to run on the processor platform. The PIL application is created by linking the PIL algorithm object code with some wrapper code (or test harness) that provides an execution framework that interfaces to the PIL algorithm.
4 Verification PIL tests do not run in real time. After each sample period, the simulation halts to ensure that all data has been exchanged between the Simulink software test harness and object code. You can then check functional differences between the model and generated code. PIL Block The PIL cosimulation block is the Simulink software block interface to PIL and the interface between the Simulink software plant model and the executable application running on the processor.
Using Processor in the Loop • “PIL with DSP/BIOS Enabled Does Not Support System Stack Profiling” on page 4-7 • “Real-Time Workshop grt.tlc-Based Targets Not Supported” on page 4-7 • “Out of Date PIL Application Executable” on page 4-7 Consider the following issues when you work with PIL blocks. Generic PIL Issues Refer to the Support Table section in the Real-Time Workshop Embedded Coder documentation for general PIL feature support information affecting the PIL block with Link products.
4 Verification • The code generated by a model referred to by the PIL algorithm changes after you generate code for the PIL algorithm. To update the PIL application executable, regenerate code for the PIL algorithm, and then click Build on the PIL block to bring the PIL application executable up to date. Creating and Using PIL Blocks Using PIL and PIL blocks to verify your processes begins with a Simulink model of your process.
Using Processor in the Loop a From the model menu bar, go to Simulation > Configuration Parameters in your model to open the Configuration Parameters dialog box. b Choose Real-Time Workshop from the Select tree. Set the configuration parameters for your model as required by Embedded IDE Link CC software. Get more information about setting the Real-Time Workshop software parameters in “Setting Code Generation Parameters for TI Processors” on page 3-48 in the online Help system.
4 Verification 8 Click Simulation > Start to run the PIL simulation and view the results.
Real-Time Execution Profiling Real-Time Execution Profiling In this section... “Overview” on page 4-11 “Profiling Execution by Tasks” on page 4-12 “Profiling Execution By Subsystems” on page 4-14 Overview Real-time execution profiling in Embedded IDE Link CC software uses a set of utilities to support profiling for synchronous and asynchronous tasks, or atomic subsystems, in your generated code. These utilities record, upload, and analyze the execution profile data.
4 Verification • An HTML report that provides statistical data about the execution of each task or atomic subsystem in the running process. These reports are identical to the reports you see if you use profile(ticcs_obj,'execution','report) to view the execution results. For more information about report formats, refer to profile. In combination, the reports provide a detailed analysis of how your code runs on the processor.
Real-Time Execution Profiling 3 Select Enable real-time profiling. 4 On the Profile by list, select Task to enable real-time task profiling. 5 Select Export IDE link handle to base workspace, and assign a name for the handle in IDE link handle name. 6 Click OK to close the Configuration Parameters dialog box. To view the execution profile for your model: 1 Click Incremental build ( ) on the model toolbar to generate, build, load, and run your code on the processor.
4 Verification profile(handlename, execution , report ) to view the MATLAB software graphic of the execution report and the HTML execution report. Refer to profile for information about other reporting options. The following figure shows the profiling plot from running an application that has three rates—the base rate and two slower rates. The gaps in the Sub-Rate2 task bars indicate preempted operations. Refer to Task Profiling Report.
Real-Time Execution Profiling 2 Select Embedded IDE Link CC from the Select tree. The pane appears as shown in the following figure. 3 Select Enable real-time profiling. 4 On the Profile by list, select Atomic subsystem to enable real-time subsystem execution profiling. 5 Select Export IDE link handle to base workspace and assign a name for the handle in IDE link handle name. 6 Click OK to close the Configuration Parameters dialog box.
4 Verification 2 To stop the running program, select Debug > Halt in CCS, or use halt(objectname) from the MATLAB command prompt. Gathering profile data from a running program may yield incorrect results. 3 At the MATLAB command prompt, enter: profile(handlename, execution , report ) to view the MATLAB software graphic of the execution report and the HTML execution report. Refer to profile for more information.
Real-Time Execution Profiling The following figure presents the model that contains the subsystems reported in the profiling plot.
4 Verification Atomic Subsystem Profiling 0.8 Out 1 To Workspace In 1 simout For Iterator Subsystem1 Feedback Gain 1 Constant for { ... } In 1 Rate Transition for { ... } For Iterator Subsystem Out 1 Rate Transition 2 .9 Rate Transition 1 Gain Rate Transition 3 f() Idle Task Idle Task1 function () IdleTask Subsystem Atomic Subsystem Profiling Report.
System Stack Profiling System Stack Profiling In this section... “Overview” on page 4-19 “Profiling System Stack Use” on page 4-21 Overview Embedded IDE Link CC software enables you to determine how your application uses the processor system stack. Using the profile method, you can initialize and test the size and usage of the stack. This information can help you optimize both the size of the stack and how your code uses the stack.
4 Verification System Stack: 532/1024 (51.95%) MAUs used. name: startAddress: endAddress: stackSize: growthDirection: System Stack [512 0] [1535 0] 1024 MAUs ascending The following table describes the entries in the report: 4-20 Report Entry Units Description System Stack Minimum Addressable Unit (MAU) Maximum number of MAUs used and the total MAUs allocated for the stack. name String for the stack name Lists the name assigned to the stack.
System Stack Profiling Profiling System Stack Use To profile the system stack operation, perform these tasks in order: 1 Load an application. 2 Set up the stack to enable profiling. 3 Run your application. 4 Request the stack profile information. Note If your application initializes the stack with known values when you run it, stack usage is reported as 100%. The value does not correctly reflect the stack usage.
4 Verification 5 Use the profile method to capture and view the results of profiling the stack. profile(cc,'stack','report') The following example demonstrates setting up and profiling the stack. The ticcs object cc must exist in your MATLAB workspace and your application must be loaded on your processor. This example comes from a C6713 simulator. profile(cc,'stack','setup') % Set up processor stack--write A5 to the stack addresses. Maximum stack usage: System Stack: 0/1024 (0%) MAUs used.
5 Exporting Filter Coefficients from FDATool • “About FDATool” on page 5-2 • “Preparing to Export Filter Coefficients to Code Composer Studio Projects” on page 5-4 • “Exporting Filter Coefficients to Your Code Composer Studio Project” on page 5-9 • “Preventing Memory Corruption When You Export Coefficients to Processor Memory” on page 5-15
5 Exporting Filter Coefficients from FDATool About FDATool Signal Processing Toolbox™ software provides the Filter Design and Analysis tool (FDATool) that lets you design a filter and then export the filter coefficients to a matching filter implemented in a CCS project.
About FDATool • ticcs — Create a connection between MATLAB software and CCS IDE so you can work with the project in CCS from the MATLAB Command window. • write — Write data to memory on the processor.
5 Exporting Filter Coefficients from FDATool Preparing to Export Filter Coefficients to Code Composer Studio Projects In this section... “Features of a Filter” on page 5-4 “Selecting the Export Mode” on page 5-5 “Choosing the Export Data Type” on page 5-6 Features of a Filter When you create a filter in FDATool, the filter includes defining features identified in the following table.
Preparing to Export Filter Coefficients to Code Composer Studio™ Projects Selecting the Export Mode You can export a filter by generating an ANSI C header file, or by writing the filter coefficients directly to processor memory. The following table summarizes when and how to use the export modes.
5 Exporting Filter Coefficients from FDATool Choosing the Export Data Type The export process provides two ways you can specify the data type to use to represent the filter coefficients. Select one of the options shown in the following table when you export your filter.
Preparing to Export Filter Coefficients to Code Composer Studio™ Projects type to suggest, refer to “How FDATool Determines the Export Suggested Data Type” on page 5-7. Follow these best-practice guidelines when you implement your filter algorithm in source code and design your filter in FDATool: • Implement your filter using one of the data types FDATool exports without modifications. • Design your filter in FDATool using the data type you used to implement your filter.
5 Exporting Filter Coefficients from FDATool If you set custom word and fraction lengths to represent your filter coefficients, the export process suggests a data type to maintain the best fidelity for the filter. The export process converts your custom word and fraction lengths to a suggested export data type, using the following rules: • Round the word length up to the nearest larger supported data type. For example, round an 18-bit word length up to 32 bits.
Exporting Filter Coefficients to Your Code Composer Studio Project Exporting Filter Coefficients to Your Code Composer Studio Project In this section... “Exporting Filter Coefficients from FDATool to the CCS IDE Editor” on page 5-9 “Reviewing ANSI C Header File Contents” on page 5-12 Exporting Filter Coefficients from FDATool to the CCS IDE Editor In this section, you export filter coefficients to a project by generating an ANSI C header file that contains the coefficients.
5 Exporting Filter Coefficients from FDATool 4 To export the filter coefficients, select Targets > Code Composer Studio IDE from the FDATool menu bar. The Export to Code Composer Studio IDE dialog box opens, as shown in the following figure. 5 Set Export mode to C header file. 6 In Variable names in C header file, enter variable names for the Numerator, Denominator, Numerator length, and Denominator length parameters where the coefficients will be stored.
Exporting Filter Coefficients to Your Code Composer Studio Project Note You cannot use reserved ANSI C programming keywords, such as if or int as variable names, or include invalid characters such as spaces or semicolons (;). 7 In Data type to use in export, select Export suggested to accept the recommended export data type. FDATool suggests a data type that retains filter coefficient fidelity.
5 Exporting Filter Coefficients from FDATool • Click Select target to open the Selection Utility: Embedded IDE Link CC dialog box. • From the list of boards and list of processors, select the board name and processor name to use. • Click Done to set the DSP Board # and DSP Processor # values. 9 Click Generate to generate the ANSI header file. FDATool prompts you for a file name and location to save the generated header file. The default location to save the file is your MATLAB working directory.
Exporting Filter Coefficients to Your Code Composer Studio Project /* * Filter Coefficients (C Source) generated by the Filter Design and Analysis Tool * * Generated by MATLAB(R) 7.8 and the Signal Processing Toolbox 6.11.
5 Exporting Filter Coefficients from FDATool { 0.2436793028081, 0.4873586056161, 0.2436793028081 1, 0, 0 0.3768793219093, 0.7537586438185, 0.3768793219093 1, 0, 0 }, { }, { }, { } }; const int DL[MWSPT_NSEC] = { 1,3,1,3,1,3,1,3,1,3,1 }; const real64_T DEN[MWSPT_NSEC][3] = { { 1, 0, 0 1, -0.1842138030775, 0.1775781189277 1, 0, 0 1, -0.2160098642842, 0.
Preventing Memory Corruption When You Export Coefficients to Processor Memory Preventing Memory Corruption When You Export Coefficients to Processor Memory In this section...
5 Exporting Filter Coefficients from FDATool to real64_T NUM[256] = {...} allocates enough memory for NUM to store up to 256 numerator filter coefficients rather than 47. Exporting the header file to CCS IDE does not add the filter to your project. To incorporate the filter coefficients from the header file, add a #include statement: #include headerfilename.
Preventing Memory Corruption When You Export Coefficients to Processor Memory Caution Identify changes that require additional memory to store the coefficients before you begin your export. Otherwise, exporting the new filter coefficients may overwrite data in memory locations you did not allocate for storing coefficients. Also, exporting filter coefficients to memory after you change the filter order, structure, design algorithm, or data type can yield unexpected results and corrupt memory.
5 Exporting Filter Coefficients from FDATool For important guidelines on writing directly to processor memory, refer to “Preventing Memory Corruption When You Export Coefficients to Processor Memory” on page 5-15. Follow these steps to export filter coefficients from FDATool directly to memory on your processor. 1 Load the program file that contains your filter into CCS IDE to activate the program symbol table.
Preventing Memory Corruption When You Export Coefficients to Processor Memory If you did not store your filter from a previous session, design the filter in FDATool and continue. 5 Click Close to dismiss the Filter Manager dialog box. 6 Adjust the filter specifications in FDATool to modify its performance. 7 In FDATool, select Targets > Code Composer Studio IDE to open the Export to Code Composer Studio IDE dialog box. Keep the export dialog box open while you work.
5 Exporting Filter Coefficients from FDATool For more information about how FDATool determines the data type to suggest, refer to “How FDATool Determines the Export Suggested Data Type” on page 5-7. 11 If you know the board number and processor number of your DSP, enter DSP Board # and DSP Processor # values to identify your board. Note When you have only one board or simulator, Embedded IDE Link CC sets DSP Board # and DSP Processor # to your board automatically.
Preventing Memory Corruption When You Export Coefficients to Processor Memory You can continue to export the filter, or cancel the export process. To prevent this warning dialog box from appearing, select Disable memory transfer warnings in the Export to Code Composer Studio IDE dialog box. 13 (Optional) Continue to optimize filter performance by modifying your filter in FDATool and then export the updated filter coefficients directly to processor memory.
5 5-22 Exporting Filter Coefficients from FDATool
6 Function Reference Operations on Objects for CCS IDE (p. 6-2) Work with links for CCS IDE Operations on Objects for RTDX (p.
6 Function Reference Operations on Objects for CCS IDE 6-2 activate Make specified project, file, or build configuration active in CCS IDE add Add files or new typedef to active project in CCS address Address and page for entry in symbol table in CCS IDE animate Run application on processor to breakpoint build Build active project in CCS IDE ccsboardinfo Information about boards and simulators known to CCS IDE cd Change CCS IDE working directory clear Remove links to CCS IDE and RTDX inte
Operations on Objects for CCS IDE isreadable Determine whether MATLAB software can read specified memory block isrtdxcapable Determine whether processor supports RTDX isrunning Determine whether processor is executing process isvisible Determine whether CCS IDE is running iswritable Determine whether MATLAB software can write to specified memory block load Transfer program file (*.out, *.
6 Function Reference run Execute program loaded on processor symbol Program symbol table from CCS IDE ticcs Create object that refers to CCS IDE visible Set whether CCS IDE window is visible while CCS runs write Write data to memory on processor Operations on Objects for RTDX 6-4 close Close CCS IDE files or RTDX channel configure Define size and number of RTDX channel buffers disable Disable RTDX interface, specified channel, or all RTDX channels display Display properties of object th
Operations on Objects for RTDX™ open Open channel to processor or load file into CCS IDE readmat Matrix of data from RTDX channel readmsg Read messages from specified RTDX channel writemsg Write messages to specified RTDX channel 6-5
6 6-6 Function Reference
7 Functions — Alphabetical List
activate Purpose Make specified project, file, or build configuration active in CCS IDE Syntax activate(cc,'objectname','type') Description activate(cc,'objectname','type') makes the object specified by objectname and type the active document window or project in CCS IDE. While you must include the link cc, it does not identify the project or file you make active. activate accepts one of three strings for type String Description 'project' Makes an existing project in CCS IDE active (current).
activate visible(cc,1) Now make two projects in CCS IDE. new(cc,'myproject1.pjt','project') new(cc,'myproject2.pjt') In CCS IDE, myproject2 is now the active project, because you just created it. With two projects in CCS IDE, add a new build configuration to the second project. new(cc,'Testcfg','buildcfg') If you switch to CCS IDE, you see myproject2.pjt in bold lettering in the project view, signaling it is the active project.
add Purpose Add files or new typedef to active project in CCS Syntax add(cc,'filename') info = add(cc.type,'typedefname','datatype') Description Use add when you have an existing file to add to your active project in CCS. You can have more than one CCS IDE open at the same time, such as C5000 and C6000 IDE instances. cc identifies which CCS IDE instance gets the file, and it identifies your board or processor.
add File Types and Extensions Supported by add and CCS IDE (Continued) Extensions Supported CCS Project Folder Object and library files .o*, .lib Libraries Linker command file .cmd Project Name DSP/BIOS file .cdb* DSP/BIOS Config Visual Linker Recipe rcp Replaces the .cmd file, or goes under File Type Project Name Use activate to change your active project in CCS IDE or switch to the CCS IDE and change the active directory within CCS. info = add(cc.
add Board number : 0 Processor number : 0 Default timeout : 10.00 secs RTDX channels : 0 cc.visible(1) % Optional. Makes CCS IDE visible on your desktop. new(cc,'myproject','project'); % Now add a C source file add(cc,'c6711dsk_adc.c'); % Adds the source file for the ADC block. In CCS IDE, c6711dsk_adc.c shows up in myproject, in the Source folder. Now add a new build configuration to myproject.
address Purpose Address and page for entry in symbol table in CCS IDE Syntax a = address(cc,'symbolstring') Description a = address(cc,'symbolstring') returns the memory address and page values for the symbol identified by ’symbolstring’ in CCS IDE. address returns the symbol from the most recently loaded program in CCS IDE. In some instances this might not be the program loaded on the processor to which cc is linked.
address Examples After you load a program to your processor, address lets you read and write to specific entries in the symbol table for the program. For example, the following function reads the value of symbol ’ddat’ from the symbol table in CCS IDE. ddatv = read(cc,address(cc,'ddat'),'double',4) ddat is an entry in the current symbol table. address searches for the string ddat and returns a value when it finds a match.
animate Purpose Run application on processor to breakpoint Syntax animate(cc) Description animate(cc) starts the processor application, which runs until it encounters a breakpoint in the code. At the breakpoint, application execution halts and CCS Debugger returns data to CCS IDE to update all windows that are not connected to probe points. After updating the display, the application resumes execution and runs until it encounters another breakpoint.
build Purpose Build active project in CCS IDE Syntax build(cc,timeout) build(cc) build(cc,'all',timeout) build(cc,'all') [result,numwarns]=build(...) Description build(cc,timeout)incrementally rebuilds your active project in CCS IDE. In an incremental build: • Files that you have changed since your last project build process get rebuilt or recompiled. • Source files rebuild when the time stamp on the source file is later than the time stamp on the object file created by the last build.
build Note CCS IDE opens a Save As dialog box when the requested project build overwrites any files in the project. You must respond to the dialog box before CCS IDE continues the build. The dialog box may be hidden by open windows on your desktop and not visible. CCS IDE, MATLAB software, and other applications may appear to be frozen until you respond. To limit the time that build spends performing the build, the optional argument timeout stops the process after timeout seconds.
build passed. If you omit the timeout option in the syntax, build defaults to the global timeout defined in cc. build(cc,'all') is the same as build(cc,'all',timeout) except that when you omit the timeout option, build defaults to the timeout set for build only, 1000 s. [result,numwarns]=build(...) returns two output values that report the results of the build operation.
build RTDX channels : 0 build(cc,'all',20) You just completed a full build of the project in CCS IDE. On the Build pane in CCS IDE, you see the record of the build process and the results. Now, make a change to a file in the project in CCS IDE and save the file. Then rebuild the project with an incremental build. build(cc,20) When you look at the Build pane in CCS IDE, the log shows that the build only occurred on the file or files that you changed and saved.
ccsboardinfo 7-14 Purpose Information about boards and simulators known to CCS IDE Syntax ccsboardinfo boards = ccsboardinfo Description ccsboardinfo returns configuration information about each board and processor installed and recognized by CCS. When you issue the function, ccsboardinfo returns the following information about each board or simulator. Installed Board Configuration Data Configuration Item Name Board number boardnum The number that CCS assigns to the board or simulator.
ccsboardinfo Installed Board Configuration Data Configuration Item Name Processor number procnum The number assigned by CCS to the processor on the board or simulator. When the board contains more than one processor, CCS assigns a number to each processor, numbering from 0 for the first processor on the first board.
ccsboardinfo returns boards = name: 'C6xxx Simulator (Texas Instruments)' number: 0 proc: [1x1 struct] where the structure proc contains the processor information for the C6xxx simulator board: boards.proc ans = name: 'CPU' number: 0 type: 'TMS320C6200' Reviewing the output from both function syntaxes shows that the configuration information is the same.
ccsboardinfo boards(1).proc(2).name); Examples On a PC with both a simulator and a DSP Starter Kit (DSK) board installed, ccsboardinfo returns something similar to the following table. Your display may differ slightly based on what you called your boards when you configured them in CCS Setup Utility: Board Board Proc Processor Processor Num Name Num Name Type --- ---------------------------------- --- --------------- 1 C6xxx Simulator (Texas Instrum ..
ccsboardinfo at the MATLAB desktop prompt. You get Board Board Proc Processor Processor Num Num Name --- Name ---------------------------------- --- Type ------------ 1 C6xxx Simulator (Texas Instrum .
ccsboardinfo 1). Board 0 has three CPUs defined for it. To determine the type of the second processor on board 0 (the board whose boardnum = 0), enter boards(2).proc(1) which returns ans= name: 'CPU_3' number: 1 type: 'TMS320C6x1x' Recall that boards(2).proc gives you this information about the board ans= 3x1 struct array with fields: name number type indicating that this board has three processors (the 3x1 array).
cd Purpose Change CCS IDE working directory Syntax cd(cc,'directory’) wd = cd(c,'directory') cd(cc,pwd) Description cd(cc,'directory’) changes the CCS IDE working directory to the directory identified by the string dir. For the change to take effect, dir must refer to an existing directory. You can give the directory string either as a relative path name or an absolute path name including the drive letter. CCS IDE applies relative path names from the current working directory.
cd where the drive letter D may be different based on where you installed CCS IDE. Now check your MATLAB environment working directory: pwd ans = J:\bin\win32 Your CCS IDE and MATLAB environment working directories are not the same. To make the directories the same, use the cd(cc,pwd) syntax: cd(cc,pwd) % Set CCS IDE to use your MATLAB working directory. pwd % Check your MATLAB working directory. ans = J:\bin\win32 cd(cc) % Check your CCS IDE working directory.
clear Purpose Remove links to CCS IDE and RTDX interface, or clear type entries in type objects Syntax clear(cc) clear('all') clear(cc.type,'all') clear(cc.type,typedefname) Description clear(cc) clears the link associated with cc. This is the last step in any development effort that uses links. Clear links that you no longer need for your work to avoid unforeseen problems. Calling clear executes the object destructors that delete the link object and all associated memory and resources.
close Purpose Close CCS IDE files or RTDX channel Note close(cc,filename,'text') produces an error. Support for close(rx,...) on C5000 and C6000 processors will be removed in a future version. Syntax close(cc,'filename','type') close(rx,'channel1','channel2',...) close(rx,'channel') Description close(cc,'filename','type') closes the file in CCS IDE identified by filename of type ’type’. type identifies the type of file to close.
close close(rx,'channel1','channel2',...) closes the channels specified by the strings channel1, channel2, and so on as defined in rx. close(rx,'channel') closes the specified channel. When you set channel to 'all', this function closes all the open channels associated with rx. To avoid conflicts, do not name channels “all” or “ALL.” Examples Using close with Files and Projects To clarify the different close options, here are six commands that close open files or projects in CCS IDE.
close rx=cc.rtdx % Create an alias to the RTDX portion of this link. open(rx,'ichan','w') % Open a channel for write access. enable(rx,'ichan') % Enable the open channel for use. After you finish using the open channel, you must close it to avoid difficulties later on.
configure Purpose Define size and number of RTDX channel buffers Note configure produces a warning on C5000 and C6000 processors and will be removed in a future version. Syntax configure(rx,length,num) Description configure(rx,length,num) sets the size of each main (host) buffer, and the number of buffers associated with rx. Input argument length is the size in bytes of each channel buffer and num is the number of channel buffers to create.
configure rx=cc.rtdx RTDX channels % Create an alias to the rtdx portion. : 0 configure(rx,4096,6) % Use the alias rx to configure the length % and number of buffers. After you configure the buffers, use the RTDX tools in CCS IDE to verify the buffers.
datatypemanager Purpose Open Data Type Manager datatypemanager produces a warning and will be removed in a future version. Syntax datatypemanager(cc) cc2 = datatypemanager(cc) Description datatypemanager(cc) opens the Data Type Manager (DTM) with data type information about the project to which cc refers. With the type manager open, you can add type definitions (typedefs) from your project to MATLAB software so it can interpret them.
datatypemanager • Refresh list — updates the list in Typedef name (Equivalent data type). Refreshing the list ensures the contents are current. If you changed your project data type content or loaded a new project, this updates the type definitions in the DTM. • Close — closes the DTM and prompts you to save the session information. This is the only way to save your work in this dialog box. Saving the session creates an M-file you can reload into the DTM later.
datatypemanager independent objects. When you change a property of either cc or cc2, the corresponding property in the other object changes as well. Data Type Manager When you create objects that access functions in a project, MATLAB software can recognize most data types that you use in your project. However, if the functions use one or more custom type definitions, MATLAB software cannot recognize the data type and cannot work with the function.
datatypemanager Before you add a type definition, the Typedef name (Equivalent data type) list shows a number of data types already defined: • Void(void) — void return argument for a function • Float(float) — float data type used in a function input or return argument • Double(double) — double data type used in a function input or return argument • Long(long) — long data type used in a function input or return argument • Int(int) — int data type used in a function input or return argument 7-31
datatypemanager • Short(short) — short data type used in a function input or return argument • Char(char) — character data type used in a function input or return argument The lowercase versions of the data types appear because MATLAB software does not recognize the initial capital versions automatically. In the data type entry, the project data type with the initial capital letter is mapped to the lowercase MATLAB software data type.
datatypemanager Add Typedef Dialog Box Clicking Add typedef in the DTM opens the List of Known Data Types dialog box. As shown in this figure, you add your custom type definitions here. When you have used custom type definitions in your program or project, you must specify what they mean to MATLAB software. The Typedef option lets you enter the name of the typedef in your program and select an equivalent type from the Known Types list.
datatypemanager Options in this dialog box let you review the data types you are using or that are available in your projects. By selecting different data type categories from the Known Types list, you can see all of the supported data types.
datatypemanager Data Type Description uint32 Unsigned 32-bit integer data int64 64-bit integer data uint64 Unsigned 64-bit integer data single 32-bit IEEE® floating-point data double 64-bit IEEE floating-point data • TI C Types Data Type Description (For C6000 Compiler) char 8-bit character data with a sign bit unsigned char 8-bit character data signed char 8-bit character data short 16-bit numeric data unsigned short Unsigned 16-bit numeric data signed short 16-bit numeric data wi
datatypemanager Data Type Description (For C6000 Compiler) double 64-bit numeric data long double On the C2000 and C5000 processors – 32-bit IEEE floating-point data On the C6000 processors – 64-bit IEEE floating-point data Numbers of bits change depending on the processor and compiler. For more information about Texas Instruments data types and specific processors or compilers, refer to your compiler documentation from Texas Instruments processors. • TI Fixed-Point Types Data Type Description Q0.
datatypemanager appear in the Loaded program option. MATLAB software cannot determine what program you have loaded. • Others such as pointers and typedefs Like struct, union, and enum data types, the Others list is empty until you define one or more typedefs. Unlike the Struct, Union, Enum types list, loading a program does not populate this list with typedefs from the program. You must define them explicitly in this dialog box. Custom type definitions can refer to other typedefs in your project.
datatypemanager First Example Create a typedef (typedef1) that uses a MATLAB software data type. typedef1 uses the equivalent data type uint32.
datatypemanager Second Example Create a second typedef (typedef2) that uses one of the TI C data types. Define typedef2 to use the signed long data type.
datatypemanager Third Example Create a typedef (typedef3) that refers to another typedef (typedef2). Call this a nested typedef. Notice that the referenced typedef, typedef2, is entered as a pointer (indicated by the added asterisk). Using the pointer form lets MATLAB software recognize the data type that typedef2 represents. If you do not use the pointer, MATLAB software converts typedef3 to a default value equivalent data type, in this case, int.
datatypemanager The next figure shows typedef4 created to use typedef2 rather than typedef2* for a nested typedef. Under Equivalent type, typedef4 has an equivalent data type of typedef2, as specified. But, when you look at the list of known data types in the Data Type Manager dialog box, you see that typedef4 maps to int, not typedef2, or eventually signed long. Here is the DTM after you create all the example custom data types. Take note of typedef4 in this listing.
datatypemanager 7-42
delete Purpose Remove debug points in addresses or source files in CCS Syntax delete(cc,addr,'type') delete(cc,addr,'type',timeout) delete(cc,addr) delete(cc,filename,line,'type') delete(cc,filename,line,'type',timeout) delete(cc,filename,line) delete(cc,'all') delete(cc,'all','break',timeout) Description delete(cc,addr,'type') removes a debug point located at the memory address identified by addr for your processor digital signal processor.
delete returns an error reporting that it could not find the specified debugging point. delete(cc,addr,'type',timeout) adds the optional input parameter timeout that determines how long Embedded IDE Link CC waits for a response to the request to delete a breakpoint. If the response is not received before the timeout period expires, the deletion process fails with a timeout error. The timeout input argument is valid only when you are deleting a breakpoint.
delete delete(cc,'all','break',timeout) removes all of the valid breakpoints in the project source files. This command does not remove probe points and it does not remove invalid breakpoints. Note that you can use the optional input parameter timeout that determines how long Embedded IDE Link CC waits for a response to the request to delete all of the debug points. If the response is not received before the timeout period expires, the deletion process fails with a timeout error.
dir Purpose List files in current CCS IDE working directory Syntax dir(cc) Description dir(cc) lists the files and directories in the current CCS IDE working directory. This does not reflect your MATLAB software working directory or change the working directory. Use cd to change your CCS IDE working directory.
disable Purpose Disable RTDX interface, specified channel, or all RTDX channels Note Support for disable on C5000 and C6000 processors will be removed in a future version. Syntax disable(rx,'channel') disable(rx,'all') disable(rx) Description disable(rx,'channel') disables the open channel specified by the string channel, for rx. Input argument rx represents the RTDX portion of the associated link to CCS IDE. disable(rx,'all') disables all the open channels associated with rx.
disable See Also 7-48 close, enable, open
display Purpose Display properties of object that refers to CCS IDE or RTDX link Note display(rx) produces a warning on C5000 and C6000 processors and will be removed in a future version. Syntax display(cc) display(rx) display(objectname) display(cc.type) Description This function is similar to omitting the closing semicolon from an expression on the command line, except that display does not display the variable name.
display TICCS Object: API version Processor type Processor name Running? Board number Processor number Default timeout RTDX channels : : : : : : : 1.0 C67 CPU No 0 0 10.00 secs : 0 Using display with Multiprocessor Hardware To support boards that contain more than one processor, display behaves slightly differently when cc accesses multiprocessor boards. The syntax display(cc) returns information about all of the members of the object.
enable Purpose Enable RTDX interface, specified channel, or all RTDX channels Note Support for enable on C5000 and C6000 processors will be removed in a future version. Syntax enable(rx,'channel') enable(rx,'all') enable(rx) Description enable(rx,'channel') enables the open channel specified by the string channel, for RTDX link rx. The input argument rx represents the RTDX portion of the associated link to CCS IDE. enable(rx,'all') enables all the open channels associated with rx.
enable Examples To use channels to RTDX, you must both open and enable the channels: cc = ticcs; % Create a new connection to the IDE. enable(cc.rtdx) % Enable the RTDX interface. open(cc.rtdx,'inputchannel','w') % Open a channel for sending % data to the processor. enable(cc.rtdx,'inputchannel') % Enable the channel so you can use % it.
flush Purpose Flush data or messages from specified RTDX channels Note flush support C5000 and C6000 processors will be removed in a future version. Syntax flush(rx,channel,num,timeout) flush(rx,channel,num) flush(rx,channel,[],timeout) flush(rx,channel) flush(rx,'all') Description flush(rx,channel,num,timeout) removes num oldest data messages from the RTDX channel queue specified by channel in rx.
flush flush(rx,channel) removes all pending data messages from the RTDX channel queue specified by channel in rx. Unlike the preceding syntax options, you use this statement to remove messages for both read-configured and write-configured channels. flush(rx,'all') removes all data messages from all RTDX channel queues. When you use flush with a write-configured RTDX channel, Embedded IDE Link CC sends all the messages in the write queue to the processor.
get Purpose Access object properties Syntax get(cc,'propertyname') v = get(cc,'propertyname') get(rx,'propertyname') get(rx) v = get(rx) get(objname,'propertyname') Description get(cc,'propertyname') returns the property value associated with propertyname for link cc. v = get(cc,'propertyname') returns a structure v whose field names are the link cc property names and whose values are the current values of the corresponding properties. cc must be a link.
get Processor type Processor name Running? Board number Processor number Default timeout : : : : : : C67 CPU No 0 0 10.00 secs RTDX channels : 0 RTDX channels : 0 RTDX links work slightly differently—they have more syntaxes available. Create an alias rx to the RTDX portion of cc, then use the alias with get: rx=cc.rtdx RTDX channels : 0 get(rx) ans = numChannels: 0 RtdxChannel: {'' timeout: 10 [] ''} [] ''} v=get(rx) v = numChannels: 0 RtdxChannel: {'' timeout: 10 v.
halt Purpose Terminate execution of process running on processor Syntax halt(cc,timeout) halt(cc) Description halt(cc,timeout) immediately stops program execution by the processor. After the processor stops, halt returns to the host. timeout defines, in seconds, how long the host waits for the processor to stop running. To resume processing after you halt the processor, use run. Also, the read(cc,'pc') function can determine the memory address where the processor stopped after you use halt.
halt ans = 1 cc.isrunning % Alternate syntax for checking the run status. ans = 1 halt(cc) % Stop the running application on the processor. isrunning(cc) ans = 0 Issuing the halt stopped the process on the processor. Checking in CCS IDE shows that the process has stopped.
info Purpose Information about processor Note Support for info(rx) on C5000 and C6000 processors will be removed in a future version. Syntax info = info(cc) info = info(rx) Description info = info(cc) returns the property names and property values associated with the processor accessed by cc. info is a structure containing the following information elements and values: Structure Element Data Type Description info.procname String Processor name as defined in the CCS setup utility.
info Structure Element Data Type Description info.subfamily Decimal Decimal representation of the hexadecimal identification value that TI assigns to the processor to identify the processor subfamily. IDs range from 0x000 to 0x3822. Use dec2hex to convert the value in info.subfamily to standard notation. For example dec2hex(info.subfamily) produces ’67’ when the processor is a member of the 67xx processor family. info.
info family: 320 subfamily: 103 timeout: 10 This example simulates the TMS320C6211 processor running in little-endian mode. When you use CCS Setup Utility to change the processor from little-endian to big-endian, info shows the change. info(cc) ans = procname: isbigendian: family: subfamily: timeout: 'CPU' 1 320 103 10 If you have two open channels, chan1 and chan2, info = info(rx) returns info = 'chan1' 'chan2' where info is a cell array.
insert Purpose Add debug point to source file or address in CCS Syntax insert(cc,addr,'type') insert(cc,addr,'type',timeout) insert(cc,addr) insert(cc,filename,line,'type') insert(cc,filename,line,'type',timeout) insert(cc,filename,line) Description insert(cc,addr,'type') adds a debug point located at the memory address identified by addr for your processor digital signal processor. The link cc identifies which processor has the debug point to insert.
insert When you use the line input argument to insert a breakpoint on a specified line, line must represent a valid line. If line does not specify a valid line, insert returns an error and does not insert the breakpoint. Enter addr as a hexadecimal address, not as a ANSI C function name, valid ANSI C expression, or a symbol name. To learn more about the behavior of the various debugging points refer to your CCS documentation.
insert insert(cc,filename,line) defaults to type 'break' to insert a breakpoint. Example Open a project in CCS IDE, such as volume.pjt in the tutorial folder where you installed CCS IDE. Use Embedded IDE Link CC functions to open the project and activate the appropriate source file where you add the breakpoint. Remember to load the program file volume.out so you can access symbols and their addresses.
insert See Also address, remove, run 7-65
isenabled Purpose Determine whether RTDX link is enabled for communications Note Support for isenabled on C5000 and C6000 processors will be removed in a future version. Syntax isenabled(rx,'channel') isenabled(rx) Description isenabled(rx,'channel') returns ans=1 when the RTDX channel specified by string ’channel’ is enabled for read or write communications. When 'channel' has not been enabled, isenabled returns ans=0.
isenabled Note For isenabled to return reliable results, your processor must be running a loaded program. When the processor is not running, isenabled returns a status that may not represent the true state of the channels or RTDX. Examples With a program loaded on your processor, you can determine whether RTDX channels are ready for use. Restart your program to be sure it is running. The processor must be running for isenabled to work, as well as for enabled to work.
isreadable Purpose Determine whether MATLAB software can read specified memory block Note Support for isreadable(rx,'channel') on C5000 and C6000 processors will be removed in a future version. Syntax isreadable(cc,address,'datatype',count) isreadable(cc,address,'datatype') isreadable(rx,'channel') Description isreadable(cc,address,'datatype',count) returns 1 if the processor referred to by cc can read the memory block defined by the address, count, and datatype input arguments.
isreadable Examples of Address Property Values Property Value Address Type Interpretation ’1F’ String Location is 31 decimal on the page referred to by cc.page 10 Decimal Address is 10 decimal on the page referred to by cc.page [18,1] Vector Address location 10 decimal on memory page 1 (cc.page = 1) To specify the address in hexadecimal format, enter the address property value as a string. isreadable interprets the string as the hexadecimal representation of the desired memory location.
isreadable String Number of Bytes/Value Description 'int8' 1 Signed 8-bit integers 'int16' 2 Signed 16-bit integers 'int32' 4 Signed 32-bit integers 'single' 4 Single-precision floating point data 'uint8' 1 Unsigned 8-bit integers 'uint16' 2 Unsigned 16-bit integers 'uint32' 4 Unsigned 32-bit integers datatype Like the iswritable, write, and read functions, isreadable checks for valid address values.
isreadable family and 216 for the C5xxx series. When the function identifies an illegal address, it returns an error message stating that the address values are out of range. Note isreadable relies on the memory map option in CCS IDE. If you did not properly define the memory map for the processor in CCS IDE, isreadable does not produce useful results. Refer to your Texas Instruments’ Code Composer Studio documentation for information on configuring memory maps.
isrtdxcapable Purpose Determine whether processor supports RTDX Note Support for isrtdxcapable on C5000 and C6000 processors will be removed in a future version. Syntax b=isrtdxcapable(cc) Description b=isrtdxcapable(cc) returns b=1 when the processor referenced by object cc supports RTDX. When the processor does not support RTDX, isrtdxcapable returns b=0.
isrunning Purpose Determine whether processor is executing process Syntax isrunning(cc) Description isrunning(cc) returns 1 when the processor is executing a program. When the processor is halted, isrunning returns 0. Using isrunning with Multiprocessor Boards When your board contains more than one processor, isrunning checks each processor on the processor, as defined by the cc object, and returns the state for each processor on the board.
isrunning 1 halt(cc) isrunning(cc) ans = 0 See Also 7-74 halt, restart, run
isvisible Purpose Determine whether CCS IDE is running Syntax isvisible(cc) Description isvisible(cc) determines whether CCS IDE is running on the desktop and the window is open. If CCS IDE window is open, isvisible returns 1. Otherwise, the result is 0 indicating that CCS IDE is either not running or is running in the background. Examples Test to see if CCS IDE is running. Start CCS IDE. Then open MATLAB software.
isvisible visible(cc,0) isvisible(cc) ans = 0 Notice that CCS IDE is not visible on your desktop. Recall that MATLAB software did not open CCS IDE. When you close MATLAB software with CCS IDE in this invisible state, CCS IDE remains running in the background. To close it, do one of the following. • Open MATLAB software. Create a new link to CCS IDE. Use the new link to make CCS IDE visible. Close CCS IDE. • Open Microsoft Windows Task Manager. Click Processes. Find and highlight cc_app.exe.
iswritable Purpose Determine whether MATLAB software can write to specified memory block Note Support for iswritable(rx,'channel') on C5000 and C6000 processors will be removed in a future version.
iswritable For processors that have one memory page, setting the page value to 0 lets you specify all memory locations in the processor using the memory location without the page value. Examples of Address Property Values Property Value Address Type Interpretation 1F String Location is 31 decimal on the page referred to by cc.page 10 Decimal Address is 10 decimal on the page referred to by cc.page [18,1] Vector Address location 10 decimal on memory page 1 (cc.
iswritable iswritable writes 30 values to the processor. datatype — a string that represents a MATLAB data type. The total memory block size is derived from the value of count and the specified datatype. datatype determines how many bytes to check for each memory value.
iswritable Like the isreadable, read, and write functions, iswritable checks for valid address values. Illegal address values would be any address space larger than the available space for the processor – 232 for the C6xxx processor family and 216 for the C5xxx series. When the function identifies an illegal address, it returns an error message stating that the address values are out of range.
list Purpose Information listings from CCS Syntax list(ff,varname) infolist = list(cc,'type') infolist = list(cc,'type',typename) Note list(cc,type) produces an error. Description list(ff,varname) lists the local variables associated with the function accessed by function object ff. Compare to list(cc,'variable','varname') which works the same way to return variables from ticcs object cc.
list a function declaration to MATLAB software and the declaration string does not match the declaration for ff as determined when you created ff. In an example that demonstrates this problem, the function declaration has a name for the first input, a. In the declare call, the declaration string does not provide a name for the first input, just a data type, int. When you issue the declare call, MATLAB software names the first input ML_Input1.
list • When varname is an input to a library function. list always fails in this case. It does not matter whether you use declare to provide the declaration string for the library function. Note When you call list for a variable in a function object list(ff,varname)the address field may contain an incorrect address if the program counter is not within the scope of the function that includes varname when you call list.
list Also, list may report incorrect information when you make changes to variables from MATLAB software. To report variable information, list uses the CCS API, which only knows about variables in CCS. Your changes from MATLAB software, such as changing the data type of a variable, do not appear through the API and list. For example, the following operations return incorrect or old data information from list.
list infolist = list(cc,'project') returns a vector of structures containing project information in the format shown here when you specify option type as project. infolist Structure Element Description infolist(1).name Project file name (with path). infolist(1).type Project type — project,projlib, or projext, refer to new infolist(1).processortype String description of processor CPU infolist(1).srcfiles Vector of structures that describes project source files.
list infolist = list(cc,'variable’,varname) returns information about the specified variable varname. infolist = list(cc,’variable’,varnamelist) returns information about variables in a list specified by varnamelist. The information returned in each structure follows the format below when you specify option type as variable: infolist Structure Element Description infolist.varname(1).name Symbol name infolist.varname(1).isglobal Indicates whether symbol is global or local infolist.varname(1).
list returned information follows the same format as the syntax infolist = list(cc,'variable',...). infolist = list(cc,'function') returns a structure that contains information on all functions in the embedded program. infolist = list(cc,'function',functionname) returns a structure that contains information on the specified function functionname. infolist = list(cc,'function',functionnamelist) returns a structure that contains information on the specified functions in functionnamelist.
list infolist Structure Element Description infolist.functionname(1).linepos Start and end line positions of function infolist.functionname(1).funcinfo Miscellaneous information about the function infolist.functionname(2)... ... infolist.functionname(n)... ... To refer to the function structure information, list uses the function name as the field name. infolist = list(cc,'type') returns a structure that contains information on all defined data types in the embedded program.
list infolist Structure Element Description infolist.typename(2).... ... infolist.typename(n).... ... For the field name, list uses the type name to refer to the type structure information. The following list provides important information about variable and field names: • When a variable name, type name, or function name is not a valid MATLAB software structure field name, list replaces or modifies the name so it becomes valid.
list uclass: 'numeric' type: 'int' bitsize: 16 To demonstrate using list with a defined C type, variable typename1 includes the type argument. Because valid field names cannot contain the $ character, list changes the $ to DOLLAR. typename1 = '$fake3'; % name of defined C type with no tag list(cc,'type',typename1); ans = DOLLARfake0 : [typeinfo] ans.
load Purpose Transfer program file (*.out, *.obj) to processor in active project Syntax load(cc,'filename',timeout) load(cc,'filename') load(cc,'gelfilename',timeout) Description load(cc,'filename',timeout) loads the file specified by filename into the processor. filename can include a full path to a file, or just the name of a file that resides in the CCS working directory. Use cd to check or modify the working directory. Only use load with program files that are created by the CCS build process.
load GEL files folder in CCS. To remove GEL files, use remove. You can load any GEL file — you must be sure the GEL file is the correct one. load does not attempt to verify whether the GEL file is appropriate for your hardware or project. Examples Taken from the CCS link tutorial, this code prepares for and loads an object file filename.out to a processor. projfile =...
msgcount Purpose Number of messages in read-enabled channel queue Note Support for msgcount on C5000 and C6000 processors will be removed in a future version. Syntax msgcount(rx,'channel') Description msgcount(rx,'channel') returns the number of unread messages in the read-enabled queue specified by channel for the RTDX interface rx. You cannot use msgcount on channels configured for write access.
new Purpose Create and open text file, project, or build configuration in CCS IDE Note new(cc,objectname,'text') produces an error. Syntax new(cc,'objectname','type') new(cc,'objectname') Description new(cc,'objectname','type') creates and opens an empty object of type named objectname in the active project in CCS IDE. The new object can be a text file, a project, or a build configuration. String objectname specifies the name of the new object.
new type String Description 'project' Create a new project. 'projext' Create a new CCS external make project. Using this option indicates that your project uses and external makefile. Refer to your CCS documentation for more information about external projects. 'projlib' Create a new library project with the .lib file extension. Refer to your CCS documentation for more information about library projects. [] Create a new project. The [] indicate that you are creating a .pjt file.
new Caution After you create an object in CCS IDE, save the file in CCS IDE. new does not automatically save the file, and you lose your changes when you close CCS IDE. new(cc,'objectname') creates a project in CCS IDE, making it the active project. When you omit the type option, new assumes you are creating a new project and appends the .pjt extension to objectname to create the project objectname.pjt. The .pjt extension is the only extension new recognizes.
open Purpose Open channel to processor or load file into CCS IDE Note Support for open(rx,...) on C5000 and C6000 processors will be removed in a future version. open(cc,filename,'text') produces an error. open(cc,filename,'workspace') produces an error. open(cc,filename,'program') produces an error. Use load instead. Syntax open(rx,'channel1','mode1','channel2','mode2',...
open CCS IDE working directory, you can use a relative path, such as the name of the file. Note Program files (.out extension) and project files (.mak extension) are loaded on the processor referenced by your ticcs object. Workspace files are coupled to a specific processor. As a result, open loads workspace files to the processor that was active when you created the workspace file. This may not be the processor referred to by the object. Use cd to determine or change the CCS IDE working directory.
open period MATLAB software waits for the load. If MATLAB software waits more than timeout seconds, load returns immediately with a timeout error. Returning a timeout error does not suspend the operation; it stops MATLAB software from waiting for confirmation for the operation completion. open(cc,filename,filetype) loads filename into CCS IDE. filename can be the full path to the file or, if the file is in the current CCS IDE working directory, you can use a relative path, such as the name of the file.
open enable(rx,'ichannel'); When you are working with CCS IDE, open adopts a different operational form based on your input arguments for filename and the optional arguments filetype and timeout. In the CCS IDE variant, open loads the specified file into CCS IDE. For example, to load the tutorial program used in Getting Started with Automation Interface, use the following syntax cc = ticcs; cc.load(tutorial_6xevm.
profile Purpose Code execution and stack usage profile report Note The tic and raw profile report options that depend on DSP/BIOS will be removed in a future release. Use report for all profiling. Syntax ps=profile(cc, execution ,'format',timeout) ps=profile(cc,'execution','format') profile(cc,'stack','action') Description ps=profile(cc, execution ,'format',timeout) returns execution profile measurements from the generated code.
profile objects and DSP/BIOS, refer to your Texas Instruments documentation that came with CCS IDE. Note Profiling works with and without enabling DSP/BIOS in your project. To use DSP/BIOS, you must install Target Support Package TC6. To define how to return the profiling information, set the format input argument. format String Description raw Returns an unformatted list of the timing objects (profiling) information. Returns and formats all time-based objects.
profile format String raw report tic Profiling by Parameter DSP/BIOS Project Non-DSP/BIOS Project Task No No Atomic Subsystem Yes No Task No Yes Atomic Subsystem Yes Yes Task No No Atomic Subsystem Yes No The following examples show the different report formats that raw, report, and tic provide: • raw cpuload: error: avgperiod: rate: obj: 0 0 1000 1000 [4x1 struct] for k=1:length(ps.obj),disp(k),disp(ps.
profile 2 name: units: max: total: avg: pdfactor: count: 'processing_SWI' 'Hi Time' 1528 3052 1526 0.0075 2 3 name: units: max: total: avg: pdfactor: count: 'TSK_idle' 'Hi Time' -2.1475e+009 0 0 0.0075 0 4 name: units: max: total: avg: pdfactor: count: 'IDL_busyObj' 'User Def' -2.
profile cpuload: 0 obj: [3x1 struct] ps.obj(1) ans = name: units: max: avg: count: 'KNL_swi' 'Hi Time' 1.1759e-005 2.7597e-006 29 for k=1:length(ps.obj),disp(k),disp(ps.obj(k)),end; 1 name: units: max: avg: count: 'KNL_swi' 'Hi Time' 1.1759e-005 2.7597e-006 29 2 name: units: max: avg: count: 'processing_SWI' 'Hi Time' 1.1489e-005 1.1474e-005 2 3 name: units: max: avg: count: 'TSK_idle' 'Hi Time' -16.
profile When you choose raw, returned variable ps contains an undocumented list of the information provided by CCS IDE. The tic option provides the same information in ps, as a collection of fields. Fields in ps Description ps.cpuload Execution time in percent of total time spent out of the idle task. ps.obj Vector of defined STS objects in the project. ps.obj(n).name User-defined name for an STS object sts(n). Value for n ranges from 1 to the number of defined STS objects. ps.obj(n).
profile instrumentation in the project. You enable the DSP/BIOS report capability with the Profile performance at atomic subsystem boundaries option on the Target Support Package C6 pane on the Real-Time Workshop pane of the Simulink Configuration Parameters dialog box. ps=profile(cc,'execution','format') defaults to the timeout period specified in the ticcs object cc. profile(cc,'stack','action') returns the CPU stack usage from your application.
profile Report Entry Units Description endAddress Decimal address and page Lists the address of the end of the stack and the memory page. stackSize Addresses Reports number of address locations, in MAUs, allocated for the stack. growthDirection Not applicable Reports whether the stack grows from the lower address to the higher address (ascending) or from higher to lower (descending).
profile Using Profiling The following items affect your ability to profile project execution and stack usage: Execution profiling works on code you generate from a Simulink model. You cannot profile manually written code that you provide in your project. Stack profiling works with both model-generated code and your custom code. Stack profiling does not work when your project uses DSP/BIOS. You get an error when you profile the system stack with DSP/BIOS enabled.
profile units: max: avg: count: 'Hi Time' 1.1759e-005 2.7597e-006 29 for k=1:length(ps.obj),disp(k),disp(ps.obj(k)),end; 1 name: units: max: avg: count: 'KNL_swi' 'Hi Time' 1.1759e-005 2.7597e-006 29 2 name: units: max: avg: count: 'processing_SWI' 'Hi Time' 1.1489e-005 1.1474e-005 2 3 name: units: max: avg: count: 'TSK_idle' 'Hi Time' -16.1465 0 0 Omitting the format option caused profile to return the data fully formatted and slightly filtered.
profile cpuload: error: avgperiod: rate: obj: 0 0 1000 1000 [4x1 struct] for k=1:length(ps.obj),disp(k),disp(ps.obj(k)),end; 1 name: units: max: total: avg: pdfactor: count: 'KNL_swi' 'Hi Time' 1564 10644 367.0345 0.0075 29 2 name: units: max: total: avg: pdfactor: count: 'processing_SWI' 'Hi Time' 1528 3052 1526 0.0075 2 3 name: units: max: total: avg: pdfactor: count: 'TSK_idle' 'Hi Time' -2.1475e+009 0 0 0.
profile 4 name: units: max: total: avg: pdfactor: count: 'IDL_busyObj' 'User Def' -2.1475e+009 0 0 0 0 Your results can differ from this example depending on your computer and processor. The raw-format data in this example includes one extra timing object—IDL_busyObj. As defined in the .cdb file, this object is not time based (Units is 'User Def'). Specifying tic does not return the IDL_busyObj object. The following example demonstrates setting up and profiling the system stack.
profile profile(cc,'stack','report') % Request stack use report. Maximum stack usage: System Stack: 356/1024 (34.77%) MAUs used.
read Purpose Data from memory on processor or in CCS Syntax mem = read(cc,address,'datatype',count,timeout) mem = read(cc,address,'datatype',count) mem = read(cc,address,'datatype') Description ticcs Object Syntaxes mem = read(cc,address,'datatype',count,timeout) returns data from the processor referred to by cc. The address, count, and datatype input arguments define the memory block to be read. The data block to read begins at the memory location defined by address.
read decimal value. When the processor has only one memory page, as is true for many digital signal processors, the value of the page portion of the memory address is 0. By default, ticcs sets the page to 0 at creation if you omit the page property as an input argument. For processors that have one memory page, setting the page value to 0 lets you specify all memory locations in the processor using the memory location without the page value.
read Input Response n Read n values into a column vector. Return the vector in mem. [m,n] Read (m*n) values from memory into an m-by-n matrix in column major order. Return the matrix in mem. Read (m*n*p*...) values from the processor memory in column major order. Return the data in an m-by-n-by-p-by... multidimensional matrix and return the matrix in mem. datatype — a string that represents a MATLAB data type. The total memory block size is derived from the value of count and the specified datatype.
read Working with Negative Values Writing a negative value causes the data written to be saturated because char is unsigned on the processor. Hence, a 0 (a NULL) is written instead. A warning results as well, as this example shows. cc = ticcs; ff = createobj(cc,'g_char'); % Where g_char is in the code. write(ff,-100); Warning: Underflow: Saturation was required to fit the data into an addressable unit.
read defaults to a value of 1. This syntax reads one memory location of datatype. Note To ensure seamless read operation, use address to extract address values that are compatible with the alignment required by your processor.read does not force data type alignment in your processor memory. Certain combinations of address and datatype are difficult for some processors to use.
read 14 15 16 17 18 19 20 21 22 23 24 25 outdata now contains the values in indata, returned from the processor. As a further demonstration of read, try the following functions after you create a link cc and load an appropriate program to your processor. To perform the first example, var must exist in the symbol table loaded in CCS. • Read one 16-bit integer at the location of processor symbol var.
readmat Purpose Matrix of data from RTDX channel Note Support for readmat on C5000 and C6000 processors will be removed in a future version. Syntax data = readmat(rx,channelname,'datatype',siz,timeout) data = readmat(rx,channelname,'datatype',siz) Description data = readmat(rx,channelname,'datatype',siz,timeout) reads a matrix of data from an RTDX channel configured for read access. datatype defines the type of data to read, and channelname specifies the queue to read.
readmat Caution If the timeout period expires before the output data matrix is fully populated, you lose all the messages read from the channel to that point. MATLAB software supports reading five data types with readmat: datatype String Data Format 'double' Double-precision floating point values. 64 bits. 'int16' 16-bit signed integers 'int32' 32-bit signed integers 'single' Single-precision floating point values. 32 bits.
readmat open(rx,'ochannel','r'); enable(rx,'ochannel'); indata = 1:25; % Set up some data. write(cc,0,indata,30); outdata=read(cc,0,'double',25,10) outdata = Columns 1 through 13 1 2 3 4 5 6 7 8 9 20 21 22 10 11 12 13 Columns 14 through 25 14 15 16 17 18 19 23 24 25 Now use RTDX to read the data into a 5-by-5 array called out_array.
readmsg Purpose Read messages from specified RTDX channel Note Support for readmsg on C5000 and C6000 processors will be removed in a future version. Syntax data data data data data Description data = readmsg(rx,channelname,'datatype',siz,nummsgs,timeout) reads nummsgs from a channel associated with rx.
readmsg datatype String Specified Data Type 'single' Floating-point data, 32-bits (single-precision). 'uint8' Unsigned 8-bit integers. When you include the timeout input argument in the function, readmsg reads messages from the specified queue until it receives nummsgs, or until the period defined by timeout expires while readmsg waits for more messages to be available.
readmsg data = readmsg(rx,channelname,datatype,nummsgs) reads the number of messages defined by nummsgs. data becomes a cell array of row matrices, data = {msg1,msg2,...,msg(nummsgs)}, because siz defaults to [1,nummsgs]; each returned message becomes one row matrix in the cell array. Each row matrix contains one element for each data value in the current message msg# = [element(1), element(2),...,element(l)] where l is the number of data elements in message.
readmsg Columns 1 through 13 1 2 3 4 5 6 7 8 9 19 20 21 22 10 11 12 13 Columns 14 through 25 14 15 16 17 18 23 24 25 Now use RTDX to read the messages into a 4-by-5 array called out_array. number_msgs = msgcount(rx,'ochannel') % Check number of msgs % in read queue. out_array = cc.rtdx.
regread Purpose Value from processor register Syntax reg = regread(cc,'regname','represent',timeout) reg = regread(cc,'regname','represent') reg = regread(cc,'regname') Description reg = regread(cc,'regname','represent',timeout) reads the data value in the regname register of the processor and returns the value in reg as a double-precision value. For convenience, regread converts each return value to the MATLAB software double datatype.
regread The represent input argument defines the format of the data stored in regname. Input argument represent takes one of three input strings: represent String Description '2scomp' Source register contains a signed integer value in two’s complement format. This is the default setting when you omit the represent argument. 'binary' Source register contains an unsigned binary integer. 'ieee' Source register contains a floating point 32-bit or 64-bit value in IEEE floating-point format.
regread later. Therefore, getting the values of register variables during program execution may return unexpected answers. Values that you write to register variables during intermediate times in program operation may not get reflected in the register. This is true for local variables as well. One way to see this is to write a line of code that uses the variable and see if the result is consistent. register int a = 100; int b; ...
regread For processors in the C6xxx family, regread lets you access processor registers directly. To read the value in general purpose register A0, type the following function. treg = cc.regread('A0','2scomp'); treg now contains the two’s complement representation of the value in A0. Now read the value stored in register B2 as an unsigned binary integer, by typing cc.
regwrite Purpose Write data values to registers on processor Syntax regwrite(cc,'regname',value,'represent',timeout) regwrite(cc,'regname',value,'represent') regwrite(cc,'regname',value,) Description regwrite(cc,'regname',value,'represent',timeout) writes the data in value to the regname register of the processor. regwrite converts value from its representation in the MATLAB workspace to the representation specified by represent.
regwrite processor family provides the following register names that are valid entries for regname: Register Names Register Contents A0, A1, A2,..., A15 General purpose A registers B0, B1, B2,..., B15 General purpose B registers PC, ISTP, IFR, IRP, NRP, AMR, CSR Other general purpose 32-bit registers A1:A0, A2:A1,..., B15:B14 64-bit general purpose register pairs Other processors provide other register sets.
regwrite Reading and Writing Register Values Register variables can be difficult to read and write because the registers which hold their value are not dedicated to storing just the variable values. Registers are used as temporary storage locations at any time during execution. When this temporary storage process occurs, the value of the variable is temporarily stored somewhere on the stack and returned later.
regwrite regwrite(cc,'b1:b0',hex2dec('1010'),'ieee') Registers B1:B0 now contain the value 4112 in double-precision format.
reload Purpose Reload most recent program file to processor signal processor Syntax s = reload(cc,timeout) s = reload(cc) Description s = reload(cc,timeout) resends the most recently loaded program file to the processor. If you have not loaded a program file in the current session (so there is no previously loaded file), reload returns the null entry [] in s indicating that it could not load a file to the processor. Otherwise, s contains the full path name to the program file.
reload cc=ticcs; s=reload(cc,23) Warning: No action taken - load a valid Program file before you reload... s = '' open(cc,'D:\ti\tutorial\sim62xx\gelsolid\hellodsp.pjt',... 'project') build(cc) load(cc,'hellodsp.pjt') halt(cc) s=reload(cc,23) s = D:\ti\tutorial\sim62xx\gelsolid\Debug\hellodsp.
remove Purpose Remove file from active CCS IDE project Syntax remove(cc,'filename') remove(cc,'gelfilename') Description remove(cc,'filename') deletes the file specified by filename from the active project in CCS IDE. You can remove files that exist in the active project only. filename must match the name of an existing file exactly to remove the file. remove(cc,'gelfilename') deletes the file specified by gelfilename from the active project in CCS IDE.
reset Purpose Reset processor Syntax reset(cc,timeout) reset(cc) Description reset(cc,timeout) stops program execution on the processor and asynchronously performs a processor reset, returning all processor register contents to their power up settings. The reset function returns after the processor halts. To allow you to determine how long reset waits for the processor to halt, input option timeout lets you set the waiting period in seconds.
restart Purpose Restore program counter to entry point for current program Syntax restart(cc,timeout) restart(cc) Description restart(cc,timeout) halts the processor immediately and resets the program counter (PC) to the program entry point for the loaded program. Use run to execute the program after you use restart. restart does not execute the program after resetting the PC. timeout allows you to specify how long restart waits for the processor to stop and return the PC to the program entry point.
restart When your process gets lost or halts, restart is a quick way to restore your program.
run Purpose Execute program loaded on processor Syntax run(cc,'state',timeout) run(cc,'main') run(cc,'tofunc','functionname') Description run(cc,'state',timeout) starts to execute the program loaded on the processor referred to by cc. Program execution starts from the location of the program counter. After starting program execution, the input argument state determines when you regain program control.
run state String Run Action 'tofunc' Run the program from the current position of the program counter to the start of a specified function functionname. 'tohalt' Changes the state of a running process to runtohalt, and waits for the processor to halt before returning. Use this when you want to stop a running process cleanly. If the processor is already stopped when you use this state setting, run returns immediately.
run Examples After you build and load a program to your processor, use run to start execution. cc = ticcs('boardnum',0,'procnum',0); % Create a link to CCS % IDE. cc.load('tutorial_6xevm.out'); % Load an executable file to the % processor. cc.rtdx.configure(1024,4); % Configure four buffers for data % transfer needs. cc.rtdx.open('ichan','w'); % Open RTDX channels for read and % write. cc.rtdx.enable('ichan'); cc.rtdx.open('ochan','r'); cc.rtdx.enable('ochan'); cc.
run configure(rx,1024,4); See Also 7-144 halt, isrunning, restart
save Purpose Save files and projects in CCS IDE Note save(cc,filename,'text') produces an error. Syntax save(cc,'filename','type') Description save(cc,'filename','type') save the file in CCS IDE identified by filename of type ’type’. type identifies the type of file to save, either project files when you use ’project' for type, or text files when you use 'text' for the type option. To save a specific file in CCS IDE, filename must match the name of the file to save exactly.
save Command Result save(cc,'all','text') Save all open text files. Includes source files, libraries, command files, and others. save(cc,'my_source.cpp','text') Save the text file my_source.cpp. save(cc,[],'text') See Also 7-146 add, cd, close, open Save the active file window.
symbol Purpose Program symbol table from CCS IDE Syntax s = symbol(cc) Description s = symbol(cc) returns the symbol table for the program loaded in CCS IDE. symbol only applies after you load a processor program file. s is an array of structures where each row in s presents the symbol name and address in the table. Therefore, s has two columns; one is the symbol name, and the other is the symbol address and symbol page.
symbol c6711dskafxr; Now set the simulation parameters for the model and build the model to your processor. With the model loaded on your processor, use symbol to return the entries stored in the symbol table in CCS IDE. cc = ticcs; s = symbol(cc); s contains all the symbols and their addresses, in a structure you can display with the following code: for k=1:length(s),disp(k),disp(s(k)),end; MATLAB software lists the symbols from the symbol table in a column.
ticcs Purpose Create object that refers to CCS IDE Syntax cc = ticcs cc = ticcs('propertyname’,'propertyvalue’,...) Description cc = ticcs returns a ticcs object in cc that MATLAB software uses to communicate with the default processor. In the case of no input arguments, ticcs constructs the object with default values for all properties. CCS IDE handles the communications between MATLAB software and the selected CPU. When you use the function, ticcs starts CCS IDE if it is not running.
ticcs Object 7-150 Property Name Property Default Description 'status' Running No Status of the program currently loaded on the processor 'boardnum' Board Number 0 Number that CCS assigns to the board. Used to identify the board 'procnum' Processor number 0 Number the CCS assigns to a processor on a board 'timeout' Default timeout 10.0 s Specifies how long MATLAB software waits for a response from CCS after issuing a request. This also applies when you try to construct a ticcs object.
ticcs Object Property Name Property Default Description rtdx 'timeout' Timeout 10.0 s Specifies how long CCS waits for a response from the processor after requesting data 'numchannels' Number of open channels 0 The number of open channels using this link type Defined types in the object Void, Float, Double, Long, Int, Short, Char List of the C data types in the project cc accesses. Use add to include your C type definitions to the list type cc = ticcs('propertyname’,'propertyvalue’,...
ticcs Given these two properties, the most common forms of the ticcs method are cc = ticcs('boardnum',value) cc = ticcs('boardnum',value,'procnum',value) cc = ticcs(...,'timeout',value) which specify the board, and processor in the second example, as the processor. The third example adds the timeout input argument and value to allow you to specify how long MATLAB software waits for the connection to the processor or the response to a command to return completed.
ticcs Using ticcs with Multiple Processor Boards When you create ticcs objects that access boards that contain more than one processor, such as the OMAP1510 platform, ticcs behaves a little differently. For each of the ticcs syntaxes above, the result of the method changes in the multiple processor case, as follows. cc = ticcs cc = ticcs('propertyname',propertyvalue) cc = ticcs('propertyname',propertyvalue,'propertyname',...
ticcs You can include both the board number and the processor number in the ticcs syntax, as shown here: cc = ticcs('boardnum',2,'procnum',[0 1]) Array of TICCS Objects: API version : 1.2 Board name : OMAP 3.
ticcs API version Board name : 1.2 : OMAP 3.0 Platform Simulator [Texas Instruments] Board number : 2 Processor 0 (element 1) : TMS470R2127 (MPU, Not Running) Processor 1 (element 2) : TMS320C5500 (DSP, Not Running) Checking the existing boards shows that board 2 does have two processors: ccsboardinfo Board Board Proc Processor Processor Num Num Type --- Examples Name ---------------------------------- --- Name --------------- 2 OMAP 3.0 Platform Simulator [T ...
ticcs which sets the default property value procnum= 0 to connect to the processor on the third board. cc = ticcs TICCS Object: API version : 1.2 Processor type : TMS320C6711 Processor name : CPU_1 Running? : No Board number : 1 Processor number : 0 Default timeout RTDX channels cc.type : 10.
visible Purpose Set whether CCS IDE window is visible while CCS runs Syntax visible(cc,state) Description visible(cc,state) sets CCS IDE to be visible or not visible on the desktop. Input argument state accepts either 0 or 1 to set the visibility. Setting state equal to 0 makes CCS IDE not visible on the desktop. However, the CCS IDE process runs in the background while the window is not visible.
visible For more information about visibility and CCS, refer to “Running Code Composer Studio Software on Your Desktop — Visibility” on page 2-6. Examples Test to see whether CCS IDE is running. Then change the visibility and check again. Start CCS IDE. Then open MATLAB software and at the prompt, enter cc=ticcs; MATLAB software creates a link to CCS IDE and leaves CCS IDE visible on your desktop. isvisible(cc) ans = 1 Now, change the visibility state to 0, or invisible, and check the state.
write Purpose Write data to memory on processor Syntax write(cc,address,data,timeout) write(cc,address,data) Description ticcs Object Syntaxes write(cc,address,data,timeout) sends a block of data to memory on the processor referred to by cc. The address and data input arguments define the memory block to write—where the memory starts and what data is being written. The memory block to write to begins at the memory location defined by address.
write When the processor has only one memory page, as is true for many digital signal processors, the value of the page portion of the memory address is 0. By default, ticcs sets the page value to 0 at creation if you omit page as an input argument. For processors that have one memory page, setting the page value to 0 lets you specify all memory locations in the processor using the memory location without the page value.
write Datatypes Description int16 Signed 16-bit integers int32 Signed 32-bit integers single Single-precision floating point data uint8 Unsigned 8-bit integers uint16 Unsigned 16-bit integers uint32 Unsigned 32-bit integers To limit the time that write spends transferring data from the processor, the optional argument timeout tells the data transfer process to stop after timeout seconds. timeout out is defined as the number of seconds allowed to complete the write operation.
write Writing Negative Values Writing a negative value causes the data written to be saturated because char is unsigned on the processor. Hence, a 0 (a NULL) is written instead. A warning results as well, as this example shows. cc = ticcs; ff = createobj(cc,'g_char'); % Where g_char is in the code. write(ff,-100); Warning: Underflow: Saturation was required to fit the data into an addressable unit.
write It may be more convenient to return the data in an array. If you enter a vector for count, mem contains a matrix of dimensions the same as vector count.
writemsg Purpose Write messages to specified RTDX channel Note Support for writemsg on C5000 and C6000 processors will be removed in a future version. Syntax data = writemsg(rx,channelname,data) data = writemsg(rx,channelname,data) Description data = writemsg(rx,channelname,data) writes data to a channel associated with rx. channelname identifies the channel queue, which must be configured for write access. All messages must be the same type for a single write operation.
writemsg enable(rx,'ichannel'); inputdata(1:25); writemsg(rx,'ichannel',int16(inputdata)); As a further illustration, the following code snippet writes the messages in matrix indata to the write-enabled channel specified by ichan. Note again that this example works only when ichan is defined by the program on the processor and enabled for write access. indata = [1 4 7; 2 5 8; 3 6 9]; writemsg(cc.rtdx,'ichan',indata); The matrix indata is written by column to ichan.
writemsg 7-166
8 Block Reference
8 Block Reference C280x/C28x3x DSP Chip Support (ccslinklib_c280x) C280x/C28x3x Hardware Interrupt Interrupt Service Routine to handle hardware interrupt on C280x/C28x3x processors C281x DSP Chip Support (ccslinklib_c281x) C281x Hardware Interrupt Interrupt Service Routine to handle hardware interrupt C5xxx DSP Chip Support (ccslinklib_c5xxx) Hardware Interrupt Interrupt Service Routine to handle hardware interrupt on C5000 and C6000 processors C6xxx DSP Chip Support (ccslinklib_c6xxx) Hardware Inte
Core Support (ccslinklib_core) Core Support (ccslinklib_core) Idle Task Create free-running task Memory Allocate Allocate memory section Memory Copy Copy to and from memory section Target Preferences (ccslinklib_tgtpref) Target Preferences Configure model for Texas Instruments processor 8-3
8 8-4 Block Reference
9 Blocks — Alphabetical List
C280x/C28x3x Hardware Interrupt Purpose Interrupt Service Routine to handle hardware interrupt on C280x/C28x3x processors Library ccslinklib_c280x in Embedded IDE Link CC Description For many systems, an execution scheduling model based on a timer interrupt is not sufficient to ensure a real-time response to external events.
C280x/C28x3x Hardware Interrupt Each interrupt is described by: • CPU interrupt numbers • PIE interrupt numbers • Task priorities • Preemption flags So one interrupt is described by a CPU interrupt number, a PIE interrupt number, a task priority, and a preemption flag. The CPU and PIE interrupt numbers together uniquely specify a single interrupt for a single peripheral or peripheral module. The following table maps CPU and PIE interrupt numbers to these peripheral interrupts.
9-4 12 11 10 9 8 7 6 5 4 3 2 1 Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved (CAN-B) Reserved Reserved Reserved (CAN-B) Reserved Reserved Reserved (ePWM5) (ePWM4) (ePWM3) Reserved (ePWM2) (ADC) SEQ2INT (ePWM1) (ADC) SEQ1INT Reserved Reserved (SPI-C) SPITXINTC Reserved Reserved (ePWM6) Reserved Reserved Reserved (CAN-A) Reserved Reserved Reserved (CAN-A) ECAN0INTA Reserved Reserved (SPI-C) SPIRXINTC Reserved Reserved (ePWM5)
C280x/C28x3x Hardware Interrupt The task priority indicates the relative importance tasks associated with the asynchronous interrupts. If an interrupt triggers a higher-priority task while a lower-priority task is running, the execution of the lower-priority task will be suspended while the higher-priority task is executed. The lowest value represents the highest priority.
C280x/C28x3x Hardware Interrupt See the table of C280x Peripheral Interrupt Vector Values for a mapping of CPU interrupt number to interrupt names. PIE interrupt numbers Enter a vector of PIE interrupt numbers for the interrupts you want to process asynchronously. See the table of C280x Peripheral Interrupt Vector Values for a mapping of CPU interrupt number to interrupt names. Simulink task priorities Enter a vector of task priorities for the interrupts you want to process asynchronously.
C280x/C28x3x Hardware Interrupt See Also The following links refer to block reference pages that require the Target Support Package TC2 software.
C281x Hardware Interrupt Purpose Interrupt Service Routine to handle hardware interrupt Library ccslinklib_c281x in Embedded IDE Link CC Description For many systems, an execution scheduling model based on a timer interrupt is not sufficient to ensure a real-time response to external events. The C281x Hardware Interrupt block addresses this problem by allowing for the asynchronous processing of interrupts triggered by events managed by other blocks in the C281x DSP Chip Support Library.
C281x Hardware Interrupt Each interrupt is represented by one element from each parameter (four elements total), one from the same position in each of these vectors. Each interrupt is described by: • CPU interrupt numbers • PIE interrupt numbers • Task priorities • Preemption flags So one interrupt is described by a CPU interrupt number, a PIE interrupt number, a task priority, and a preemption flag.
9-10 (EV-A) (EV-A) Reserved Reserved Reserved 10 11 12 Reserved Reserved Reserved Reserved Reserved 9 Reserved Reserved 8 Reserved Reserved Reserved Reserved Reserved Reserved (CAN) Reserved ECAN0INT (CAN) Reserved Reserved ECAN1INT Reserved Reserved MRINT (McBSP) MXINT (EV-B) CAPINT4 (EV-B) T3CINT (EV-A) CAPINT1 (EV-A) T1CINT XINT2 5 (McBSP) (EV-B) Reserved CAPINT5 (EV-B) (EV-B) CAPINT6 T3UFINT (EV-B) (EV-A) (EV-A) T3OFINT CAPINT2 CAPINT3 Reserved Reserv
C281x Hardware Interrupt The task priority indicates the relative importance tasks associated with the asynchronous interrupts. If an interrupt triggers a higher-priority task while a lower-priority task is running, the execution of the lower-priority task will be suspended while the higher-priority task is executed. The lowest value represents the highest priority.
C281x Hardware Interrupt CPU interrupt numbers Enter a vector of CPU interrupt numbers for the interrupts you want to process asynchronously. See the table of C281x Peripheral Interrupt Vector Values for a mapping of CPU interrupt number to interrupt names. PIE interrupt numbers Enter a vector of PIE interrupt numbers for the interrupts you want to process asynchronously. See the table of C281x Peripheral Interrupt Vector Values for a mapping of CPU interrupt number to interrupt names.
C281x Hardware Interrupt References Detailed information interrupt processing is in TMS320x281x DSP System Control and Interrupts Reference Guide, Literature Number SPRU078C, available at the Texas Instruments Web site. See Also The following links to block reference pages require that Target Support Package TC2 is installed.
Hardware Interrupt Purpose Interrupt Service Routine to handle hardware interrupt on C5000 and C6000 processors Library C5000 DSP Chip Support in Embedded IDE Link CC C6000 DSP Chip Support in Embedded IDE Link CC Description Create interrupt service routines (ISR) in the software generated by the build process.
Hardware Interrupt Processor Family Valid Interrupt Numbers C5xxx 2, 3, 5-21, 23 C6xxx 4-15 The width of the block output signal corresponds to the number of interrupt numbers specified here. Combined with the Simulink task priorities that you enter and the preemption flag you enter for each interrupt, these three values define how the code and processor handle interrupts during asynchronous scheduler operations.
Hardware Interrupt the interrupts in Interrupt numbers. If Interrupt numbers contains more than one interrupt, and you enter only one flag value in this field, that status applies to all interrupts. In the default settings [0 1], the interrupt with priority 5 in Interrupt numbers is not preemptible and the priority 8 interrupt can be preempted. Enable simulation input When you select this option, Simulink software adds an input port to the Hardware Interrupt block. This port is used in simulation only.
Idle Task Purpose Create free-running task Library Cxxxx DSP Chip Support in Embedded IDE Link CC Description The Idle Task block, and the subsystem connected to it, specify one or more functions to execute as background tasks. All tasks executed through the Idle Task block are of the lowest priority, lower than that of the base rate task. Vectorized Output The block output comprises a set of vectors—the task numbers vector and the preemption flag or flags vector.
Idle Task Dialog Box Task numbers Identifies the created tasks by number. Enter as many tasks as you need by entering a vector of integers. The default values are [1,2] to indicate that the downstream subsystem has two functions. The values you enter determine the execution order of the functions in the downstream subsystem, while the number of values you enter corresponds to the number of functions in the downstream subsystem.
Idle Task For example, entering [2,3,1] in this field indicates that there are three functions to be executed, and that the third function is executed first, the first function is executed second, and the second function is executed third. After all functions are executed, the Idle Task block cycles back and repeats the execution of the functions in the same order. Preemption flags Higher-priority interrupts can preempt interrupts that have lower priority.
Memory Allocate Purpose Allocate memory section Library Cxxxx DSP Chip Support in Embedded IDE Link CC Description On C2xxx, C5xxx, or C6xxx processors, this block directs the TI compiler to allocate memory for a new variable you specify. Parameters in the block dialog box let you specify the variable name, the alignment of the variable in memory, the data type of the variable, and other features that fully define the memory required.
Memory Allocate The following sections describe the contents of each pane in the dialog box.
Memory Allocate Memory Parameters You find the following memory parameters on this tab. Variable name Specify the name of the variable to allocate. The variable is allocated in the generated code.
Memory Allocate Specify variable alignment Select this option to direct the compiler to align the variable in Variable name to an alignment boundary. When you select this option, the Memory alignment boundary parameter appears so you can specify the alignment. Use this parameter and Memory alignment boundary when your processor requires this feature. Memory alignment boundary After you select Specify variable alignment, this option enables you to specify the alignment boundary in bytes.
Memory Allocate Section Parameters Parameters on this pane specify the section in memory to store the variable. Specify memory section Selecting this parameter enables you to specify the memory section to allocate space for the variable.
Memory Allocate standard memory sections or a custom section that you declare elsewhere in your code. Memory section Identify a specific memory section to allocate the variable in Variable name. Verify that the section has sufficient space to store your variable. After you specify a memory section by selecting Specify memory section and entering the section name in Memory section, use Bind memory section to bind the memory section to a location.
Memory Copy Purpose Copy to and from memory section Library Cxxx DSP Chip Support in Embedded IDE Link CC Description In generated code, this block copies variables or data from and to processor memory as configured by the block parameters. Your model can contain as many of these blocks as you require to manipulate memory on your processor. Each block works with one variable, address, or set of addresses provided to the block.
Memory Copy control when and how the block initializes memory, copies to and from memory, and terminates memory operations. The parameters enable you to turn on and off memory operations in all three periods independently. Used in combination with the Memory Allocate block, this block supports building custom device drivers, such as PCI bus drivers or codec-style drivers, by letting you manipulate and allocate memory. This block does not require the Memory Allocate block to be in the model.
Memory Copy Sections that follow describe the parameters on each tab in the dialog box.
Memory Copy Source Parameters Copy from Select the source of the data to copy. Choose one of the entries on the list: • Input port — This source reads the data from the block input port.
Memory Copy • Specified address — This source reads the data at the specified location in Specify address source and Address. • Specified source code symbol — This source tells the block to read the symbol (variable) you enter in Source code symbol. When you select this copy from option, you enable the Source code symbol parameter. Note If you do not select Input port for Copy from, change Data type from the default Inherit from source to one of the data types on the Data type list.
Memory Copy Address When you select Specify via dialog for the address source, you enter the variable address here. Addresses should be in decimal form. Enter either the decimal address or the address as a hexadecimal string with single quotations marks and use hex2dec to convert the address to the proper format. The following example converts Ox1000 to decimal form. 4096 = hex2dec('1000'); For this example, you could enter either 4096 or hex2dec('1000') as the address.
Memory Copy Offset Offset tells the block whether to copy the first element of the data at the input address or value, or skip one or more values before starting to copy the input to the destination. Offset defines how many values to skip before copying the first value to the destination. Offset equal to one is the default value and Offset accepts only positive integers of one or greater. Stride Stride lets you specify the spacing for reading the input.
Memory Copy 9-33
Memory Copy 9-34
Memory Copy Destination Parameters Copy to Select the destination for the data. Choose one of the entries on the list: • Output port — Copies the data to the block output port. From the output port the block passes data to downstream blocks in the code. • Specified address — Copies the data to the specified location in Specify address source and Address.
Memory Copy • Specified source code symbol — Tells the block to copy the variable or symbol (variable) to the symbol you enter in Source code symbol. When you select this copy to option, you enable the Source code symbol parameter. Depending on the choice you make for Copy from, you see other parameters that let you configure the source of the data to copy.
Memory Copy For this example, you could enter either 8192 or hex2dec('2000') as the address. Data type Use this parameter to specify the type of data that your variable uses. The list includes the supported data types, such as int8, uint32, and Boolean, and the option inherit from source for inheriting the data type for the variable from the block input port. Specify offset source The block provides two sources for the offset—Input port and Specify via dialog.
Memory Copy the figure, you can use both an input stride and output stride at the same time to enable you to manipulate your memory more fully. Sample time Sample time sets the rate at which the memory copy operation occurs, in seconds. The default value Inf tells the block to use a constant sample time.
Memory Copy or the Simulink software model (when there are no input ports on the block). Enter the sample time in seconds as you need.
Memory Copy Options Parameters 9-40
Memory Copy Set memory value at initialization When you check this option, you direct the block to initialize the memory location to a specific value when you initialize your program at run time. After you select this option, use the Set memory value at termination and Specify initialization value source parameters to set your desired value. Alternately, you can tell the block to get the initial value from the block input.
Memory Copy Checking this parameter enables the Bitwise operator parameter for you to define how to apply the mask value. To use your initialization value as a mask, the output from the copy has to be a specific address. It cannot be an output port, but it can be a symbol. Bitwise operator To use the initialization value as a mask, select one of the entries on the following table from the Bitwise operator list to describe how to apply the value as a mask to the memory value.
Memory Copy Applying a mask to the copy process lets you select individual bits in the result, for example, to read the value of the fifth bit by applying the mask. Set memory value at termination Along with initializing memory when the program starts to access this memory location, this parameter directs the program to set memory to a specific value when the program terminates.
Memory Copy Use QDMA for copy (if available) For processors that support quick direct memory access (QDMA), select this parameter to enable the QDMA operation and to access the blocking mode parameter. If you select this parameter, your source and destination data types must be the same or the copy operation returns an error. Also, the input and output stride values must be one.
Target Preferences Purpose Configure model for Texas Instruments processor Library Target Preferences in Embedded IDE Link CC Description Options on the block dialog box let you set features of code generation for your custom C2xxx, F28xx, C5xxx, and C6xxx processor-based board.
Target Preferences memory map for your processor. Both steps are essential for generating code for any board that is custom or explicitly supported, such as the C6711 DSK or the DM642 EVM. Unlike most other blocks, you cannot open the block dialog box until you add the block to a model. When you open the block dialog, the block attempts to connect to your processor. It cannot make the connection when the block is in the library and returns an error message.
Target Preferences Target Preferences block dialog boxes provide tabbed access to the following panes with options you set for the processor and board: • Board info — Select the processor, set the clock speed, and identify the processor. In addition, Add new on this pane opens the New Processor dialog box. • Memory — Set the memory allocation and layout on the processor (memory mapping).
Target Preferences • Sections — Determine the arrangement and location of the sections on the processor such as where to put the DSP/BIOS and compiler information. • DSP/BIOS — (Optional) Specify how to configure tasking features of DSP/BIOS. • Peripherals — (Only for C2xxx family processors) Specify how to configure the peripherals provided by C2xxx processors, such as the SPI_A, SPI_B, GPIO, or eCAP peripherals.
Target Preferences Adding the new processor puts the processor on the Processor list for all Target Preferences blocks, not just this one. The new processor and configuration become available for all models that include a Target Preferences block. For details about the New Processor dialog box, refer to New Processor Dialog Box. Edit Edit the configuration for the processor you select on the Processor list. Delete Delete a processor that you added to the Processor list.
Target Preferences Correctly generating interrupts for your model depends on the clock rate of the CPU on your processor. You can change the rate with the DIP switches on the board or from one of the Texas Instruments software utilities. For the timer software to calculate the interrupts correctly, Embedded IDE Link CC needs to know the actual clock rate of your processor as you configured it.
Target Preferences Enable High-Speed RTDX Select this option to tell the code generation process to enable high-speed RTDX for this model. Operating System Specify whether to use a real-time operating system (RTOS) with your model. Choose DSP/BIOS from the list to add the DSP/BIOS RTOS features to your project. Select None to disable the DSP/BIOS features. You must have Target Support Package TC6 software installed to access this option.
Target Preferences Note When you enter a file path, library, or function, the block does not verify that the path or function exists or is valid. Invalid or incorrect entries in these fields may cause errors during code generation. To enter a path to a file, library, or other custom code, use the following string in the path to refer to the CCS installation directory. $(install_dir) Enter new paths or files (custom code items) one entry per line.
Target Preferences The Memory pane contains memory options for three kinds of memory: • Physical Memory — Specifies the processor and board memory map • Heap — Specifies whether you use a heap and determines the size in words • Cache Configuration — Select a cache configuration where available, such as L2 cache, and select one of the corresponding configuration options, such as 32kb.
Target Preferences Be aware that these options may affect the options on the Sections pane. You can make selections here that change how you configure options on the Sections pane. Most of the information about memory segments and memory allocation is available from the online help system for CCS. Physical Memory Options This list shows the physical memory segments available on the board and processor. By default, Target Preferences blocks show the memory segments found on the selected processor.
Target Preferences After you add the segment, you can configure the starting address, length, and contents for the new segment. New segments start with code and data as the type of content that can be stored in the segment (refer to the Contents option). Names are case sensitive. NewSegment is not the same as newsegment or newSegment. Address Address reports the starting address for the memory segment showing in Name.
Target Preferences Add Click Add to add a new memory segment to the processor memory map. When you click Add, a new segment name appears, for example NEWMEM1, in Name and on the Memory bank list list. In Name, change the temporary name NEWMEM1 by entering the new segment name. Entering the new name, or clicking Apply, updates the temporary name on the list to the name you enter. Remove This option lets you remove a memory segment from the memory map.
Target Preferences Heap Size After you select Create heap, this option lets you specify the size of the heap in words. Enter the number of words in decimal format. When you enter the heap size in decimal words, the system converts the decimal value to hexadecimal format. You can enter the value directly in hexadecimal format as well. Processors may support different maximum heap sizes. Define Label Selecting Create heap enables this option that allows you to name the heap.
Target Preferences Cache level lets you select one of the available cache levels to configure by selecting one of its configurations. For example, you can select L2 cache level and choose one of its configurations, such as 32kB. Sections Pane Options on this pane let you specify where various program sections should go in memory. Program sections are distinct from memory segments—sections are portions of the executable code stored in contiguous memory locations. Commonly used sections include .text, .
Target Preferences Within this pane, you configure the allocation of sections for Compiler, DSP/BIOS, and Custom needs. This table provides brief definitions of the kinds of sections in the Compiler sections, DSP/BIOS sections/objects, and Custom sections lists in the pane. All sections do not appear on all lists. The list the string appears on is shown in the table.
Target Preferences 9-60 String Section List Description of the Section Contents .args DSP/BIOS Argument buffers .bss Compiler Static and global C variables in the code .bios DSP/BIOS DSP/BIOS code if you are using DSP/BIOS options in your program .cinit Compiler Tables for initializing global and static variables and constants .cio Compiler Standard I/O buffer for C programs .const Compiler Data defined with the C qualifier and string constants .
Target Preferences String Section List Description of the Section Contents .sysinit DSP/BIOS DSP/BIOS initialization startup code .sysmem Compiler Dynamically allocated object in the code containing the heap .text Compiler Load allocation for the literal strings, executable code, and compiler generated constants .trcdata DSP/BIOS TRC mask variable and its initial value section load allocation You can learn more about memory sections and objects in your Code Composer Studio online help.
Target Preferences Custom sections list contains no fixed entries, but instead, only a placeholder for a section for you to define. Name You enter the name for your new section here. To add a new section, click Add. Then, replace the temporary name with the name to use. Although the temporary name includes a period at the beginning you do not need to include the period in your new name. Names are case sensitive. NewSection is not the same as newsection, or newSection.
Target Preferences When you set the Operating system option to None, you disable the options in this pane. For more information about tasks, refer to the Code Composer Studio online help. Within this pane, you configure the options for DSP/BIOS tasks.
Target Preferences DSP/BIOS sections/objects During program compilation, DSP/BIOS produces both uninitialized and initialized blocks of data and code. These blocks get allocated into memory as required by the configuration of your system. On the DSP/BIOS sections list you find both initialized (sections that contain data or executable code) and uninitialized (sections that reserve space in memory) sections.
Target Preferences use more memory than you allocate. While any task can use more memory than the stack includes, exceeding the stack memory size might cause the task to write into other memory or data areas, possibly causing unpredictable behavior. Stack segment for static tasks Use this option to specify where to allocate the stack for static tasks. Static tasks are created whether or not they are needed for operation, compared to dynamic tasks that the system creates as needed.
Target Preferences 9-66 Peripheral Name Description ADC Report the settings for the Analog-to-Digital Converter eCAN_A Report or set the enhanced Controller Area Network parameters for module A eCAN_B Report or set the enhanced Controller Area Network parameters for module B eCAP Report or assign enhanced CAPture module pins to general purpose IO pins ePWM Report or assign enhanced Pulse Width Modulation pins to general purpose IO pins I2C Report or set Inter-Integrated Circuit parameters SC
Target Preferences Peripheral Name Description GPIO[pin#] Configure input qualification types for General Purpose Input Output pins Flash_loader Enable and configure flash memory programmer.
Target Preferences ADC The internal timing of the ADC module is controlled by the high-speed peripheral clock (HSPCLK). The ADC operating clock speed is derived in several prescaler stages from the HSPCLK speed. For more information about configuring these scalers, refer to “Configuring ADC Parameters for Acquisition Window Width” in the Target Support Package TC2 documentation (available if you have installed Target Support Package TC2).
Target Preferences You can set the following parameters for the ADC clock prescaler: ACQ_PS This value does not actually have a direct effect on the ADC module’s core clock speed. It serves to determine the width of the sampling or acquisition period. The higher the value, the wider is the sampling period. The default value is 4. ADCLKPS The HSPCLK speed is divided by this 4-bit value as the first step in deriving the ADC module’s core clock speed. The default value is 3.
Target Preferences Enhanced CAN mode Whether to use the CAN module in extended mode, which provides additional mailboxes and time stamping. The default is True. Selecting False enables only standard mode. SAM Number of samples used by the CAN module to determine the CAN bus level. Selecting Sample_one_time samples once at the sampling point. Selecting Sample_three_times samples once at the sampling point and twice before at a distance of TQ/2. A majority decision is made from the three points.
Target Preferences eCAN_B The parameters you can set for the eCAN_B module include all the parameters for the eCAN_A module plus the following parameters which apply only when you use the eCAN_B module: Pin assignment (Rx) Assigns the CAN receive pin to use with the eCAN_B module. Possible values are GPIO10, GPIO13, GPIO17, and GPIO21. Pin assignment (Tx) Assigns the CAN transmit pin to use with the eCAN_B module. Possible values are GPIO8, GPIO12, GPIO16, and GPIO20.
Target Preferences SYNCO pin assignment Assigns the ePWM external sync pulse output (SYNCO) to a GPIO pin. Choices are None (the default), GPIO6, and GPIO33. TZ5 pin assignment Assigns the trip-zone input 5 (TZ5) to a GPIO pin. Choices are None (the default), GPIO16, and GPIO28. TZ6 pin assignment Assigns the trip-zone input 6 (TZ6) to a GPIO pin. Choices are None (the default), GPIO17, and GPIO29. I2C Report or set Inter-Integrated Circuit parameters.
Target Preferences The Mode parameter corresponds to bit 10 (MST) of the I2C Mode Register (I2CMDR). Addressing format If Mode is Slave, determine the addressing format of the I2C master, and set the I2C module to the same mode: • 7-Bit Addressing, the normal address mode. • 10-Bit Addressing, the expanded address mode. • Free Data Format, a mode that does not use addresses. (If Enable loopback is enabled, Free data format is not supported.
Target Preferences Number: SPRU721, available on the Texas Instruments Web site. Module clock prescaler If Mode is Master, configure the module clock frequency by entering a value from 0–255. Module clock frequency = I2C input clock frequency / (Module clock prescaler + 1) The I2C specifications require a module clock frequency between 7 MHz and 12 MHz. The I2C input clock frequency depends on the DSP input clock frequency and the value of the PLL Control Register divider (PLLCR).
Target Preferences Master clock High-time divider When Mode is Master, this divider determines the duration of the high state on the serial clock pin (SCL) of the I2C-bus. The high-time duration of the master clock = Tmod x (ICCL + d). For more information about this value, consult the “Formula for the Master Clock Period” section in the TMS320x280x Inter-Integrated Circuit Module Reference Guide, Literature Number: SPRU721A, available on the Texas Instruments Web site.
Target Preferences Enable Rx interrupt This parameter corresponds to bit 5 (RXFFIENA) of the I2C Receive FIFO Register (I2CFFRX). Rx FIFO interrupt level This parameter corresponds to bit 4–0 (RXFFIL4-0) of the I2C Receive FIFO Register (I2CFFRX).
Target Preferences This parameter corresponds to bit 6 (AAS) of the Interrupt Enable Register (I2CIER). Enable SCD interrupt Enable stop condition detected interrupt. When enabled, the I2C module generates an interrupt (SCD bit = 1) when the CPU detects a stop condition on the I2C bus.
Target Preferences This parameter corresponds to bit 1 (NACK) of the Interrupt Enable Register (I2CIER). Enable AL interrupt Enable arbitration-lost interrupt. When enabled, the I2C module generates an interrupt (AL bit = 1) when the I2C module is operating as a master transmitter and looses an arbitration contest with another master transmitter. This parameter corresponds to bit 0 (AL) of the Interrupt Enable Register (I2CIER). SCI_A The serial communications interface parameters you can set for module A.
Target Preferences No deadlock condition can occur because there is no wait state. Data transmission is asynchronous. With this mode, it is possible the receiving side could miss data, but if the data is noncritical, using raw data mode can avoid blocking any processes. When you select protocol mode, some handshaking between host and processor occurs. The transmitting side sends $SND to indicate it is ready to transmit. The receiving side sends back $RDY to indicate it is ready to receive.
Target Preferences is enabled, a C28x DSP’s Tx pin is internally connected to its Rx pin and can transmit data from its output port to its input port to check the integrity of the transmission. Number of stop bits Select whether to use 1 or 2 stop bits. Parity mode Type of parity to use. Available selections are None, Odd parity, or Even parity. None disables parity. Odd sets the parity bit to one if you have an odd number of ones in your bytes, such as 00110010.
Target Preferences read. If data is present, it reads and outputs the contents. If no data is present, the system outputs the last value and continues. Character length bits Length in bits of each transmitted/received character, set to 8 bits. Communication mode Select Raw_data or Protocol mode. Raw data is unformatted and sent whenever the transmitting side is ready to send, whether the receiving side is ready or not. No deadlock condition can occur because there is no wait state.
Target Preferences Note Deadlocks can occur if one SCI Transmit block tries to communicate with more than one SCI Receive block on different COM ports when both are blocking (using protocol mode). Deadlocks cannot occur on the same COM port. Data byte order Select Little Endian or Big Endian. Data swap width Select 8-bits or 16-bits. Enable Loopback Select this to enable the loopback function for self-test and diagnostic purposes only.
Target Preferences Suspension mode Type of suspension to use when debugging your program with Code Composer Studio. When your program encounters a breakpoint, the selected suspension mode determines whether to perform the program instruction. Available options are Hard_abort, Soft_abort, and Free_run. Hard_abort stops the program immediately. Soft_abort stops when the current receive or transmit sequence is complete. Free_run continues running regardless of the breakpoint.
Target Preferences to its Rx pin and can transmit data from its output port to its input port to check the integrity of the transmission. Enable FIFO Set true or false. FIFO interrupt level (Rx) Set level for receive FIFO interrupt. Select 0 through 16. FIFO interrupt level (Tx) Set level for transmit FIFO interrupt. Select 0 through 16. FIFO transmit delay Enter FIFO transmit delay (in processor clock cycles) to pause between data transmissions. Enter an integer. Mode Set to Master or Slave.
Target Preferences Clock phase Select No_delay or Delay_half_cycle. Clock polarity Select Rising_edge or Falling_edge. Data bits Length in bits from 1 to 16 of each transmitted or received character. For example, if you select 8, the maximum data that can be transmitted using SPI is 28-1. If you send data greater than this value, the buffer overflows. Enable Loopback Select this option to enable the loopback function for self-test and diagnostic purposes only.
Target Preferences SOMI pin assignment Assigns the SPI something (SOMI) to a GPIO pin. Choices are None (default), GPI013, or GPI025. STE pin assignment Assigns the SPI something (STE) to a GPIO pin. Choices areNone (default), GPI015, or GPI027. Suspension Mode Type of suspension to use when debugging your program with Code Composer Studio. When your program encounters a breakpoint, the selected suspension mode determines whether to perform the program instruction.
Target Preferences EQEP1I pin assignment Select an option from the list—GPIO23 or GPIO53. Watchdog When enabled, the watchdog resets the processor or generates an interrupt if the software fails to reset the watchdog counter within a specified interval. This feature enables the processor to automatically recover from some fault conditions. For more information, locate the Data Manual or System Control and Interrupts Reference Guide for your processor on the Texas Instruments Web site.
Target Preferences • Select Chip reset to generate a signal that resets the processor (WDRST signal) and disable the watchdog interrupt signal (WDINT signal). • Select Raise WD Interrupt to generate a watchdog interrupt signal (WDINT signal) and disable the reset processor signal (WDRST signal). This signal can be used to wake the device from an IDLE or STANDBY low-power mode. This parameter corresponds to bit 1 (WDENINT) of the System Control and Status Register (SCSR).
Target Preferences output from the qualifier changes to 0 immediately after the third consecutive value is received. • Qualification using 6 samples — This setting requires six consecutive cycles of the same GPIO input value for the output from the qualifier to change. In the following figure, the glitch A has no effect on the output signal. When the glitch occurs, the counting begins, but the next measurement is low again, so the count is ignored.
Target Preferences SYSCLKOUT 2 * Pr escaler with the exception of zero. When Qualification sampling period prescaler=0, a sample is taken every SYSCLKOUT clock tick. For example, a prescale setting of 0 means that a sample is taken on each SYSCLKOUT tick. The following figure shows the SYSCLKOUT ticks, a sample taken every clock tick, and the Qualification type set to Qualification using 3 samples.
Target Preferences Flash_loader You can use Flash_loader to: • Automatically program generated code to flash memory on the target when you build the code. • Manually erase, program, or verify specific flash memory sectors. To use this feature, you must first download and install the appropriate TI Flash API plug-in from the TI Web site. For more information, consult the “Programming Flash Memory”topic in the Target Support Package TC2 User’s Guide or the *_API_Readme.
Target Preferences Specify API location Specify the directory path of the TI flash API executable you downloaded and installed on your computer. Execute Click this button to initiate the task selected in Enable Flash Programmer. DMA_ch[#] The Direct Memory Access module transfers data directly between peripherals and memory using a dedicated bus, bypassing the CPU and increasing overall system performance. You can individually enable and configure each DMA channel. The DMA module services are event driven.
Target Preferences If your model includes an C280x/C28x3x ADC block with the Use DMA (with C28x3x) parameter enabled, disable the same DMA channel here in the Target preferences block. This parameter has no corresponding bit or register. Data size Select the size of the data bit transfer: 16 bit or 32 bit. The DMA read/write data buses are 32 bits wide. 32-bit transfers have approximately twice the data throughput of a 16-bit transfer. When providing DMA service to McBSP, set Data size to 16 bit.
Target Preferences Interrupt source Select the peripheral interrupt that triggers a DMA burst for the specified channel. Selecting SEQ1INT or SEQ2INT generates a message: “Use ADC block to implement the DMA function.” To do so, open the C280x/C28x3x ADC block, select the Use DMA (with C28x3x) parameter, select a DMA channel, and disable the same DMA channel in the Target Preferences block.
Target Preferences Note When you select Use DMA (with C28x3x) the C280x/C28x3x ADC block: • If the ADC block Module is A or A and B, Interrupt source is SEQ1INT. • If the ADC block Module is B, Interrupt source is SEQ2INT. External pin(GPIO) When Interrupt source is set to an external interface (XINT[#]), specify the GPIO pin number from which the interrupt originates. This parameter corresponds to the GPIO XINTn, XNMI Interrupt Select (GPIOXINTnSEL, GPIOXNMISEL) Registers.
Target Preferences Specify the number of 16-bit words in a burst, from 1 to 32. The DMA module must complete a burst before it can service the next channel. Set the Burst value appropriately for the peripheral the DMA module is servicing. For the ADC, the value equals the number of ADC registers being used, up to 16. For multichannel buffered serial ports (McBSP), which lack FIFOs, the value is 1. For RAM, the value can range from 1 to 32.
Target Preferences Specify the number of bursts in a transfer, from 1 to 65536. This parameter corresponds to bits 15-0 (TRANSFERSIZE) in the Transfer Size Register (TRANSFER_SIZE). Note When you select Use DMA (with C28x3x) the C280x/C28x3x ADC block, the value of this parameter is 1. • SRC wrap Specify the number of bursts before returning the current source address pointer to the Source Begin Address value. To disable wrapping, enter a value for SRC wrap that is greater than the Transfer value.
Target Preferences This parameter corresponds to bits 15-0 (DST_WRAP_SIZE) in the Destination Wrap Size Register (DST_WRAP_SIZE). Note When you select Use DMA (with C28x3x) the C280x/C28x3x ADC block, the value of this parameter is 65536. Source The following parameters configure the DMA channel inputs. • Begin address Set the starting address for the current source address pointer.
Target Preferences burst. Enter a value from –4096 (decrement) to 4095 (increment). To disable incrementing or decrementing the address pointer, set Burst step to 0. For example, because McBSP does not use FIFO, you must configure DMA to maintain the correct sequence of the McBSP data by moving each word of the data individually. Accordingly, when you use DMA to transmit or receive McBSP data, set Burst size to 1 word and Burst step to 0.
Target Preferences If DMA is configured to perform memory wrapping (if SRC wrap is enabled) the corresponding source Transfer step has no effect. Note This parameter is based on a 16-bit word size. If you set Data size to 32 bit, double the value of this parameter. Note When you select Use DMA (with C28x3x) the C280x/C28x3x ADC block, the value of this parameter is 0. • Wrap step Set the number of 16-bit words by which to increment or decrement the SRC_BEG_ADDR address pointer when a wrap event occurs.
Target Preferences Destination The following parameters configure the DMA channel outputs. • Begin address Set the starting address for the current destination address pointer. The DMA module points to this address at the beginning of a transfer and returns to it as specified by the DST wrap parameter. This parameter corresponds to bits 21-0 (BEGADDR) in the Active Destination Begin Register (DST_BEG_ADDR).
Target Preferences To disable incrementing or decrementing the address pointer, set Burst step to 0. For example, because McBSP does not use FIFO, you must configure DMA to maintain the correct sequence of the McBSP data by moving each word of the data individually. Accordingly, when you use DMA to transmit or receive McBSP data, set Burst size to 1 word and Burst step to 0. This parameter corresponds to bits 15-0 (DSTBURSTSTEP) in the Destination Burst Step Size Register (DST_BURST_STEP).
Target Preferences If DMA is configured to perform memory wrapping (if DST wrap is enabled) the corresponding destination Transfer step has no effect. Note This parameter is based on a 16-bit word size. If you set Data size to 32 bit, double the value of this parameter. Note When you select Use DMA (with C28x3x) the C280x/C28x3x ADC block, the value of this destination parameter is 1.
Target Preferences Mode The following parameters configure the DMA channel. • Enable one shot mode Enable this parameter to have the DMA channel complete an entire transfer in response to an interrupt event trigger. This option allows a single DMA channel and peripheral to dominate resources, and may streamline processing, but it also creates the potential for resource conflicts and delays. Disable this parameter to have DMA complete one burst per channel per interrupt.
Target Preferences Select this parameter to leave the DMA channel enabled upon completing a transfer. The channel will wait for the next interrupt event trigger. Clear this parameter to disable the DMA channel upon completing a transfer. The DMA module disables the DMA channel by clearing the RUNSTS bit in the CONTROL register when it completes the transfer. To use the channel again, first reset the RUN bit in the CONTROL register.
Target Preferences and the other DMA channels are configured to handle lower-priority data. When enabled, the DMA module services each enabled channel sequentially until it receives a trigger from channel 1. Upon receiving the trigger, DMA interrupts its service to the current channel at the end of the current word, services the channel 1 burst that generated the trigger, and then continues servicing the current channel at the beginning of the next word.
Target Preferences Note When you select Use DMA (with C28x3x) the C280x/C28x3x ADC block, this parameter is disabled. New Processor Dialog Box When you click Add new on the General pane, you open this new dialog box to add a new processor to the list of supported processors. The first time you click Save to add a new processor definition to the list of supported processors, a dialog box opens that directs you to select a destination folder for the saved processor definitions file customChipInfo.dat.
Target Preferences Setting CPU clock to the actual board rate allows the code you generate to run correctly according to the actual clock rate of the hardware. • Define internal memory banks (one or more memory banks in the processor memory) Use the options to define the way the processor uses internal memory for code and data. • Define default sections (one or more default sections) Set values for the options to define the default sections in memory.
Target Preferences 9-109
Target Preferences General Name Provide a name to identify your new processor. You can use any valid C string value in this field. The name you enter in this field appears on the list of processors after you add the new processor. Processor Class Identifies the class of the new processor. Your new processor must be a member of a family of processors that Embedded IDE Link CC supports. For example, you can add a new C67xx processor because the product supports the C6700 processor family.
Target Preferences Processor Family Processor Class String DM64x and DM64xx 64xx where xx designates the processor, such as DM6433 or DM643. C55xx 55xx where xx designates the processor, such as C5502. For C5503, C5507, and C5509 processors, use 55xx. C28xx, F28xx, R28xx, F28xxx 28xx where xx designates the processor, such as C2812. For F283xx processors, use 2833x. For F280xx processors, use 280x. CPU clock Provide a name to identify your new processor.
Target Preferences Processor Family Compiler Switch String C62xx None C64xx None C67xx None DM64x and DM64xx None C55xx -ml C28xx, F28xx, R28xx, F28xxx -ml Code generation hook This string specifies a prefix to add when the code generation process calls certain hook functions. The hook allows the code to call into handling functions that are specific to the processor selected. The following table shows the Code Generation hook string for supported processor families.
Target Preferences Define internal memory banks (one or more memory banks) Parameters in this group configure the memory map for the new processor. Define default sections (one or more default sections) Parameters in this group configure the default sections for your new processor. Define internal memory banks Name To add a new physical memory segment to the internal memory banks list, click Add, replace the temporary label in Name with the one to use, and press Return.
Target Preferences addressable data units (MADUs). For the C6000 processor family, for example, the MADU is 8 bytes, one word. Contents Contents details the kind of program sections that you can store in the memory segment in Name. As the processor type for the Target Preferences block changes, the kinds of information you store in listed memory segments may change. Generally, the Contents list contains these strings: • Code — Allow code to be stored in the memory segment in Name.
Target Preferences Define cache configuration Options Enter the label for each option of the selected cache configuration, one label on each line, such as 0kb, 16kb, 32kb and so on. Add Click Add to add a new cache configuration to the list. When you click Add, the new cache label appears on the list. Remove This option lets you remove a cache configuration from the cache list. Select the configuration to remove from the list, and click Remove to delete the cache.
Target Preferences block changes, the kinds of information you store in listed sections may change. Generally, the Contents list contains these strings: • Code — Allow code to be stored in the section in Name. • Data — Allow data to be stored in the section in Name. • Code and Data — Allow code and data to be stored in the section in Name. When you add a new section, this setting is the default for the contents.
Target Preferences Custom Code Entry Description Include paths If you require additional header files on your path, add them by typing the path into the text area, one file per line. The default setting does not include additional paths. Libraries (Little Endian) These entries identify specific little endian libraries that the processor requires. Add more as you require by entering the full path to the library with the library file in the text area. Enter one library per line.
Target Preferences 9-118
10 Embedded IDE Link CC Configuration Parameters
10 Embedded IDE Link™ CC Configuration Parameters Embedded IDE Link CC Pane In this section...
Embedded IDE Link CC Pane In this section...
10 Embedded IDE Link™ CC Configuration Parameters Embedded IDE Link CC Overview Options on this pane configure the generated projects and code for Texas Instruments processors. They also enable PIL block generation and provide real-time task execution and stack use profiling.
Embedded IDE Link CC Pane Export IDE link handle to base workspace Directs the software to export the ticcs object to your MATLAB workspace. Settings Default: On On Directs the build process to export the ticcs object created to your MATLAB workspace. The new object appears in the workspace browser. Selecting this option enables the IDE link handle name option. Off prevents the build process from exporting the ticcs object to your MATLAB software workspace.
10 Embedded IDE Link™ CC Configuration Parameters See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
Embedded IDE Link CC Pane IDE link handle name specifies the name of the ticcs object that the build process creates. Settings Default: CCS_Obj • Enter any valid C variable name, without spaces. • The name you use here appears in the MATLAB workspace browser to identify the ticcs object. • The handle name is case sensitive. Dependency This parameter is enabled by Export IDE link handle to base workspace.
10 Embedded IDE Link™ CC Configuration Parameters Profile real-time execution enables real-time execution profiling in the generated code by adding instrumentation for task functions or atomic subsystems. Settings Default: Off On Adds instrumentation to the generated code to support execution profiling and generate the profiling report. Off Does not instrument the generated code to produce the profile report. Dependencies This parameter adds Number of profiling samples to collect and Profile by.
Embedded IDE Link CC Pane Application Setting Efficiency No impact Safety precaution No impact See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57. For more information about using profiling, refer to profile, and “Real-Time Execution Profiling” on page 4-11.
10 Embedded IDE Link™ CC Configuration Parameters Profile by Defines which execution profiling technique to use. Settings Default: Task Task Profiles model execution by the tasks in the model. Atomic subsystem Profiles model execution by the atomic subsystems in the model. Dependencies Selecting Real-time execution profiling enables this parameter.
Embedded IDE Link CC Pane For more information about PIL, refer to “Using Processor in the Loop” on page 4-3.
10 Embedded IDE Link™ CC Configuration Parameters Number of profiling samples to collect Specifies the number of profiling samples to collect. Collection stops when the buffer for profiling data is full. Settings Default: 100 Minimum: 1 Maximum: Buffer capacity in samples Tips • Collecting profiling data on a simulator may take a very long time. • Data collection stops after collecting the specified number of samples. The application and processor continue to run.
Embedded IDE Link CC Pane See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
10 Embedded IDE Link™ CC Configuration Parameters Inline run-time library functions Marks run-time library functions generated by the Signal Processing Toolbox and Video and Image Processing Blockset™ block algorithms. These functions as marked with the inline keyword. Settings Default: On On Adds the keyword inline to each instance of an algorithm generated from blocks in the Signal Processing Blockset software and Video and Image Processing Blockset software.
Embedded IDE Link CC Pane Recommended Settings Application Setting Debugging Off Traceability On Efficiency On Safety precaution No impact See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
10 Embedded IDE Link™ CC Configuration Parameters Project options Sets the project options for building your project from the model. Settings Default: Custom Custom Applies a custom project configuration that provides a specialized combination of build and optimization settings. The default settings are the same as the Release project configuration in CCS, except for the compiler and memory options. For the compiler options, Custom does not use any optimizations.
Embedded IDE Link CC Pane Value: Custom | Debug | Release Default: Custom Recommended Settings Application Setting Debugging Custom or Debug Traceability Custom, Debug, Release Efficiency Release Safety precaution No impact See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
10 Embedded IDE Link™ CC Configuration Parameters Compiler options string Lets you enter a string of compiler options to define your project configuration. Settings Default: No default Tips • To import compiler string options from the current project in CCS, click Get from IDE. • To reset the compiler options to the default values, click Reset. • Use spaces between options. • Verify that the options are valid. The software does not validate the option string.
Embedded IDE Link CC Pane Application Setting Traceability Custom Efficiency No impact Safety precaution No impact See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
10 Embedded IDE Link™ CC Configuration Parameters Linker options string Enables you to specify linker command options that determine how to link your project when you build your project. Settings Default: No default Tips • Use spaces between options. • Verify that the options are valid. The software does not validate the options string. • To import linker string options from the current project in CCS, click Get from IDE. • To reset the linker command options to the default values, click Reset.
Embedded IDE Link CC Pane See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
10 Embedded IDE Link™ CC Configuration Parameters System stack size (MAUs) Allocates memory for the system stack on the processor. Settings Default: 8192 Minimum: 0 Maximum: Available memory • Enter the stack size in minimum addressable units (MAUs).. • The software does not verify that your size is valid. Be sure that you enter an acceptable value. Dependencies Setting Build action to Archive_library removes this parameter.
Embedded IDE Link CC Pane Build action Defines how Real-Time Workshop software responds when you press Ctrl+B to build your model. Settings Default: Build_and_execute Build_and_execute Builds your model, generates code from the model, and then compiles and links the code. After the software links your compiled code, the build process downloads and runs the executable on the processor. Create_project Directs Real-Time Workshop software to create a new project in the IDE.
10 Embedded IDE Link™ CC Configuration Parameters • Reset • Export IDE link handle to base workspace Selecting Create_processor_in_the_loop_project removes the following parameters: • Interrupt overrun notification method • Interrupt overrun notification function • Profile real-time task execution • Number of profiling samples to collect • Linker options string • Get from IDE • Reset • Export IDE link handle to base workspace with the option set to export the handle Command-Line Information Parameter: bu
Embedded IDE Link CC Pane See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57. For more information about PIL, refer to “Using Processor in the Loop” on page 4-3.
10 Embedded IDE Link™ CC Configuration Parameters Interrupt overrun notification method Specifies how your program responds to overrun conditions during execution. Settings Default: None None Your program does not notify you when it encounters an overrun condition. Print_message Your program prints a message to standard output when it encounters an overrun condition.
Embedded IDE Link CC Pane Recommended Settings Application Setting Debugging Print_message or Call_custom_function Traceability Print_message Efficiency None Safety precaution No impact See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
10 Embedded IDE Link™ CC Configuration Parameters Interrupt overrun notification function Specifies the name of a custom function your code runs when it encounters an overrun condition during execution. Settings No Default Tips Specify a function that exists in your current working directory. Dependencies This parameter is enabled by setting Interrupt overrun notification method to Call_custom_function.
Embedded IDE Link CC Pane PIL block action Specifies whether Real-Time Workshop software builds the PIL block and downloads the block to the processor Settings Default: Create_PIL_block_and_download Create_PIL_block_build_and_download Builds and downloads the PIL application to the processor after creating the PIL block. Adds PIL interface code that exchanges data with Simulink.
10 Embedded IDE Link™ CC Configuration Parameters • When you select None or Create_PIL_block, the generated project will not compile in the IDE. To use the PIL block in this project, click Build followed by Download in the PIL block dialog box. Dependency Enable this parameter by setting Build action to Create_processor_in_the_loop_project.
Embedded IDE Link CC Pane Maximum time allowed to build project (s) Specifies how long, in seconds, the software waits for the project build process to return a completion message. Settings Default: 1000 Minimum: 1 Maximum: No limit Tips • The build process continues even if MATLAB does not receive the completion message in the allotted time. • This timeout value does not depend on the global timeout value in a ticcs object or the Maximum time to complete IDE operations timeout value.
10 Embedded IDE Link™ CC Configuration Parameters Application Setting Efficiency No impact Safety precaution No impact See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
Embedded IDE Link CC Pane Maximum time to complete IDE operations (s) specifies how long the software waits for IDE functions, such as read or write, to return completion messages. Settings Default: 10 Minimum: 1 Maximum: No limit Tips • The IDE operation continues even if MATLAB does not receive the message in the allotted time. Click here to see a list of the functions and methods.
10 Embedded IDE Link™ CC Configuration Parameters See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
Embedded IDE Link CC Pane Source file replacement Selects the diagnostic action to take if Embedded IDE Link CC software detects conflicts that you are replacing source code with custom code. Settings Default: warn none Does not generate warnings or errors when it finds conflicts. warning Displays a warning. error Terminates the build process and displays an error message that identifies which file has the problem and suggests how to resolve it.
10 Embedded IDE Link™ CC Configuration Parameters Recommended Settings Application Setting Debugging error Traceability error Efficiency warning Safety precaution error See Also For more information, refer to “Embedded IDE Link CC Pane Parameters” on page 3-57.
A Supported Hardware This appendix provides the details about the hardware, simulators, and software that work with Embedded IDE Link CC.
A Supported Hardware Supported Platforms for Embedded IDE Link CC In this section... “Supported Hardware and Simulators” on page A-2 “Product Features Supported by Each Processor or Family” on page A-4 “OMAP Coemulation Support” on page A-7 “Custom Hardware Support” on page A-7 This appendix lists the hardware and simulators that work with the latest released version of Embedded IDE Link CC. Generally, the product supports boards and simulators from a given processor family.
Supported Platforms for Embedded IDE Link™ CC Supported Hardware Supported Simulators Description Simulators (C54x, C5x) Simulators for the C5000 DSP family C5000 C5402 DSK DSP starter kit for the C5402 processor C5416 DSK DSP starter kit for the C5416 processor C5510 DSK DSP starter kit for the C5510 processor C6000 Simulators (C62x, C64x, C67x) Simulators for the C6000 DSP family C6211 DSK DSP starter kit for the C6211 processor C6416 DSK DSP starter kit for the C6416 processor DM64x C
A Supported Hardware Supported Hardware OMAP5910 Supported Simulators Description Boards and simulators based on the OMAP5910. TMS470 TMS470R1x Boards and simulators based on the TMS470R1x processor. TMS470R2x Boards and simulators based on the TMS470R2x processor. Product Features Supported by Each Processor or Family Within the collection of hardware that Embedded IDE Link CC supports, some features of the link do not apply.
Supported Platforms for Embedded IDE Link™ CC Component Use Debug Function Use objects to create reference connections between CCS IDE and MATLAB. From the command window, you can run applications in CCS IDE, send to and receive data from processor memory, and check the processor status, as well as other functions such as starting and stopping applications running on your digital signal processors.
A Supported Hardware Processor Family Supporting Embedded IDE Link CC Components and Subcomponents Automation Interface Component Project Generator Component Verification Processor Family Debug Mode RTDX Code Generation PIL Real-Time Execution Profiling C24xx Yes No No No No C27xx Yes No No No No C28xx Yes Yes Yes Yes Yes C54xx Yes Yes Yes Yes Yes C55xx Yes Yes Yes Yes Yes C62xx Yes Yes Yes Yes Yes C64x and C64x+ Yes Yes Yes Yes Yes C67x and C67x+ Yes Y
Supported Platforms for Embedded IDE Link™ CC OMAP Coemulation Support An added feature for OMAP processors is coemulation for the two processors that comprise the OMAP. Embedded IDE Link CC supports coemulation or direct multiprocessor support for the TMS470R2x (TI-enhanced ARM925) and TMS320C55x DSP in OMAP 1510 and OMAP 5910. Custom Hardware Support Embedded IDE Link CC supports processors as shown in the previous tables.
A Supported Hardware Supported Versions of Code Composer Studio The following table lists versions of Embedded IDE Link CC and the versions of Code Composer Studio they support. Embedded IDE Link CC Version MATLAB Release Supported Version of Code Composer Studio 3.3 R2008b Only CCS 3.3 with DSP/BIOS 5.32.01 or 5.32.05 (not 5.32.00) 3.2 R2008a Only CCS 3.3 with DSP/BIOS 5.3 (not 5.32.00) 3.1 R2007b Only CCS 3.3 with DSP/BIOS 5.3 3.0 R2007a • CCS 3.2 for C64x+ processors • CCS 3.
Supported Versions of Code Composer Studio Embedded IDE Link CC Version MATLAB Release Supported Version of Code Composer Studio 1.3.2 R14SP1 • CCS 2.2 for C2000, C5000, C6000, and OMAP processors • CCS 2.12 for C2000, C5000, C6000, and OMAP processors 1.3.1 R14 • CCS 2.2 for C2000, C5000, C6000, and OMAP processors • CCS 2.12 for C2000, C5000, C6000, and OMAP processors 1.3 R13SP1+ CCS 2.
A A-10 Supported Hardware
B Reported Limitations and Tips
B Reported Limitations and Tips Reported Issues Using Embedded IDE Link CC Software In this section...
Reported Issues Using Embedded IDE Link™ CC Software The latest issues in the list appear at the bottom. HIL refers to “hardware in the loop,” also called processor in the loop (PIL) here and in other applications, and sometimes referred to as function calls. Demonstration Programs Do Not Run Properly Without Correct GEL Files To run the Embedded IDE Link CC demos, you must load the appropriate GEL files before you run the demos. For some boards, the demos run fine with the default CCS GEL file.
B Reported Limitations and Tips Issues Using USB-Based RTDX Emulators and the C6416 DSK and C6713 DSK You may encounter a few problems when you try to use the USB-based RTDX emulators with the C6713 and C6416 DSP Starter Kits. The problems relate to setting up RTDX and opening/closing RTDX channels. 1 Setting up and cleaning up RTDX. If you do not set up RTDX correctly, your hardware might end up in a bad state and RTDX data transfers may not work correctly.
Reported Issues Using Embedded IDE Link™ CC Software • Section 5.0 Some Basics on How it Works • Quick Start Installation Guide, “Debug Hints and Trouble Shooting” To avoid having problems in MATLAB software when you work with links, note these recommended tasks (in order) for creating handles to CCS from MATLAB. 1 Assuming CCS IDE is not open (cc_app.exe is not in the Windows Task Manager), create a handle to CCS (cc_app.exe appears in the Task Manager). cc = ticcs 2 Clear the handle to CCS (cc_app.
B Reported Limitations and Tips • add(cc.type,'mytypedef','int') To access type without the error, reference the individual elements of cc as follows: • cc(1).type • add(cc(2).type,'mytypedef','int') Changing the represent Property of an Object An object’s represent property is writable. You can change it to modify the access format. For example, an object with represent set to float can be changed to represent set to signed. After the change, the data is read as a signed integer.
Reported Issues Using Embedded IDE Link™ CC Software 4.6255e+018 Take care when you change the value of the represent property to float. Only change this property when the word referenced by the object is at least 32 bits. As one example, if an object is a 16-bit integer where represent=signed, you cannot change the value for represent to float because to access floating point data, the data must be at least 32 bits long.
B Reported Limitations and Tips find the source code for debug. You can either find the source code to debug it or select the Don’t show this message again checkbox to ignore messages like this in the future. For more information about how CCS responds to the halt, refer the online Help for CCS. In the online help system, use the search engine to search for the keywords “Troubleshooting” and “Support.
Reported Issues Using Embedded IDE Link™ CC Software If two files have the same name and are located in different directories, the file located in the directory that appears highest in the Directories list takes precedence. • New. To add a new directory to the Directories list, click New. Enter the full path or click browse [...] to navigate to the appropriate directory. By default, the new directory is added to the bottom of the list. • Delete.
B Reported Limitations and Tips cc = ticcs Embedded IDE Link CC starts the CCS version you last used. If you last used your C5000 version, the cc object accesses the C5000 version. Workaround To make your ticcs object access the correct processor: 1 Start and close the appropriate CCS version before you create the ticcs object in MATLAB. 2 Create the ticcs object using the boardnum and procnum properties to select your processor, if needed.
Reported Issues Using Embedded IDE Link™ CC Software Four options let you decide how to respond to the failure: • Abort — Closes CCS and suspends control for about 30 seconds. If you used MATLAB software functions to open CCS, such as when you create a ticcs object, the system returns control to MATLAB command window after a considerable delay, and issues this warning: ??? Unable to establish connection with Code Composer Studio. • Ignore — Starts CCS without connecting to any processor.
B Reported Limitations and Tips CCS is not connected to a processor, you cannot use the object to perform processor operations from MATLAB, such as loading or running programs. • Retry — CCS tries again to initialize the processor. If CCS continues not to find your hardware processor, the same DSP Device Driver dialog box reappears. This process continues until either CCS finds the processor or you choose one of the other options to respond to the warning.
Reported Issues Using Embedded IDE Link™ CC Software 1.0000000e+020 and result2 = read(ptr1) returns 1.000000020040877e+020 The results appear to differ after the seventh decimal place. If you go to the MATLAB workspace browser to look at the values, you see that result1 and result2 are the same. The apparent difference occurs because the syntax result1 = read(cc, ptr1.address, 'single') explicitly states that result1 is returned in single format, as controlled by the single input argument.
B Reported Limitations and Tips Using Mapped Drives Limitations in Code Composer Studio do not allow you to load programs after you set your CCS working directory to a read-only mapped drive. When you set the CCS working directory to a mapped drive for which you do not have write permissions, you cannot load programs from any location. Load operations fail with an Application Error dialog box.
Index A Index activate 7-2 add 7-4 address 7-7 address, read 7-114 animate 7-9 apiversion 2-52 Archive_library 3-78 asynchronous scheduling 3-12 B block limitations using model reference 3-79 boardnum 2-53 boards, selecting 3-3 breakpoint, delete 7-43 build 7-10 build configuration compiler options, default 3-64 custom 3-64 default 3-64 build configuration, new 7-94 C C280x/C28x3x hardware interrupt block 9-2 C280x/C28x3x Hardware Interrupt block 9-2 c281x hardware interrupt block 9-8 C6000 model referen
Index managing 2-58 datatypemanager 7-28 debug point, insert 7-62 default build configuration 3-64 default compiler options 3-64 delete 7-43 breakpoint 7-43 source file 7-43 delete breakpoint 7-43 dir 7-46 disable 7-47 discrete solver 3-48 display 7-49 DSP/BIOS adding to generated code 3-57 E Embedded IDE Link™ CC code generation options 3-57 listing link functions 2-43 run-time options 3-57 use C6711 DSK blocks 3-5 enable 7-51 enabling interrupts 3-20 execute program 7-141 execution in timer-based models
Index L link properties about 2-50 2-52 apiversion 2-52 boardnum 2-53 ccsappexe 2-53 numchannels 2-53 page 2-54 procnum 2-54 quick reference table 2-50 rtdx 2-55 rtdxchannel 2-56 timeout 2-56 version 2-56 link properties, details about 2-52 links closing CCS IDE 2-19 closing RTDX 2-39 communications for RTDX 2-30 creating links for RTDX 2-27 details 2-52 introducing the tutorial for using links for RTDX 2-22 loading files into CCS IDE 2-10 quick reference 2-50 running applications using RTDX 2-32 tutorial
Index P R page 2-54 read address 7-114 object 7-114 read register 7-127 readmat 7-120 readmsg 7-123 Real-Time Workshop solver options 3-48 Real—Time Workshop build options generate_code_only 3-57 regread 7-127 regwrite 7-131 reload 7-135 remove 7-137 remove file 7-137 replacing generated code 3-65 replacing linker directives 3-65 reset 7-138 restart 7-139 restore program counter 7-139 rtdx 2-55 RTDX isenabled 7-66 isrtdxcapable 7-72 message count 7-93 open channel 7-97 read message 7-123 readmat 7-120 w
Index S save 7-145 selecting boards 3-3 set stack size 3-60 set visibility 7-157 solver option settings 3-48 source code replacement 3-65 stack size, set stack size 3-60 stop process 7-57 symbol 7-147 symbol table, getting symbols 7-147 synchronous scheduling 3-18 T target function library assessing execution time after selecting a library 3-73 create a custom library 3-76 optimization 3-70 seeing the library changes in your generated code 3-74 selecting the library to use 3-72 use in the build process 3-