matlabshared.targetsdk.Target class

Package: matlabshared.targetsdk

An object for the target being developed

Description

A Target object represents the collection of configuration files, source and header files, tools, and libraries that Embedded Coder® uses to build, download, run, and interact with your model as an executable on a selected hardware board. A group of tools, libraries, and configurations that serve a specific purpose defines a feature of the Target object. Features are represented as objects, such as a Deployer object, assigned to properties of the Target object.

Each feature of the Target object can be mapped, using the map method, to a Hardware object. Mapping features of a Target object to a Hardware object adds the needed files and configuration information to the target files enabling those features in the Simulink® configuration parameters for the associated hardware board.

While each feature in a Target can be developed manually, you can create a new Target object that already includes many features from an existing Reference Target. Using a Reference Target, you only need to add or modify the features unique to your Target.

Tip

Creating a Target from a Reference Target can greatly accelerate your development time by providing ready-to-use features and is the recommended strategy for developing a new Target.

Creation

To construct a target object, use the createTarget function.

Properties

expand all

A descriptive name for the target. The loadTarget function uses the value in the Name property to load the Target object between MATLAB® sessions.

Example: 'Target for XYZ Development Board'

Attributes

GetAccess
public
SetAccess
public

Data Types: char

The Folder is the root folder on your computer where the Target object stores all configuration and library files. Features referenced from other targets do not get explicitly stored in the Folder.

Example: 'c:/xyzdevboard'

Attributes

GetAccess
public
SetAccess
public

Data Types: char

The ReferenceTargets list defines the set of targets from which the Target object can reference and reuse features.

Example: 'ARM Cortex-A'

Attributes

GetAccess
public
SetAccess
immutable

Data Types: cell

The Deployer objects define the tools and configuration used by the Target object to build and load a model as an application. To modify the Deployers property, use the addNewDeployer and deleteDeployer methods.

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

The OperatingSystem objects specify that the execution of scheduled tasks, implemented as threads, are managed by an OS kernel. To modify the OperatingSystems property, use the addNewOperatingSystem and deleteOperatingSystem methods.

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

The BaremetalScheduler objects specify that the execution of scheduled tasks, implemented as C/C++ functions, are managed by a bare-metal scheduler. To modify the BaremetalSchedulers property, use the addNewBaremetalScheduler and deleteBaremetalScheduler methods.

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

The PIL objects provides your Target with the configuration information needed to generate code, cross-compile, and execute either the top model or part of the model onto the processor. To modify the PIL property, use the addNewPIL and deletePIL methods. For information on PIL simulation, see Processor-in-the-Loop Simulation (Embedded Coder).

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

The ExternalMode objects provides your Target with the source files, callback functions, and configuration information needed to generate code for your model that includes an External Mode connection. To modify the ExternalMode property, use the addNewExternalMode and deleteExternalMode methods. For more information on External Mode, see Host-Target Communication with External Mode Simulation (Simulink Coder).

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

The Profiler objects provides your Target with the source files and configuration information needed to profile the execution of the generated code from your model. To modify the Profilers property, use the addNewProfiler and deleteProfiler methods. For more information on code execution profiling, see Code Execution Profiling (Embedded Coder).

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

Methods

expand all

Examples

collapse all

Create a new target using ARM Cortex-A target as the reference target. Set the name of the new target to MyTarget and the root folder of the new target to c:/mytarget. Set the supported features and hardware the same way as in the reference target.

Execute the following command to construct an object, tgt, that represents the target.

hTgt = createTarget('My Target','ARM Cortex-A','c:/mytarget','initialize');

Execute the following command to see the features and the hardware supported by the target.

show(hTgt)
                                   
Display Name                       Temporary name      
Linaro Toolchain v4.8                     1            
Linux                                     1            
Ethernet PIL                           TCP/IP          
Ethernet External mode                 TCP/IP          
ARM Cortex-A9 (QEMU) Profiler             1            

Create a new target using the ARM Cortex-A target as a reference target. Set the name of the new target to MyTarget and the root folder of the new target to c:/mytarget. Do not initialize the supported features and the hardware.

To construct an object, hTgt, representing the target, execute the following code:

hTgt = createTarget('My Target','ARM Cortex-A','c:/mytarget');

To see the features and hardware supported by the target, execute the following code:

show(hTgt)

Since no features or hardware were initialized, no output is displayed to the screen.

Introduced in R2015a