Main Content

createTarget

Create an object for the target being developed

Description

H = createTarget(targetName,referenceTarget,targetFolder) returns matlabshared.targetsdk.Target (Target) object, H, with the Name property set to targetName, the ReferenceTarget property set to referenceTarget, the Folder property set to targetFolder. The function also creates a set of folders and files, also known as “framework”, in targetFolder that implements the target.

H = createTarget(targetName,referenceTarget,targetFolder,'initialize') returns a Target object, H, with the Name property set to targetName, the ReferenceTarget property set to referenceTarget, the Folder property set to targetFolder. The Target object is initialized based on the reference Target object. The function also creates a set of folders and files, also known as “framework”, in targetFolder that implements the target.

A Target object represents a target, which deploys MATLAB® and Simulink® designs to hardware. A target provides features for the hardware that it supports, such as processor-specific optimizations and board-level I/O device drivers.

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.

Input Arguments

collapse all

Name of target, specified as a string.

Data Types: char

Name of reference target, specified as a string.

Data Types: char

Name of root folder for the target, specified as a string.

Data Types: char

Output Arguments

collapse all

Handle to Target object.

Version History

Introduced in R2015a