79
Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSARDr. Thomas Zurawka, SYSTECS, Februar 2015

Page 2: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

2© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Introduction

The Vehicle – A driving low cost Computer network

… more than 40 Mio. new vehicles with 1.000 Mio. ECU per year

… ECU Software for 8…32-Bit Fixed-Point Processor

ElectronicControlUnit

Source for ECU: Robert Bosch GmbH

Page 3: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

3© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Introduction

The Vehicle – A driving low cost Computer networkcontains … heterogeneous Components

Gasoline & Electrical Engines, Wireless Cell Phones, …

must be delivered … with 0 Defects … for 5.000 Euro – 150.000 Euro … within 3 years Development Time

must be developed … together with many, highly integrated Suppliers

must be maintained … for 30 years

Source for Throttle: Robert Bosch GmbH

Page 4: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

4© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Trends in the Automotive Industry

The Vehicle - A driving low cost Computer network

8 Bit … 32 Bit Controllers

5kByte – 2MByte Bytes Flash

Why is there so much pressure on Controller size and Memory consumption ?

1MByte Flash costs 10 Euro !

Page 5: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

5© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

OSEK

1990 2006 2021

Trends in the Automotive Industry

The Vehicle - A driving low cost Computer network Standardization of ECU Software Architecture and Data

due to problems with ECU networks and Exchange of Data between Tools and between OEM & suppliers

Page 6: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

6© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Assembler

C

Graphic

1990 2006 2021

a=b+c;

R=0x5;

The Vehicle - A driving low cost Computer network System & software engineers are using

Graphical Design

Trends in the Automotive Industry

… more than 60% of Application Software of an ECU

graphically written

Tools must support co-existence of C and Graphic

Is C-Coding really

necessary ?

Page 7: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

7© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

The Vehicle - A driving low cost Computer network Road -> Test Cell -> Lab -> Math

Trends in the Automotive Industry

Road

Test Cell

Lab

Math

1990 2006 2021

Do we really need the Road

for final Testing ?

Page 8: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

8© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Worldwide distributed Development Teams e.g. 1000 Employees & 100 Projects per year for one ECU generation

Trends in the Automotive Industry

Do we alreadyhave the Toolswhich supportthis use case ?

Page 9: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

9© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

HC[g/km]

CO [g/km]6.0

0.4

1.0 2.0 3.0 4.0 5.00.0

0.1

0.2

0.3

Euro 3Euro 4LEVULEVSULEV

EmissionRegulations

Trends in the Automotive Industry

Increasing complexity An Example: Legal Requirements

Source: Robert Bosch GmbH

Much more Software

needed …

and …other System

Concepts, e.g.Hybrids, Fuel

Cell, …

Real World

Zero Emission

Page 10: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

10© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Increasing Complexity due to Customer Requirements, Legal Requirements more Variants and more complex Controllers

50 Registers -> 1000 Registers

Trends in the Automotive Industry

Which Tools can manage

this huge amount of

Data ?Linesof Code(perProject)

5 Mio

+ 10% p.a.

2006

Page 11: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

11© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

How does the Automotive Industry master thesechallenges ?

CMMI or SPICE complaint Processes

Tricky development Methods and …

… Graphical Design & Test withTools, Tools, Tools, …

Is CMMI 3,4 or 5 the right final

level ?

Trends in the Automotive Industry

Page 12: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

12© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Trends in the Automotive Industry

CAE- Tools for the Development of Software for Vehicles V-Cycle for ECU Software

RequirementsAnalysis

Implementation

Validation

Verification

Design

Many Tools from different Vendors are in use !

Can ONE Tool Family or ONE Vendor dominate

the V-Cycle ?

Page 13: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

13© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

The Virtual Development Initiative

Integrated Development Environment- ECU Simulation Backplane -

Throttle, …ECU Software

Initiatives in the Automotive Industry

Which Tool Vendor supports Co-Design of ECU Software, ECU Hardware and Vehicle

Components first ?

ECU Hardware

Page 14: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

14© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

The Automation Initiative

Initiatives in the Automotive Industry

RequirementsAnalysis

Implementation

Design

Automatic Code Generation

Why is still a re-work of the Design Model

necessary ?

Why can we not generate the Design Model from the

Requirements ?

a=b+c;

Page 15: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

15© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

The Automation Initiative

Initiatives in the Automotive Industry

Validation

Verification

Automatic Tests- HIL -

With what language shall I code

my Test Scripts ?

Can I share them

with others ?

How can I manage them ?

Is manual coding really necessary ?

HIL Tests are very

important for release of

high quality Software !,

but …

Page 16: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

16© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

The Automation Initiative

Initiatives in the Automotive Industry

RequirementsAnalysis

Implementation

Validation

Verification

Design

AutomaticTest Script Generation

Huge Efficiency increase possible, but…

still no Technologyavailable !

Page 17: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

17© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Operating System

The Standardization Initiative

Some of the Objectives Standardization of Basic

Software Transferability of Software

Components throughout network

Integration of Software Components from multiple suppliers

Basic-Softwaree.g. Networking, Flashing, Diagnostics, …

AUTOSAR Software Components

AUTOSAR Runtime Environment

ECU Software Architecture

Initiatives in the Automotive Industry

Page 18: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

18© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

The Standardization Initiative

Bus

ECU 2- Supplier 2 -

ECU 3- Supplier 3 -

ECU 1- Supplier 1 -

Seat Heating- Supplier 1 -

Climate Control- Supplier 2 -

Window Lifter- Supplier 3 -

Virtual Bus

Initiatives in the Automotive Industry

Tools

Page 19: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 1: AUTOSAR – in a NutshellConcepts – Software Component, Virtual Functional Bus, ECU Software Architecture

Page 20: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

20© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Window Lifter Climate Control Engine Control

Tools

Overview

This isthe basic Idea

Software Component

ECU

Page 21: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

21© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

AUTOSAR SWC 1

Virtual Functional Bus

AUTOSAR SWC 2 AUTOSAR SWC 3

AUTOSAR SWC 1 AUTOSAR SWC 2 AUTOSAR SWC 3

Runtime Environment

Basic SoftwareBasic Software

Runtime Environment

Bus

Tools

Software Component Descriptions

Overview

… now in AUTOSARTerms

ECU Resource DescriptionSystem Descriptions

Page 22: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

22© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

AUTOSAR Runtime Environment

Application Software Layer

Microcontroller

Basic Software Layer

ComplexDeviceDrivers

I/O HardwareAbstraction

Onboard DeviceAbstraction

Memory HardwareAbstraction

Communication Hardware Abstraction

MicrocontrollerDrivers

MemoryDrivers

CommunicationDrivers

I/ODrivers

Basic Software A/D, D/A, …

CAN, LIN, Flexray

System Services Memory Services Communication Services

Operating System

EEPROM Driver

standardized C-Code Module !

Tools

Page 23: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

23© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

I/O Hardware

Abstraction

ComplexDeviceDrivers

Microcontroller Drivers

Basic Software – The complete Picture (roughly 50 Modules)

GPT

Driv

er

Wat

chdo

g D

river

MC

U D

river

Memory Drivers

RAM

Tes

t D

river

Flas

h D

river

EEPR

OM

Driv

er

Communication Drivers I/O Drivers

ICU

Driv

er

PWM

Driv

er

ADC

Driv

er

DIO

Driv

er

Port

Driv

er

OnboardDevice Abstraction

WatchdogInterface

Memory Hardware Abstraction

Memory Abstraction Interface

EEPROM Abstraction

Flash / EEPROMEmulation

Communication Hardware Abstraction

CAN Interface

CAN Transceiver

Driver

FlexRay Interface

FlexRay Transceiver

Driver

LINInterface

System Services

AUTO

SAR

Ope

ratin

g Sy

stem

BSW

Sch

edul

er

CRC Lib

ECU StateManager

Function InhibitionManager

Diagnostic Event Manager

WatchdogManager

Development Error

Tracer

Communication Manager

Memory Services

NVRAM Manager

Communication Services

AUTOSARCOM

DiagnosticCommunication

Manager

Generic Network Mgmt

CANNetwork

Mgmt

PDU Router

CANTransport Protocol

IPD

U M

ultip

lexe

r

FlexRayTransport Protocol

CAN GenericNetwork

Mgmt

FlexRayNetwork

Mgmt

Microcontroller

SPI H

andl

er D

river

LIN

Driv

er

CAN

Driv

er

Flex

Ray

Driv

er

Page 24: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleIntroduction

Page 25: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

25© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

An Example

SignalAdjustment

TireControl

DisplayInfo

Sensors

PressureRaw

TemperatureRaw

Pressure

Temperature

Pressure CalibrationRequest Warning

Measuring and Displaying the Tire Pressure

Vehicle Display

DisplayRaw

Page 26: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 1: Edit the Software Components

Page 27: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

27© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 1: The Software Components itself

SignalAdjustment

TireControl

DisplayInfo

We define 3 Atomic Software Components

“Signal Adjustment”

“Tire Control”

“Display Info”

Page 28: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

28© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 1: The Ports of the Software Components

The Software Components have to communicate, e.g. to exchange information They need Ports to do this

Ports will be assigned either to Sender-Receiver Interfaces or Client-Server Interfaces

Not used in this Example !

We choose Sender-Receiver Interfacesto transport our Data

SignalAdjustment

Port

Sender-Receiver Interface

Data Elements

Page 29: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

29© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 1: The Ports of the Software Components

We define the Sender-ReceiverInterfaces PressureTemperature Pressure Warning Calibration

PressureTemperature

uint16 Pressure

uint16 Temperature

Pressure

uint16 Pressure

Warning

Boolean Warning

Calibration

Boolean Calibration

Page 30: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

30© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

We assign now the Sender-ReceiverInterfaces to the SoftwareComponents Ports become P-Ports or

R-Ports P-Ports provide information R-Ports receive information

SignalAdjustment

Tire Control

PressureTemperature

Pressure

PressureTemperature

Warning Calibration

Display Info

Pressure

Warning Calibration

Step 1: The Ports of the Software Components

Page 31: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 2: Edit the Software Component Network

Page 32: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

32© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

TireControl

DisplayInfo

We define

A Composition“Vehicle Software”

Vehicle Software

Step 2: The Software Component Network

Page 33: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

33© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

TireControl

DisplayInfo

We assign the Software Components to the Composition

Vehicle Software

Step 2: The Software Component Network

Page 34: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

34© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Vehicle Software

Step 2: The Software Component Network

We take the Composition“Vehicle Software”and connecttheSoftware Components

SignalAdjustment

Tire Control

PressureTemperature

Pressure

PressureTemperature

Warning Calibration

Display Info

Pressure

Warning Calibration

Page 35: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

35© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 2: The Software Component Network

SignalAdjustment

PressureTemperature

Pressure

Display Info

PressureWarningCalibration

Tire Control

PressureTemperature

Warning Calibration

Virtual Functional Bus

Page 36: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 3-1: Edit Runnables & Events for the Software Components

Page 37: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

37© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 3: Runnables & Events

Where is the Code to fill the Software Components with Life ?

This is done with Runnables !

For any Atomic Software Componentyou can define one or more Runnables

Tire Control

PressureTemperature

Warning Calibration

Calculate Warning

New CalibrationRunnable

Page 38: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

38© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Runnables can be executed in thefollowing ways Periodically triggered with a

defined Period

On Data Reception with the Reception of

a certain Data Element The Data Element that should

trigger the Runnable must bespecified

Step 3: Runnables & Events

Tire Control

PressureTemperature

Warning Calibration

Calculate Warning

New Calibration

100ms

Cal

ibra

te

Page 39: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

39© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

What do we have so far ?

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display InfoPressure

Warning Calibration

Show Pressure

New CalibrationWarning Request

500ms

War

ning

Pressure

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

Cal

ibra

te

Pressure

Temperature

Page 40: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 3-2: Edit the Code for the Software Components

Page 41: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

41© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

We still miss the real Code !

Based on the Information on the previous slide,AUTOSAR Code-Generators may generate Templatesfor each Software Component Header Files (fully automatically generated) C/C++ Files (only generation of Templates)

Step 3: The Code for the Software Components

Page 42: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

42© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Here we are:

Step 3: The Code for the Software Components

/* Header File for Tire Control */

/* Output Interfaces */RTE_WRITE_Pressure_Pressure (IN uint16 Pressure);RTE_WRITE_PressureTemperature_Pressure (IN unit16 Pressure);RTE_WRITE_PressureTemperature_Temperature (IN unit16 Temperature);

Signal_Adjustment .h

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Page 43: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

43© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Here we are:

Step 3: The Code for the Software Components

/* Header File for Tire Control */#include signal_adjustment.h

/* Runnable Entities */Void Send_Values (void);{uint16 sensor_temperature;uint16 sensor_pressure;

Sensor_temperature= 20; /* That’s trick, since we have no sensor software component */Sensor_pressure = 3 /* That’s trick, since we have no sensor software component */

RTE_WRITE_PressureTemperature_Temperature (sensor_temperature);RTE_WRITE_PressureTemperature_Pressure (sensor_pressure);RTE_WRITE_Pressure_Pressure (sensor_pressure);}

Signal_Adjustment .c

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Page 44: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

44© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Here we are:

Step 3: The Code for the Software Components

/* Header File for Tire Control */

/* Input Interfaces */RTE_READ_Calibration_Calibrate (OUT boolean* Calibrate);RTE_READ_PressureTemperature_Pressure (OUT unit16* Pressure);RTE_READ_PressureTemperature_Temperature (OUT unit16* Temperature);

/* Output Interfaces */RTE_WRITE_Warning_Warning (IN boolean Warning);

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

Cal

ibra

te

Tire_Control .h

Page 45: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

45© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Here we are:

Step 3: The Code for the Software Components

/* Header File for Tire Control */#include tire_control.h

/* Runnable Entities */Void Calculate_Warning (void);{uint16 local_temperature;uint16 local_pressure;

RTE_READ_PressureTemperature_Temperature (& local_temperature);RTE_READ_PressureTemperature_Pressure (& local_pressure);

If (local_pressure < 3){RTE_WRITE_Warning_Warning (1);}}

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

Cal

ibra

te

Tire Control .c

Page 46: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

46© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

/* Header File *//* C File */

/* Header File *//* C File */

/* Header File *//* C File */

What do we have so far ?

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display InfoPressure

Warning Calibration

Show Pressure

New CalibrationWarning Request

500ms

War

ning

Pressure

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

Cal

ibra

te

Pressure

Temperature

Page 47: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

47© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Display Info

PressureWarningCalibration

Tire Control

PressureTemperature

Warning Calibration

Virtual Functional Bus

Send Values

100ms

Calculate WarningNew Calibration

100msShow Pressure

New CalibrationWarning Request

500ms

Step 3: Summary

/* Header File *//* C File */

/* Header File *//* C File */

/* Header File *//* C File */

Page 48: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

48© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Interaction Mechanisms

SWCs call RTE functions through a well-defined API

RTE

Runnable 1

Runnable 2

SWC 1

Runnable 1

Runnable 2

SWC 2

PrinciplesImplementation of a Software Component

Page 49: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

49© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Interaction Mechanisms

The RTE calls SWCs by invoking user defined Runnables

This is simply a Call-back from the RTE to user code

RTE

Runnable 1

Runnable 2

SWC 1

Runnable 1

Runnable 2

SWC 2

PrinciplesImplementation of a Software Component

Page 50: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

50© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

RTE

AUTOSAR SWCRTE API calls:RTE_SEND_<Port>_<Event>();RTE_RECEIVE_<Port>_<Event>();RTE_WRITE_<Port>_<Data>();RTE_READ_<Port>_<Data>();RTE_CALL_<Port>_<Operation();RTE_ENTER_<Exclusive Area>();…

RTE Runnable callbacks:MyRunnable();…

OS API calls:ActivateTask();SetEvent();WaitEvent();…

COM API calls:COM_SendSignal();COM_ReceiveSignal();…

COM Callbacks:COMCallback(…);…

AUTOSAR COMAUTOSAR Operating System

<Runnable>

<Dat

a>

<Port>/* Runnable Entities */Void <Runnable> (void);{ RTE_WRITE_Port_Data (value); }

PrinciplesImplementation of a Software Component

Page 51: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

51© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Example: Sensor Software Component

Physical Interface Electrical Interface Electrical Interface

Sensor ECUElectronics

MicrocontrollerPeripherals

Hardware

I/OSignal Interface

ADCDriver

SoftwareSensorSoftware

Component

Temperature

ApplicationSoftware

Component

ApplicationSWC

Basic Software

Runtime Environment

SensorSWC

Sensor

I [mA] U [V]

ADC_Read_ChannelIT

A/D converterI/U converter

Calculate ICalculate T (I)Algorithm

Implementation of a SW Component

Page 52: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 4-1: Edit the ECUs

Page 53: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

53© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

For this Example we need 2 ECUs: Tire ECU Cockpit ECU

Step 4: Definition of the ECUs

Cockpit ECUTire ECU

ECU

Page 54: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

54© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

<<ECU Type>>Tire ECU

Step 4: Definition of the ECUs

<<Processing Unit>>

<<Volatile Memory>>

<<Non-Volatile Memory>>

<<SensorHardware>>

<<Display Hardware>>

Microcontroller

<<ADC>>

<<DIO>>

<<Communication Peripheral>>PU

ROM1

RAM1

CAN

O1

I1 S1

D1

Page 55: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 4-2: Edit the ECU Network

Page 56: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

56© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Additionally we have to define a Networkand we have to assign the 2 ECUs to it

We use a CAN Network, called High Speed CAN

Step 4: Definition of a Network of ECUs

Cockpit ECUTire ECU

High Speed CAN

ECU

CAN Network

Bus Type: CANCAN Addressing Mode: ExtendedCommunication Speed: 500.000 Bits/sProtocol Name: -Protocol Version: 2.0b

Page 57: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 5: Mapping Software Components to ECUs

Page 58: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

58© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Now we can map one or more Software Components to oneECU

Step 5: Mapping Software Components to ECUs

Cockpit ECUTire ECU

High Speed CAN

ECU

CAN Network

Page 59: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

59© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display InfoPressure

Warning Calibration

Show Pressure

New CalibrationWarning Request

500ms

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

TireECU

CockpitECU

Page 60: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

60© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display InfoPressure

Warning Calibration

Show Pressure

New CalibrationWarning Request

500ms

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

TireECU

CockpitECU

What dowe haveso far ?

Inter-ECUcommunication

Page 61: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

61© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display Info

PressureWarningCalibration

Show Pressure

New CalibrationWarning Request

500ms

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

Step 5: Summary (Just a redraw of the previous figure …)

High Speed CAN

Page 62: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 6: Edit Frames

Page 63: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

63© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Before any inter-ECU communication, e.g. external Connections can be configured we need to define the basic Frames

It contains a number of Network Signals

Define the structure of a Frame to be sent across the Network

But not the content of the Frame

Step 6: Frames for Inter-ECU communication

Page 64: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

64© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Identifier: 0x123

High Speed CAN

ReceiverTransmitter

Frame Length: 16 Bits

Byte Order: Little EndianSignal Length: 8 BitsStart Position: 0

Frame

Network Signal

ECU 1 ECU 2

Definition of a Frame General Approach

Step 6: Frames for Inter-ECU communication

Byte Order: Big EndianSignal Length: 8 BitsStart Position: 8

Page 65: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

65© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Identifier: 0x123Frame Length: 8 Bits

Tire ECU Cockpit ECU

We have 3 external connections Pressure, Warning, Calibration

So we define for each one a Frame (Communication Matrix)

Identifier: 0x124Frame Length: 1 Bit

Identifier: 0x124Frame Length: 1 Bit

Step 6: Frames for Inter-ECU communication

Byte Order: Little EndianSignal Length: 8 BitsStart Position: 0

Byte Order: -Signal Length: 1 BitStart Position: 0

Byte Order: -Signal Length: 1 BitStart Position: 0

Page 66: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 7: Map Data for Inter-ECU Communication

Page 67: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

67© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display Info

PressureWarningCalibration

Show Pressure

New CalibrationWarning Request

500ms

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

That was the Result of Step 5

uint8 pressure

Boolean warning BooleanCalibration

Page 68: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

68© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

That was the Result of Step 6

Page 69: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

69© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display Info

PressureWarningCalibration

Show Pressure

New CalibrationWarning Request

500ms

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

That’s the Result of this Step 7

uint8 pressure

Boolean warning BooleanCalibration

Page 70: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 8: Configuring the ECUs - Map Runnables to Tasks

Page 71: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

71© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 8: Task Mapping for Runnables

The Runnables are triggered by Data Reception or Cyclic

This is realized by an Operating System with Tasks Events Alarms …

We have to decide which Runnable is activated by which Task !

Page 72: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

72© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SignalAdjustment

PressureTemperature

Pressure

Send Values

100ms

Display Info

PressureWarningCalibration

Show Pressure

New CalibrationWarning Request

500ms

Tire Control

PressureTemperature

Warning Calibration

Calculate WarningNew Calibration

100ms

uint8 pressure

Boolean warning BooleanCalibration

Operating System

Task APriority: 1

Task BPriority: 2

Task CPriority: 3

Operating System

Task APriority: 1

Task BPriority: 2

1 2

1

Page 73: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 9: Configuring the ECUs - Basic Software

Page 74: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

74© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 9: Configuring the Basic Software

This step is necessary to setup a real ECU

We have to configure the Basic Software COM PDU Router CAN Interface CAN Driver … !

AUTOSAR SWC 1

Basic Software

Runtime Environment

Page 75: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

75© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Communication Services

AUTOSAR COM …

PDU Router

CANTransport Protocol

CommunicationHardware

Abstraction

CAN Interface

CAN Driver

Microcontroller CAN

Communication Drivers

AUTOSARCode-Generator

AUTOSARXML

*_cfg.h

Generated CAN

Controller Definitions

Generated COM Configuration- IPDU Definition- Network Signal -> I-PDU

Mapping

Generated Routing Tables

GeneratedCAN Interface

Definitions

Software Component Description

ECU ResourceDescription

SystemDescription

per ECU

Page 76: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 2: AUTOSAR - ExampleStep 10: Code-Generation for ECUs

Page 77: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

77© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

Step 10: Code-Generation for each ECU

The AUTOSAR System for a Vehicle is stored as a XML Description

The Configuration of the Basic Softwarefor each ECU is stored as well as a XML Description

Code-Generators generate nowthe complete Codefor each ECU

Compiler & Linker are generating the final Binaries !

AUTOSARCode-Generation

Page 78: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

Part 4: Final Discussion

Page 79: Entwicklung von eingebetteter Software in der ......Entwicklung von eingebetteter Software in der Automobilindustrie mit AUTOSAR Dr. Thomas Zurawka, SYSTECS, Februar 2015

79© 2015 SYSTECSEntwicklung von eingebetteter SW mit AUTOSAR

SYSTECS Informationssysteme GmbHBahnhofstraße 11D 70771 Leinfelden-Echterdingen

Phone +49- 711- 722 312 - 10Fax +49- 711- 722 312 - 8

www.systecs.com

[email protected]

Thank you for listening