function rpp_download(modelName, buildDirectory, use_openocd, use_sdram)
RppLibRoot = getpref('rpp', 'RppLibRoot');
-
+ CCSRoot = getpref('rpp', 'CCSRoot');
+
%TODO: parse the EXE_FILE_EXT from target_tools.mk
outfile = fullfile(buildDirectory, [modelName, '.out']);
downloadLog = fullfile(buildDirectory, 'download.log');
if use_openocd
- disp(['OpenOCD will be used.'])
if use_sdram
- disp(['Will download to SDRAM'])
command = [...
RppLibRoot '/../loadopenocd/loadopenocd.sh -d flash -b -s ' ...
, outfile, ' 2> ' , downloadLog ];
end
disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);
else
- disp(['Will download to Flash'])
- command = [...
- RppLibRoot '/../loadopenocd/loadopenocd.sh -d flash -b -s ' ...
- , outfile, ' 2> ' , downloadLog ];
- disp('### Running downloader script:');
- disp(command);
- status = system(command);
- if status ~= 0,
- throw(MException('rpp:targetDlErr', ['Failed to download ' modelName ' to the target']))
+ if isunix
+ command = [...
+ RppLibRoot '/../loadopenocd/loadopenocd.sh -d flash -b -s ' ...
+ , outfile, ' 2> ' , downloadLog ];
+ disp('### Running downloader script:');
+ disp(command);
+ status = system(command);
+ if status ~= 0,
+ throw(MException('rpp:targetDlErr', ['Failed to download ' modelName ' to the target']))
+ end
+ disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);
+ else
+ disp(['### Sorry code download is available for UNIX systems only.']);
+ disp(['### -> Add support for non UNIX systems in <targetroot>/rpp/rpp_download.m file.']);
end
- disp(['Done. <a href="matlab:open(''', downloadLog, ''')">Open download log.</a>']);
end
else
- disp(['TI DSS Generic Loader will be used.'])
if use_sdram
- disp(['Will download to SDRAM'])
- disp(['Not yet implemented'])
+ disp(['### Sorry, Downloading to the SDRAM is not yet implemented.'])
else
- disp(['Will download to Flash'])
-
if isunix
disp(['### Downloading ', modelName, ' to RPP board...']);