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 !

 Respuesta aceptada

Alex LeBlanc
Alex LeBlanc el 20 de En. de 2023
Editada: Alex LeBlanc el 25 de En. de 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 comentario

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

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2018b

Preguntada:

el 22 de Jun. de 2021

Editada:

el 25 de En. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by