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?

 採用された回答

MathWorks Support Team
MathWorks Support Team 2020 年 11 月 2 日

0 投票

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

製品

リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by