MATLAB Link for Code Composer Studio Development Tools | ![]() ![]() |
Execute the program loaded on the target processor
Syntax
Description
run(cc,state,timeout)
starts to execute the program loaded on the target 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.
To define the action of run
, state
accepts three strings that set the state of the processor:
To allow you to specify how long run
waits for the processor to start executing the loaded program before returning, the input argument timeout
lets you set the waiting period in seconds. After you use run
, the routine returns after confirming that the program started to execute, or after timeout
seconds elapses, whichever comes first. If the timeout period expires, run
returns a timeout error.
Examples
After you build and load a program to your target, use run
to start execution.
cc = ccsdsp('boardnum',0,'procnum',0); % Create a link to CCS % IDE. cc.load('tutorial_6xevm.out'); % Load an executable file to the % target. 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.restart; % Return the PC to the beginning of the current % program. cc.run('run'); % Run the program to completion.
This example uses a tutorial program included with DKTI. Set your CCS IDE working directory to be the one that holds your project files. The load
function uses the current working directory unless you provide a full pathname in the input arguments.
Rather than using the dot notation to access the RTDX functions, you can create an alias to the cc
link and use the alias in later commands. Thus, if you add the line
to the program, you can replace
See Also
halt
, isrunning
, restart
![]() | restart | save | ![]() |