OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

25
2008 Chapter-10 L11: "Embedded Systems - Architecture, Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc. 1 REAL TIME OPERATING SYSTEM REAL TIME OPERATING SYSTEM PROGRAMMING PROGRAMMING - - II: Windows CE, II: Windows CE, OSEK and Real time Linux OSEK and Real time Linux Lesson-11: Automobile Application Standards and Automobile Application Standards and OSEK OSEK - - OS OS

Transcript of OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

Page 1: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

1

REAL TIME OPERATING SYSTEM REAL TIME OPERATING SYSTEM PROGRAMMINGPROGRAMMING--II: Windows CE, II: Windows CE,

OSEK and Real time Linux OSEK and Real time Linux

Lesson-11: Automobile Application Standards and Automobile Application Standards and

OSEKOSEK--OSOS

Page 2: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

2

StandardsStandards

• TTP (Time Triggered Protocol) • CAN (Controller Area Network) Bus• MOST (Media Oriented System

Transport)

Page 3: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

3

Standards . . .Standards . . .

• IEE (Institute of Electrical Engineers) guidance standard for EMC (Electromagnetic Magnetic Control) and functional safety guidance

Page 4: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

4

Standards…Standards…• AMI-C (Automotive Multimedia

Interface Collaboration) [http://www.ami-c.org],

• MISRA-C (Motor Industry Reliability Association standard for C language software guidelines for automotive systems) [http://www.misra.org.uk]

Page 5: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

5

Standards…Standards…

• OSEK/VDX RTOS communication and network management

[http://www.osek-vdx.org]

Page 6: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

6

OSEK Basic Features

Page 7: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

7

OSEKOSEK

• OSEK - named after the German words for Open (Offene) System (System) for Electronic (Electronik) embedded component and interface Crafts (Kraftfahrzeugen).

Page 8: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

8

OSEK …OSEK …

OSEK defines three standards -• OSEK-OS for operating system, which

gives greater reliability than other OSs – an essentiality in automobile applications

Page 9: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

9

OSEK …OSEK …

• OSEK-NM architecture for network management.

• OS divides tasks into four types, and the NM divides the architecture into two types (i) Direct transfer and interchange of network messages (ii) Indirect transfer and interchange, both between the nodes.

Page 10: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

10

OSEK …OSEK …

• OSEK-COM architecture for IPCs between the same and different CPUs control unit tasks. Between the different unit tasks, there exists data-link and physical layers. Different CPU physical layers interface though CAN bus.

Page 11: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

11

OSEKOSEK--OS OS featuresfeatures

• Language can be application-specific, need not be just C or C++ and data Types are also be application specific and not RTOS specific.

Page 12: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

12

OSEKOSEK--OS features … OS features …

• For example, VxWorks STATUS is RTOS specific. OSEK- OS does not permit, RTOS specific data type.

Page 13: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

13

OSEKOSEK--OS features … OS features …

• OS each method, class and run-time library should be scalable. This optimizes the memory needs.

• Tasks are classified into four types. This gives for a clear-cut distinction to programmer: which class to use for what modules in the system.

Page 14: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

14

OSEKOSEK--OS features OS features Four Type of Tasks Four Type of Tasks definitionsdefinitions

• Basic class one task of each priority and single activation - called BCC 1 (Basic Conformance Class 1)

• Extended class one extended task of each priority and single activation. It is called ECC 1 (Extended Conformance Class 1)

Page 15: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

15

OSEKOSEK--OS features Four Type of Tasks OS features Four Type of Tasks definitionsdefinitions ……

Extended task means, for example, a task created by FirstTask in Example 9.17.

• Basic with multiple tasks of each priority and multiple times activation during run. It is called BCC 2.

Page 16: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

16

OSEKOSEK--OS features Four Type of Tasks OS features Four Type of Tasks definitionsdefinitions ……

• Extended with multiple tasks of each priority and multiple times activation during run. It is called ECC 2.

Page 17: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

17

OSEKOSEK--OS features … OS features …

• OS schedules ISRs and tasks in distinct ways. [VxWorks scheduler also does so].

• Interrupt system disables at the beginning of the service routine and enables on return. This lets the task run in real-time environment.

Page 18: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

18

OSEKOSEK--OS features … OS features …

• Task can consist of three type of objects, event (semaphore), resource (statements and functions) and devices. A port device exemplary device object alarm- Displays the pictograms, messages and flashing messages as well as sounds buzzer and beeps.

Page 19: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

19

OSEKOSEK--OS features …OS features …

• Task can be scheduled in real-time.• Timer, task or semaphore objects run-

time creation and deletion cannot be allowed. A run-time bug may lead to uncalled deletion of a timer or semaphore. That is the potential source of problem and thus unreliable.

Page 20: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

20

OSEKOSEK--OS features … OS features …

• IPC-message queue posting by a task is not allowed as a waiting task may wait indefinitely for its entire message needs. RTOS queue types, waiting infinitely or for a time out for message can be potential source of trouble and thus unreliable.

Page 21: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

21

OSEKOSEK--OS features …OS features …

• Similar risks may arise with semaphore as a resource key or counter - therefore not used.

Page 22: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

22

OSEKOSEK--OS features … OS features …

• Before entering a critical section and when executing a service routine, all interrupts must disable and enable on return only.

Page 23: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

23

SummarySummary

Page 24: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

24

We learntWe learnt• RTOS - OSEK for automotive

electronics.• OSEK defines four types of classes

BCC1, ECC1, BCCC2, ECC2COM and conformance classes CCCA and CCCB for internal communication, specifies that there should be no creation and deletion of tasks during run.

• Task Priority must be defined and task activates only once in the codes.

• There must not be used message queues, and Semaphores as flag only

Page 25: OSEK PROGRAMMING - Devi Ahilya Vishwavidyalaya

2008Chapter-10 L11: "Embedded Systems - Architecture,

Programming and Design" , Raj Kamal, Publs.: McGraw-Hill, Inc.

25

End End Lesson-11 on Automobile Application Standards and Automobile Application Standards and

OSEKOSEK--OSOS