Main Content

matlabshared.targetsdk.Target Class

Namespace: 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 more information on PIL simulation, see Code Verification Through Software-in-the-Loop and Processor-in-the-Loop Execution.

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 External Mode Simulations for Parameter Tuning, Signal Monitoring, and Code Execution Profiling.

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 Execution-Time Profiling for Generated Code.

Attributes

GetAccess
public
SetAccess
public

Data Types: cell

Methods

expand all

Examples

collapse all

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

hTgt = createTarget('My Target','ARM Cortex-M','c:/mytarget','initialize');
show(hTgt)
                                                     ARM Cortex-M3 (QEMU)      
Display Name                                            Temporary name         
GNU Tools for ARM Embedded Processors        0                 1               
SysTick Scheduler                            0                 1               
m0m1m0plus SysTick Scheduler                 0                 0               
CMSIS-RTOS RTX                               0                 0               
Ethernet PIL                                 0              TCP/IP             
TCP/IP                                       0              TCP/IP             

Create a new target using the ARM Cortex-M 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-M','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.

Version History

Introduced in R2015a