]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/commitdiff
Add hidden option for target configuration file specification
authorMichal Horn <hornmich@fel.cvut.cz>
Mon, 20 Apr 2015 07:48:22 +0000 (09:48 +0200)
committerMichal Horn <hornmich@fel.cvut.cz>
Mon, 20 Apr 2015 07:48:22 +0000 (09:48 +0200)
rpp/rpp/rpp.tlc
rpp/rpp/rpp.tmf
rpp/rpp/rpp_download.m
rpp/rpp/rpp_make_rtw_hook.m

index 2707567041f3991c2201552b15bb6d133ecb7e12..c48c88ce4cfb9d0116511cf277325e2f80cc9aef 100644 (file)
 
   oIdx = oIdx + 1;
 
+  rtwoptions(oIdx).prompt         = 'Target configuration file name';
+  rtwoptions(oIdx).type           = 'NonUI';
+  rtwoptions(oIdx).default        = 'RM48L952.ccxml';
+  rtwoptions(oIdx).tlcvariable    = 'rppTargetConfFileName';
+  rtwoptions(oIdx).makevariable   = 'RPP_CCXML_FILE_NAME';
+  rtwoptions(oIdx).tooltip        = ['The name of the platform specific target configuration file.'];
+
+  oIdx = oIdx + 1;
 
   rtwoptions(oIdx).prompt          = 'Download compiled binary to RPP.';
   rtwoptions(oIdx).type            = 'Checkbox';
index c1105a18510897cb15bc2b50a1f72106f58b1209..d7b4948a6a3adc407d77908a5170f9994146b30b 100644 (file)
@@ -81,8 +81,10 @@ MODELREF_INC_PATH         = |>START_MDLREFINC_EXPAND_INCLUDES<|-I|>MODELREF_INC_
 RELATIVE_PATH_TO_ANCHOR   = |>RELATIVE_PATH_TO_ANCHOR<|
 MODELREF_TARGET_TYPE      = |>MODELREF_TARGET_TYPE<|
 
-#--------------------------- Linker script value -------------------------------
+#--------------------------- Linker script and target config files---------------
 RPP_LD_SCRIPT_FILE_NAME = |>RPP_LD_SCRIPT_FILE_NAME<|
+RPP_CCXML_FILE_NAME = |>RPP_CCXML_FILE_NAME<|
+
 
 #-- In the case when directory name contains space ---
 ifneq ($(MATLAB_ROOT),$(ALT_MATLAB_ROOT))
index 22f072cec36a3bb9f972636617f848c44756dbb7..e4ee84db65e3ccb9c1923c841c2c434e86a178c2 100644 (file)
@@ -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)
+function rpp_download(modelName, buildDirectory, use_openocd, use_sdram, ccxml_filename)
        RppLibRoot = getpref('rpp', 'RppLibRoot');
        CCSRoot    = getpref('rpp', 'CCSRoot');
        
@@ -79,21 +79,23 @@ function rpp_download(modelName, buildDirectory, use_openocd, use_sdram)
         else
             disp(['### Downloading ', modelName, ' to RPP board...']);
                        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 = [...
                                        'CCS_SCRIPTING="' CCSRoot '/ccs_base/scripting/" ' ...
                                        '"' RppLibRoot '/../loadti/loadti.sh" -r ' ...
-                                       '-c "', RppLibRoot, '/../loadti/RM48L952.ccxml" ', ...
+                                       '-c "', ccxml_filename, '" ',  ...
                                        '"', 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 = [...
                                        'set CCS_SCRIPTING="' CCSRoot '\ccs_base\DebugServer"&&' ...
                                        '"' RppLibRoot '\..\loadti\loadti.bat" -r ' ...
-                                       '-c "', RppLibRoot, '\..\loadti\RM48L952.ccxml" ', ...
+                                       '-c "', ccxml_filename, '" ',  ...
                                        '"', outfile];
             end
             disp('### Running downloader script:');
index e027495e308d37e444268ea1775cb84088e91e0e..3a2462d9542f9474ca880af56a835cc46884d69f 100644 (file)
@@ -139,6 +139,8 @@ 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
 
@@ -146,7 +148,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);
+               rpp_download(modelName, makertwBuildDirectory, use_openocd, use_sdram, ccxml_filename);
         end
     end