I get the error 'Changing property 'CustomSource' is not allowed ' when using the Simulink Coder
Mostra commenti meno recenti
Hello!
I've tried to use a custom configuration for building processus for Simulink Emdedded coder to build a flashing file for my is ARM CortexTM-R4F 32-bit target.
The code I've used should just specify custom C file from Matlab script:
slbuild(MODEL_NAME);
configs = getActiveConfigSet(gcs);
configs.set_param('CustomSource', '\libs\src\calcCRC32.c', '\libs\src\sfunc_calcCRC32.c', '\libs\include\calcCRC32.h');
tic;
slbuild(MODEL_NAME);
I've tried to check the Model configurator but without succes.
2 Commenti
Fangjun Jiang
il 26 Feb 2026 alle 15:14
Can you try removing the first "slbuild(MODEL_NAME)" line? Or run the config.set_param() and then slbuild() one step at a time? I wonder if the error message merely means that you can not change the property while the Simulink Coder is running.
Dimitri
il 26 Feb 2026 alle 15:31
Risposte (1)
Fangjun Jiang
il 26 Feb 2026 alle 15:49
Modificato: Fangjun Jiang
il 27 Feb 2026 alle 16:02
I've run this on a simple example and it worked.
configs = getActiveConfigSet(MODEL_NAME);
configs.set_param('CustomSource', '\libs\src\calcCRC32.c');
slbuild(MODEL_NAME);
Categorie
Scopri di più su Deployment, Integration, and Supported Hardware in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!