createTarget

Create an object for the target being developed

Syntax

H = createTarget(targetName,referenceTarget,targetFolder)
H = createTarget(targetName,referenceTarget,targetFolder,'initialize')

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 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-M','c:/mytarget','initialize');

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

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             
Ethernet External mode                       0              TCP/IP 

Create a new target using ARM Cortex-M 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. Do not initialize the supported features and the hardware.

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

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

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

show(hTgt)

No output displays since no features or hardware are initialized.

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.