1 % Copyright (C) 2013 Czech Technical University in Prague
4 % - Carlos Jenkins <carlos@jenkins.co.cr>
6 % This program is free software; you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation; either version 2 of the License, or
9 % (at your option) any later version.
11 % This program is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
16 % You should have received a copy of the GNU General Public License
17 % along with this program. If not, see <http://www.gnu.org/licenses/>.
19 % File : rpp_download.m
21 % Code download utility for Simulink RPP Target.
24 % loadti utility wiki at http://processors.wiki.ti.com/index.php/Loadti
25 % Readme file in <cssroot>/ccs_base/scripting/examples/loadti/readme.txt
32 function rpp_download(modelName, buildDirectory)
34 CCSRoot = getpref('rpp', 'CCSRoot');
35 RppLibRoot = getpref('rpp', 'RppLibRoot');
37 %TODO: parse the EXE_FILE_EXT from target_tools.mk
38 outfile = fullfile(buildDirectory, [modelName, '.out']);
39 downloadLog = fullfile(buildDirectory, 'download.log');
43 disp(['### Downloading ', modelName, ' to RPP board...']);
45 % -a, --async-run Run the specified executable and return without halting
46 % -r, --reset Reset target before run
47 % -c, --cfg-file=CONFIG_FILE Target setup config file
48 system(['LD_PRELOAD="', ...
49 CCSRoot, '/ccs_base/DebugServer/bin/libti_xpcom.so" "', ...
50 CCSRoot, '/ccs_base/scripting/examples/loadti/loadti.sh" -a -r ', ...
51 '-c "', RppLibRoot, '/TMS570LS3137.ccxml" ', ...
53 '" 2> "', downloadLog, '"']);
55 disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);
58 disp(['### Sorry code download is available for UNIX systems only.']);
59 disp(['### -> Add support for non UNIX systems in <targetroot>/rpp/rpp_download.m file.']);