Building applications using OSEK21 adaptors

You can use the OSEK adaptor to generate code and build applications for Metrowerks OSEK 21 operating systems.

Procedure

  1. Create a new project of type AutomotiveC.
  2. Add OSEK tasks to your model: Add New > AutomotiveC > OSEK21BasicTask (or OSEK21ExtendedTask).
  3. For each task, change the Concurrency box to Active.
  4. For each task, use the Tags tab of the Features window to set the necessary values for the OIL definition.
  5. For each task, add the required attributes and operations.
  6. Create a new OSEK21HC12Configuration configuration (Add New > OSEK21 > OSEK21HC12Configuration).
  7. Set the new configuration to be the active configuration
  8. In the configuration, set the C_CG:OSEK21HC12:OSEKDIR property to the path to OSEK 21 for HC12.
  9. In the configuration, set the C_CG:OSEK21HC12: HICROSSDIR property to the path to the Hiware tools.
  10. 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.
  11. 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.


Feedback