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 !

 Réponse acceptée

Alex LeBlanc
Alex LeBlanc le 20 Jan 2023
Modifié(e) : Alex LeBlanc le 25 Jan 2023
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 commentaire

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

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by