]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Downloading now reads CCXML filename from Makefile.config
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Apr 2015 13:35:08 +0000 (15:35 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 29 Apr 2015 13:35:34 +0000 (15:35 +0200)
rpp/loadti/RM48L952.ccxml [deleted file]
rpp/loadti/TMS570LS3137.ccxml [deleted file]
rpp/rpp/rpp_download.m
rpp/rpp/rpp_make_rtw_hook.m

diff --git a/rpp/loadti/RM48L952.ccxml b/rpp/loadti/RM48L952.ccxml
deleted file mode 100644 (file)
index cfff996..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<configurations XML_version="1.2" id="configurations_0">
-    <configuration XML_version="1.2" id="configuration_0">
-        <instance XML_version="1.2" desc="Texas Instruments XDS100v2 USB Emulator" href="connections/TIXDS100v2_Connection.xml" id="Texas Instruments XDS100v2 USB Emulator" xml="TIXDS100v2_Connection.xml" xmlpath="connections"/>
-        <connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Emulator">
-            <instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
-            <instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
-            <instance XML_version="1.2" href="drivers/tixds100v2cortexR.xml" id="drivers" xml="tixds100v2cortexR.xml" xmlpath="drivers"/>
-            <platform XML_version="1.2" id="platform_0">
-                <instance XML_version="1.2" desc="RM48L952" href="devices/rm48l952.xml" id="RM48L952" xml="rm48l952.xml" xmlpath="devices"/>
-            </platform>
-        </connection>
-    </configuration>
-</configurations>
diff --git a/rpp/loadti/TMS570LS3137.ccxml b/rpp/loadti/TMS570LS3137.ccxml
deleted file mode 100644 (file)
index 5068b36..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<configurations XML_version="1.2" id="configurations_0">
-    <configuration XML_version="1.2" id="configuration_0">
-        <instance XML_version="1.2" desc="Texas Instruments XDS100v2 USB Emulator" href="connections/TIXDS100v2_Connection.xml" id="Texas Instruments XDS100v2 USB Emulator" xml="TIXDS100v2_Connection.xml" xmlpath="connections"/>
-        <connection XML_version="1.2" id="Texas Instruments XDS100v2 USB Emulator">
-            <instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
-            <instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
-            <instance XML_version="1.2" href="drivers/tixds100v2cortexR.xml" id="drivers" xml="tixds100v2cortexR.xml" xmlpath="drivers"/>
-            <platform XML_version="1.2" id="platform_0">
-                <instance XML_version="1.2" desc="TMS570LS3137" href="devices/tms570ls3137.xml" id="TMS570LS3137" xml="tms570ls3137.xml" xmlpath="devices"/>
-            </platform>
-        </connection>
-    </configuration>
-</configurations>
index e4ee84db65e3ccb9c1923c841c2c434e86a178c2..e47f3fddf4393a5048fb9ea147d747e51abbcfdc 100644 (file)
@@ -1,4 +1,4 @@
-% Copyright (C) 2013-2014 Czech Technical University in Prague
+% Copyright (C) 2013-2015 Czech Technical University in Prague
 %
 % Authors:
 %     - Carlos Jenkins <carlos@jenkins.co.cr>
@@ -43,7 +43,7 @@
 %     Readme file in <cssroot>/ccs_base/scripting/examples/loadti/readme.txt
 %     OpenOCD wiki at https://rtime.felk.cvut.cz/hw/index.php/TMS570LS3137#OpenOCD_setup_and_Flashing
 
-function rpp_download(modelName, buildDirectory, use_openocd, use_sdram, ccxml_filename)
+function rpp_download(modelName, buildDirectory, use_openocd, use_sdram)
        RppLibRoot = getpref('rpp', 'RppLibRoot');
        CCSRoot    = getpref('rpp', 'CCSRoot');
        
@@ -78,8 +78,8 @@ function rpp_download(modelName, buildDirectory, use_openocd, use_sdram, ccxml_f
                        disp(['###     -> Uncheck the option "Download compiled binary to SDRAM" (set use_sdram to false) to download the code to the Flash memory.'])
         else
             disp(['### Downloading ', modelName, ' to RPP board...']);
+                       ccxml_filename = ccxml_read(RppLibRoot);
                        if isunix
-                               ccxml_filename = strcat(RppLibRoot, '/../loadti/', strrep(char(ccxml_filename), '"', ''));
                                % -r,   --reset                 Reset target before run
                                % -c,   --cfg-file=CONFIG_FILE  Target setup config file
                                command = [...
@@ -89,7 +89,6 @@ function rpp_download(modelName, buildDirectory, use_openocd, use_sdram, ccxml_f
                                        '"', outfile, ...
                                        '" 2> "', downloadLog, '"'];
                        else
-                               ccxml_filename = strcat(RppLibRoot, '\..\loadti\', strrep(char(ccxml_filename), '"', ''));
                                % -r,   --reset                 Reset target before run
                                % -c,   --cfg-file=CONFIG_FILE  Target setup config file
                                command = [...
@@ -109,3 +108,16 @@ function rpp_download(modelName, buildDirectory, use_openocd, use_sdram, ccxml_f
        end
 
 end
+
+function ccxml_path = ccxml_read(RppLibRoot)
+    f = fopen(fullfile(RppLibRoot, 'Makefile.config'), 'r');
+    while ~feof(f),
+        l = fgetl(f);
+        [val, count] = sscanf(l, ' TARGET_CCXML = %s');
+        if count, ccxml=val; end
+        [val, count] = sscanf(l, ' TARGET = %s');
+        if count, target=val; end
+    end
+    ccxml_path = fullfile(RppLibRoot, 'build', target, ccxml);
+    fclose(f);
+end
\ No newline at end of file
index 0bcb513099cac189403f969c2fcf16a6eedec8b0..dd48be3e81391e1fded235d4dd1d91c99584f8b6 100644 (file)
@@ -1,4 +1,4 @@
-% Copyright (C) 2013-2014 Czech Technical University in Prague
+% Copyright (C) 2013-2015 Czech Technical University in Prague
 %
 % Authors:
 %     - Carlos Jenkins <carlos@jenkins.co.cr>
@@ -139,8 +139,6 @@ function rpp_do_download(modelName)
             use_openocd = str2double(makertwArgs(i).Value);
         elseif strcmp(makertwArgs(i).DisplayLabel, 'RPP_DOWNLOAD_TO_SDRAM')
             use_sdram = str2double(makertwArgs(i).Value);
-        elseif strcmp(makertwArgs(i).DisplayLabel, 'RPP_CCXML_FILE_NAME')
-                       ccxml_filename = makertwArgs(i).Value;
         end
     end
 
@@ -148,7 +146,7 @@ function rpp_do_download(modelName)
         if getenv('RPP_NO_DOWNLOAD')
             disp(['RPP_NO_DOWNLOAD defined - skipping downloading to target.'])
         else
-               rpp_download(modelName, makertwBuildDirectory, use_openocd, use_sdram, ccxml_filename);
+            rpp_download(modelName, makertwBuildDirectory, use_openocd, use_sdram);
         end
     end