Simulink settings for generating code

From ConceptCar
Jump to: navigation, search

Settings for the simulink model for code generation

The following settings must be applied to the simulink model when generating code from it with the realtime workshop & embedded coder. Failure to apply these settings will complicate the subsequent process to integrate this code into the ARM7 runtime platform. Currently, only single-rate/singletasking models are supported. Other models require a more complex handling of the model_step() function.


Top level model

At the top level there must be a simulink model, data exchange with the environment is only possible inports and outports at top level. Code generation from a library is not possible.


Model preferences

These settings must be applied in the model “configuration parameters” dialog:

Solver
type is “fixed step” (tested with “ode3”)
fixed-step size is specified, not “auto”
Hardware implementation
Device vendor is “ARM Compatible”
Device type is “ARM 7”
Error creating thumbnail: Unable to save thumbnail to destination
Real-Time workshop
System target file is “ert.tlc” (choose the first with no auto configuration)
Language is “C”
Optimizations on (faster runs) (may also work without this quite as well)
Deselect “generate makefile”
Select “generate code only”
Error creating thumbnail: Unable to save thumbnail to destination
Interface
Target function library is “GNU99 (GNU)”
Enable floating-point numbers
Disable “GRT compatible call interface”
Select “single output/update function”
Interface is “None”
Error creating thumbnail: Unable to save thumbnail to destination
Templates
Deselect “Generate an example main program”