Error when deploying mcb_open_loop_control_nucleo_g474re on target
Afficher commentaires plus anciens
I am getting an error as shown below, please let me know the resolution:

Réponses (1)
Vedant Shah
le 13 Fév 2026
The error occurs because Simulink does not allow changing certain block parameters while the model is running in External mode. In this case, the "Constant block value" inside the Start and Stop Motor subsystem is a non-tunable parameter, so when the model is executing on the target, Simulink cannot update it and throws that error.
To fix this:
One quick ways is to stop the simulation before modifying that Constant value, then run again.
And a more proper way is to:
- Make the parameter tunable by replacing the constant with a variable (e.g., a Simulink.Parameter)
StartMotor = Simulink.Parameter(1);
StartMotor.CoderInfo.StorageClass = 'ExportedGlobal';
and now if we set the value of constant block as "StartMotor", it will become tunable.
- Using an input/dashboard control instead of a Constant block.
For start/stop signals specifically, it’s better to use a runtime input (button, switch, or Inport) rather than a Constant block, since constants are compiled as fixed values during code generation.
For more information, refer to the following documentations:
Catégories
En savoir plus sur Texas Instruments C2000 Processors dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!