https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Automotive Embedded
Systems part6
(AUTOSAR Application Layer).
ENG.KEROLES SHENOUDA
1
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR
APPLICATION LAYER
it's time to wake up 
Learn In Depth 
2
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Use Cases of AUTOSAR
3
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_systemUse Case ‘Pedal Management’ view
for one ECU
4
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Use Case ‘Pedal Management’ view
for two ECUs
5
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Use case
‘Front-
Light
Managem
ent’ in
AUTOSAR
6
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Use case ‘Front-Light Management’ in
AUTOSAR on different ECUs
7
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR Basic Software Modules
8
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Example: “NVRAM Manager” ensures the storage and maintenance
of non-volatile data and is independent of the design of the ECU
9
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR System Design Process
10
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR System Design Process
11
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR System Design Process
12
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR System Design Process
13
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Application Layer
14
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Application Layer
 The purpose of the application
layer is to provide the actual
functionality of the system.
 This is done through the usage of
SWCs, which are components
containing software.
15
SWC
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Intra- and Inter-ECU Communication
16
Software components
An application consists of one or
more SWCs based in the
Application layer. In order for SWCs to
communicate with each other they use
the virtual functional bus (VFB).
From a SWC’s point of view all it sees
is the VFB and not the hardware
dependent BSW and the hardware
itself
Source: www.autosar.org
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
SWC elements
 Ports
 PPort  provide port
 Rport  require port
 PRPort  provide require port
 Internal Behavior
 Runnables
 RTE Events
 InterrunnableVaribales
 Implementation (source or object code)
17
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
SWC Types
 Application software component
 is an atomic software component that carries out an application or part of it. It can use
ALL AUTOSAR communication mechanisms and services
 Sensoractuator software component
 is an atomic SWC that handles the specifics of sensors or actuators. It directly interacts
with the ecu-abstraction.
 Parameter software component
 Atomic SWC
 it provides parameter values. They can be fixed data, const or variable. It allows access
to fixed data or calibration data
 They don’t have an internal behavior
 They only have PPorts of Parameter Interfce type
 Need to be on the same ECU as the SWCs accessing them since a parameter SWC
represents the memory containing the calibration parameter
18
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
SWC Types
 Service software component
 provides services specified by AUTOSAR through interfaces specified by AUTOSAR. This component may
interact directly with modules from BSW
 Represents the different BSW Module services in the VFB view
 Complex driver software component
 it generalizes the ECUAbstraction component. It can define ports to interact with components in specific
ways and can also directly interact with BSW modules
 Complex device drivers can use BSW services
 Complex device drivers exist to fulfill certain needs:
 Implementing a complex application that cannot be otherwise implemented due to the AUTOSAR BSW layered
architecture
 Timing critical applications
 Non-AUTOSAR applications within AUTOSAR ECU
 Nvblock software component
 it allows SWCs to access NV data
 It represents the Nvmanager from BSW layer
19
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
SWC Design (create atomic SWC)
20
 It is the smallest part.
 It is possible to instantiate more than one instance
of this Software Component (i.e. to use an
measuring Software Component for the left and for
the right door)
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Internal Behaviour 21
Internal Behavior
Atomic SWC
 The Internal Behaviour is the most complex part of
the Software Component Description
 Each Atomic Software Component is adviced to
have only one Internal Behaviour
 the Internal Behavior consists of the following
main elements
 Runnable Entities
 RTEEvents
 Exclusive Areas
 RunnableExecution Constraints
 PerInstanceMemory (PIM)
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Meta-model of the Internal
Behavior
22
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Runnable Entities 23
Atomic SWC
 Each Atomic Software Component consists of at
least one Runnable Entity that executes code.
 A Runnable Entity serves to structure the
Software Component's functionality.
 Each Runnable Entity can be scheduled or triggered
individually and independently from other Runnable
Entities.
 Each Runnable Entity should be triggered by at
least one Event.
 Runnable Entities are implemented by
C-functions
Runnable
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
SW Components and Runnables
 SW-Components
 atomic components with
respect to mapping
 provided by one supplier
 Runnables
 atomic components with
respect to execution
 attached to different OS
Tasks
SW-C 1
runnableA
runnableB
runnableC
BSW
RTE
Sensor SWC
24
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Runnables and Tasks
SW architecture example: 2 SW components, 6 runnables
ECU 1
SW-C2runnableZ
BSW
RTE
SW-C 1
runnableA
runnableB
runnableC
runnableX
runnableYOS
runnableX
OS
runnableZ
runnableC runnableB
runn ableA runnableY
OS
runnableZ
Schedule and timing dependencies
25
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Events
 Events trigger Runnable Entities.
 These elements will then be referenced within the XML denition of
the Runnable Entity.
 These events can be from different types:
 AsynchronousServerCallReturnsEvent:
The event is raised when an asynchronous server call is finished.
 DataSendCompletedEvent:
This event is raised when the referenced data element have been sent or
an error occurs.
DataReceivedEvent:
This event is raised when the referenced data elements are
received
26
Atomic SWC
Runnable
event
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Events
DataReceiveErrorEvent:
This event is raised by the RTE when the communication layer detects and
notifies an error concerning the reception of the referenced data element.
 OperationInvokedEvent:
The OperationInvokedEvent references the operation invoked by the client.
 TimingEvent:
A TimingEvent references the Runnable Entity that needs to be started in responseto the
TimingEvent.
 ModeSwitchEvent:
ModeTypes can be used in order to transmit status information. such
that ECUs can then start or disable services. Consequently whenever a Mode is entered
or exited a Runnable Entity must be started
27
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Example : (TimingEvent )
 A TimingEvent is the most common applied Trigger Event
28
<TIMING-EVENT>
<SHORT-NAME>
TimingEvent_10ms
</SHORT-NAME>
<START-ON-EVENT-REF DEST="RUNNABLE-ENTITY">
RunnableA
</START-ON-EVENT-REF>
<PERIOD>
0.01
</PERIOD>
</TIMING-EVENT>
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Example : (DataReceivedEvent)
29
<DATA-RECEIVED-EVENT>
<SHORT-NAME>
dre1
</SHORT-NAME>
<START-ON-EVENT-REF DEST="RUNNABLE-ENTITY">
RunnableA
</START-ON-EVENT-REF>
<DATA-IREF>
<R-PORT-PROTOTYPE-REF DEST="R-PORT-PROTOTYPE">
port
</R-PORT-PROTOTYPE-REF>
<DATA-ELEMENT-PROTOTYPE-REF DEST="DATA-ELEMENT-PROTOTYPE">
De1
</DATA-ELEMENT-PROTOTYPE-REF>
</DATA-IREF>
</DATA-RECEIVED-EVENT>
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Exclusive Areas
 The RTE provides a mechanism to synchronize the access to Exclusive Areas.
 Exclusive areas are critical sections and lead to preemption-avoidance if a
Runnable Entity enters or exits it.
 An Exclusive Area ensures the atomical access to a resource. This can be
indicated by using the following two API functions:
 void Rte_Enter_<name> ();
 void Rte_Exit_<name> ();
 This simply is indicated by the following XMLcode
<EXCLUSIVE-AREA>
<SHORT-NAME> name </SHORTNAME>
</EXCLUSIVE-AREA>
 Now, all Runnable Entities within this Internal Behaviour have the ability to
use this Exclusive Area
30
Atomic SWC
Runnable A
event
Runnable B
Exclusive
Area
Atomic SWC
Runnable A
event
Runnable B
Exclusive
Area
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Ports
 These ports are used to connect the SWC to other
instances.
 The most basic type of ports are the sender and
receiver ports.
 These are used to provide means of data transmission
between
different SWCs, or between the SWC and the RTE.
 Another common type of port interface is the
Client/Server.
 These ports are used when the SWC needs to use a
function (in the application layer these are known as
runnables) contained within another SWC or a function
of a BSW module.
31
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_systemGraphical representation of
sender-receiver ports
32
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Graphical representation of client-
server ports
33
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_systemEvents of the RTE simply called
RTEEvents
34
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_systemEvents of the RTE simply called
RTEEvents
35
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Compositions
 which Software Components belong
together?
 How do these Software Components
interact with each other?
 Which elements will be transmitted
between them?
36
Atomic SWC
Runnable A
event
Runnable B
Exclusiv
e Area
SWC2
Runnable A
event
Runnable B
Exclusiv
e Area
SWC1
Runnable A
event
Runnable B
Exclusiv
e Area
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
AUTOSAR OS
37
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
ECU manager
 The ECU manager controls the initialization of the OS, as well as the
initialization of the MCU-drivers for example the DIO-drivers, CAN-
drivers, and the Port drivers.
 the shutdown of the OS as well.
38
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Prepare your self for the next
session
(Mapping to OS tasks )
#LEARN_IN_DEPTH 
39
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 https://www.autosar.org
 Embedded Microcomputer Systems Real Time Interfacing Third
Edition Jonathan W. Valvano University of Texas at Austin.
 MicroC/OS-II the real-time kernel second edition jean j.labrosse.
 RTOS Concepts http://www.embeddedcraft.org.
 OSEK/VDX Operating System Specification 2.2.3
 AUTOSAR Layered Software Architecture
 The Trampoline Handbook release 2.0
 Trampoline (OSEK/VDX OS) Test Implementation -Version 1.0,
Florent PAVIN ; Jean-Luc BECHENNEC
40
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 Trampoline:an open platform for (small) embedded systems based on
OSEK/VDX and AUTOSAR
http://trampoline.rts-software.org/
Jean-Luc Béchennec1;2, Sébastien Faucou1;3
1IRCCyN (Institute of Research in Communications and Cybernetics of Nantes)
2CNRS (National Center for Scientific Research) / 3University of Nantes
10th Libre Software Meeting
41
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 Real Time Systems (RETSY)
Jean-Luc Béchennec - Jean-Luc.Bechennec@irccyn.ec-nantes.fr
Sébastien Faucou - Sebastien.Faucou@univ-nantes.fr
jeudi 12 novembre 15
 AUTOSAR Specification of Operating System V5.0.0 R4.0 Rev 3
 OSEK - Basics http://taisnotes.blogspot.com.eg/2016/07/osek-basic-
task-vs-extended-task.html
 OSEK OS Session Speaker Deepak V.
M.S Ramaiah School of Advanced Studies - Bangalore 1
 Introducción a OSEK-OS - El Sistema Operativo del CIAA-Firmware
Programación de Sistemas Embebidos
MSc. Ing. Mariano Cerdeiro
42
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 Introduction to AUTOSAR, Stephen Waldron, Vector webinar
Wednesday 7th May 2014
https://vector.com/portal/medien/cmc/events/Webinars/2014/Vector_
Webinar_AUTOSAR_Introduction_20140507_EN.pdf
 Introduction to AUTOSAR, Stephen Waldron, Vector webinar
Tuesday 5th May 2015
https://vector.com/portal/medien/cmc/events/Webinars/2015/Vector_
Webinar_AUTOSAR_Introduction_20150505_EN.pdf
43
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 Automatic Generation of AUTOSAR Software Component Descriptions
Study Thesis in Computer Sciences by Christopher Mutschler
https://www2.informatik.uni-
erlangen.de/EN/teaching/thesis/download/i2S00428.pdf
 AutoSAR Overview FESA Workshop at KTH 2010‐04‐12
 Prof. Jakob Axelsson
 http://www.artist-
embedded.org/docs/Events/2010/FESA/slides/3_Autosar_Axelsson.pdf
44
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 AUTOSAR – An open standardized software architecture for the
automotive industry Simon Fürst, BMW 1st AUTOSAR Open
Conference & 8th AUTOSAR Premium Member Conference October
23rd, 2008, Cobo Center, Detroit, MI, USA
 http://st.inf.tu-
dresden.de/files/teaching/ws08/ase/03_AUTOSAR_Tutorial.pdf
 Institutionen för systemteknik Department of Electrical Engineering
Examensarbete Implementation of CAN Communication Stack in
AUTOSAR Examensarbete utfört i Datorteknik
vid Tekniska högskolan vid Linköpings universitet Av Johan Alexandersson
och Olle Nordin
http://liu.diva-portal.org/smash/get/diva2:822343/FULLTEXT01.pdf
45
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 Applying AUTOSAR in Practice Available Development Tools and
Migration Paths Master Thesis, Computer Science Authors: Jesper
Melin
http://www.idt.mdh.se/utbildning/exjobb/files/TR1171.pdf
Freescale AUTOSAR Software Overview.pdf
46
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 AUTOSAR Method, Vector Webinar 2013-04-17
https://vector.com/portal/medien/cmc/events/Webinars/2013/Vector_Web
inar_AUTOSAR_Method_20130417.pdf
 AUTOSAR Configuration Process - How to handle 1000s of parameters
Vector Webinar 2013-04-19
https://vector.com/portal/medien/cmc/events/Webinars/2013/Vector_Web
inar_AUTOSAR_Configuration_Process_20130419_EN.pdf
 AUTOSAR Runtime Environment and Virtual Function Bus, Nico Naumann
https://hpi.de/fileadmin/user_upload/fachgebiete/giese/Ausarbeitungen_A
UTOSAR0809/NicoNaumann_RTE_VFB.pdf
47
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 The AUTOSAR Adaptive Platform for Connected and Autonomous
Vehicles, Simon Fürst, AUTOSAR Steering Committee 8th Vector
Congress 29-Nov-2016, Alte Stuttgarter Reithalle, Stuttgart,
Germany
https://vector.com/congress/files/presentations/VeCo16_06_29Nov_Re
ithalle_Fuerst_BMW.pdf
 A Review of Embedded Automotive Protocols, Nicolas Navet1,
Françoise Simonot-Lion2 April 14, 2008
https://www.realtimeatwork.com/wp-
content/uploads/chapter4_CRC_2008.pdf
48
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 AUTOSAR Adaptive Platform
https://vector.com/conference_india/files/presentations/Day1/3_AUTO
SAR%20Adaptive%20Platform.pdf
49
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
References
 http://www.autosar.org/about/technical-overview/ecu-software-
architecture/autosar-basic-software/
 http://www.autosar.org/standards/classic-platform/
 https://automotivetechis.files.wordpress.com/2012/05/communicationsta
ck_gosda.pdf
 https://automotivetechis.files.wordpress.com/2012/05/autosar_ppt.pdf
 https://automotivetechis.wordpress.com/autosar-concepts/
 https://automotivetechis.files.wordpress.com/2012/05/autosar_exp_laye
redsoftwarearchitecture.pdf
 http://www.slideshare.net/FarzadSadeghi1/autosar-software-component
 https://www.renesas.com/en-
us/solutions/automotive/technology/autosar/autosar-mcal.html
 https://github.com/parai/OpenSAR/blob/master/include/Std_Types.h
50
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
51

Automotive embedded systems part6 v1