Relative path to project root in model Configuration Paramters

Hello everyone,
I'm using the simulink hardware support package for Texas Instrument C2000 processors and I'm looking for a way to set a relative path to my project root for a hardware configuration file :
I've tried several things that didn't work like :
../../UTILITIES/MyFile.ccxml
$(PROJECT_ROOT)/UTILITIES/MyFile.ccxml
I get the following error when building :
The following error occurred during deployment to your hardware board: The path '$(PROJECT_ROOT)\UTILITIES\F28379D_XDS510USB.ccxml' does not exist.
Component:Simulink | Category:Block diagram error
Thanks in advance !

 채택된 답변

Alex LeBlanc
Alex LeBlanc 2023년 1월 20일
편집: Alex LeBlanc 2023년 1월 25일
I know your post was a couple of years ago, but in case this can help others, here's a solution I found that works for me. My model's InitFcn callback is set to a config script and I added the following code to it. You'd just need to modify slightly for your application.
cs = getActiveConfigSet(gcs);
ctd = get_param(cs, 'CoderTargetData');
ctd.Runtime.LoadCommandArg = [pwd, '\my_file.ccxml'];
set_param(cs, 'CoderTargetData', ctd);

댓글 수: 1

Hi,
Thank you for sharing this !
I used a similar solution on my project.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

릴리스

R2018b

질문:

2021년 6월 22일

편집:

2023년 1월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by