When does my model fail to initialize in my compiled executable?

After generating my code and compiling it, I have noticed that my model does not complete the initialization step.
Why does this happen?

 Respuesta aceptada

This issue arises due to the complexity of the model and the generated code. Because the model is very complex, the generated functions require more of the stack than what is available thus causing a stack overflow.
 
To work around this issue, please follow the subsequent steps:
  1.  Enter the folder where the generated code is located (e.g. modelname_ert_rtw)
  2.  Open the make file which is located in the directory (e.g. modelname.mk)
  3. Look for the line that has LDFLAGS and add the appropriate flag to increase the stack size. The flag to increase the stack size depends on which compiler you have:
 For Visual Studio: 
/STACK:8388608,8388608
For MinGW:
-Wl,-stack,0x800000

Más respuestas (0)

Categorías

Más información sobre Simulink Coder en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by