Clear Filters
Clear Filters

If I set up the Hardware board in Hardware Implementation, can't I turn ON the "Generate and example main program" setting in Templates?

7 views (last 30 days)
Specific hardware was set in Configuration Parameter --> Hardware Implementation --> Hardware board.
Code Generation --> System target file was set to ert.tlc.
If you turn on "Generate an example main program" in Code Generation --> Templates --> Custom Templates,
<The 'GenerateSampleERTMain' model parameter is set to 'on', but your hardware board requires it to be set to 'off' . Use 'set_param' command to set the 'GenerateSampleERTMain' model parameter to 'off.>" Error occurs.
If I set up the Hardware board in Hardware Implementation, can't I turn ON the "Generate and example main program" setting in Templates?

Answers (1)

Poorna
Poorna on 3 May 2024
Hi,
There are certain restrictions that need to be honoured when trying to generate C code to deploy on specific targets. When a model uses certain service interfaces then the model configuration is restricted so that "GenerateSampleERTMain' is set to false. This mostly depends on the hardware and the modeling aspects.
You can find more information below on the list of restrictions and constraints that are imposed when the generated code uses service interfaces:
Hope this Helps!
  1 Comment
효진
효진 on 8 May 2024
Poorna,
Thank you for your reply.
Looking at the link page you provided, it looks like there are a lot of changes starting from the R2022b version. Can I find the same restrictions in the 2022a version?
(The version I tested was 2022a.)
The reason I tried to "Generate an example main program" above is because I was creating and using a custom target hardware package and wanted to change part of the generated ert_main.c code.
Is there a way to change the generated ert_main.c to the code user wants?

Sign in to comment.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!