refence configuration path

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

refence configuration path

107 次查看
AlexG124
Contributor II

In Simulink, when configuring the hardware, I am trying to change the directory for the reference configuration to a relative path.
Simulink -> HW-Settings -> Hardware Implementation -> Target hardware resources -> Referenced Configuration
Reference Configuration Path = '.\generated\referenced_config'

Unfortunately, it is not possible to enter a relative path here.
Nor have I so far been able to set the path via a MATLAB script.
Although the script appears to set the path in CoderTargetData, it is not actually applied.
Either the old path remains active, or an empty path is applied.

Is there a way to set a relative path for the reference configuration?

0 项奖励
回复
2 回复数

25 次查看
dragostoma
NXP Employee
NXP Employee

Hi, @AlexG124,

Thanks for the details. Could you please help us and let us know what are the MBDT toolbox version, as well as the MATLAB version that you are currently using?

In case you are using S32K3 toolbox, there is a model example showcasing the referenced configuration workflow, under model_ref/s32k3xx_refconfig_s32ct folder. Here you will find a MATLAB script called s32k3xx_refconfig_update_paths_callback.m that could help in achieving your goal.

It will be also helpful if you could let us know more details on your referenced configuration way of working, usage and application flow.

 

Best regards,

Dragos

0 项奖励
回复

19 次查看
AlexG124
Contributor II
Hi
 
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 25.2.0.3150157 (R2025b) Update 4
MATLAB License Number: *******
Operating System: Microsoft Windows 11 Business Version 10.0 (Build 26200)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 25.2 (R2025b)
Simulink Version 25.2 (R2025b)
Embedded Coder Version 25.2 (R2025b)
MATLAB Coder Version 25.2 (R2025b)
Model-Based Design Toolbox for BMS Series Version 1.2.3 (R2021a-R2024b)
Model-Based Design Toolbox for S32K3xx Series Version 1.4.5 (R2021a-R2023a)
Requirements Toolbox Version 25.2 (R2025b)
Simscape Version 25.2 (R2025b)
Simscape Battery Version 25.2 (R2025b)
Simulink Check Version 25.2 (R2025b)
Simulink Coder Version 25.2 (R2025b)
Simulink Coverage Version 25.2 (R2025b)
Simulink Design Verifier Version 25.2 (R2025b)
Simulink Test Version 25.2 (R2025b)
Stateflow Version 25.2 (R2025b)
System Composer Version 25.2 (R2025b)
>>
  • BMS application
  • NXP HW: RD-HVBMSCT800BUN
  • We use the configuration of our referenced hardware model as a reference for all models (that works) 
 
Problems:
  • The script you described above does not work with our version of MBDT
  • We have tried to set the path in a similar way using a script. It also looks as though it is working. However, when you check the configuration in Simulink, the path for the reference configuration is always empty, or the old path is included.
     
Part of our script:
 
Load_system(mdl);
% get active ref. Config
csRef = getActiveConfigSet(mdl);
cfg = csRef.getRefConfigSet();
 
% get reference Configuration struct {path, browse}
s = get_param(mdl,'CoderTargetData');
 
% set path to root)
%proj = currentProject;
%projectFolder = proj.RootFolder;
 
%s.refConfig_location = projectFolder;
projectFolder = ".\generated\referenced_config"; % relative path, replace with actual path
s.refConfig_enable = 1;
s.refConfig_location = projectFolder;
 
% set new ref. config path
fprintf('set reference configuration path to %s \n', projectFolder);
set_param(cfg,'CoderTargetData', s);
 
sl_refresh_customizations;
%save_system(mdl);
 
cs = getActiveConfigSet(mdl);
cs.refresh;
cfg = csRef.getRefConfigSet();
% check ref. config
s = get_param(cfg,'CoderTargetData');
fprintf('reference configuration path: %s from %s \n', s.refConfig_location, csRef.Name); % output is correct!
 
 
Br,
Alex
0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2413554%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE%E8%B7%AF%E5%BE%84%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2413554%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3E%E5%9C%A8%20Simulink%20%E4%B8%AD%E9%85%8D%E7%BD%AE%E7%A1%AC%E4%BB%B6%E6%97%B6%EF%BC%8C%E6%88%91%E5%B0%9D%E8%AF%95%E5%B0%86%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE%E7%9A%84%E7%9B%AE%E5%BD%95%E6%9B%B4%E6%94%B9%E4%B8%BA%E7%9B%B8%E5%AF%B9%E8%B7%AF%E5%BE%84%E3%80%82%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3ESimulink%20-%26gt%3B%20%E7%A1%AC%E4%BB%B6%E8%AE%BE%E7%BD%AE%20-%26gt%3B%20%E7%A1%AC%E4%BB%B6%E5%AE%9E%E7%8E%B0%20-%26gt%3B%20%E7%9B%AE%E6%A0%87%E7%A1%AC%E4%BB%B6%E8%B5%84%E6%BA%90%20-%26gt%3B%20%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE%E8%B7%AF%E5%BE%84%20%3D%20'.%5Cgenerated%5Creferenced_config'%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3E%E5%BE%88%E9%81%97%E6%86%BE%EF%BC%8C%E8%BF%99%E9%87%8C%E6%97%A0%E6%B3%95%E8%BE%93%E5%85%A5%E7%9B%B8%E5%AF%B9%E8%B7%AF%E5%BE%84%E3%80%82%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E5%88%B0%E7%9B%AE%E5%89%8D%E4%B8%BA%E6%AD%A2%EF%BC%8C%E6%88%91%E8%BF%98%E6%B2%A1%E8%83%BD%E9%80%9A%E8%BF%87%20MATLAB%20%E8%84%9A%E6%9C%AC%E8%AE%BE%E7%BD%AE%E8%B7%AF%E5%BE%84%E3%80%82%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E8%99%BD%E7%84%B6%E8%84%9A%E6%9C%AC%E4%BC%BC%E4%B9%8E%E5%9C%A8%20CoderTargetData%20%E4%B8%AD%E8%AE%BE%E7%BD%AE%E4%BA%86%E8%B7%AF%E5%BE%84%EF%BC%8C%E4%BD%86%E5%AE%9E%E9%99%85%E4%B8%8A%E5%B9%B6%E6%B2%A1%E6%9C%89%E5%BA%94%E7%94%A8%E3%80%82%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%3E%E8%A6%81%E4%B9%88%E4%BF%9D%E6%8C%81%E6%97%A7%E8%B7%AF%E5%BE%84%E6%9C%89%E6%95%88%EF%BC%8C%E8%A6%81%E4%B9%88%E5%BA%94%E7%94%A8%E4%B8%80%E4%B8%AA%E7%A9%BA%E8%B7%AF%E5%BE%84%E3%80%82%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E6%98%AF%E5%90%A6%E5%8F%AF%E4%BB%A5%E4%B8%BA%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE%E8%AE%BE%E7%BD%AE%E7%9B%B8%E5%AF%B9%E8%B7%AF%E5%BE%84%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2414240%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20refence%20configuration%20path%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2414240%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F240256%22%20target%3D%22_blank%22%3E%40AlexG124%3C%2FA%3E%20%EF%BC%8C%3C%2FP%3E%0A%3CP%3E%E8%B0%A2%E8%B0%A2%E4%BD%A0%E6%8F%90%E4%BE%9B%E7%9A%84%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF%E3%80%82%E8%AF%B7%E9%97%AE%E6%82%A8%E8%83%BD%E5%90%A6%E5%91%8A%E7%9F%A5%E6%88%91%E4%BB%AC%E6%82%A8%E7%9B%AE%E5%89%8D%E4%BD%BF%E7%94%A8%E7%9A%84%20MBDT%20%E5%B7%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