You can use the OSEK adaptor to generate code and build
applications for Metrowerks OSEK 21 operating systems.
Procedure
- Create a new project of type AutomotiveC.
- Add OSEK tasks to your model: (or OSEK21ExtendedTask).
- For each task, change the Concurrency box
to Active.
- For each task, use the Tags tab
of the Features window to set the necessary values for the OIL definition.
- For each task, add the required attributes
and operations.
- Create a new OSEK21HC12Configuration configuration
().
- Set the new configuration to be the active
configuration
- In the configuration, set the C_CG:OSEK21HC12:OSEKDIR property
to the path to OSEK 21 for HC12.
- In the configuration, set the C_CG:OSEK21HC12:
HICROSSDIR property to the path to the Hiware tools.
- If necessary, modify the value of the following
properties:
- C_CG::OSEK21HC12::OsekMainFileDefinition - determines
the content of the C source file that contains the main entry of the
OSEK application and the definition of the predefined tasks from the
framework (OS_TASK and TIMER_TASK).
- C_CG::OSEK21HC12::OilDefinitionTemplate - the
content of the OIL file cfg.oil that contains include statements to
include the model specific OIL definition.
- Generate and compile the application.
Results
To build an application for the OSEK21 OS/NT
target, use OSEK21NTConfiguration when creating a
new configuration, and in the configuration, set the C_CG::OSEK21NT::OSEKDIR property
to the path to OSEK 21 for NT.