Professional Documents
Culture Documents
Introduction
In order to achieve a high degree of transparency against
the underlying hardware infrastructure, the AUTOSAR
standard introduces two architectural concepts that facilitate
infrastructure independent software development:
The Virtual Function Bus (VFB)
The Runtime Infrastructure (RTE)
Type of microcontroller
RTE
Depending on the location of each component, the formerly
virtual interaction can then be mapped to real interaction
implementation
Components that are mapped onto one ECU will
communicate through Intra ECU-Mechanisms, like function
calls while Inter-ECU communication will be realized using,
e.g. a communication bus infrastructure
Since the RTE source code is usually generated, it can be
tailored by the generator to implement exactly the
communication paths required by its connected AUTOSAR
components
RTE can be seen as a static implementation of specialized
communication topologies
Contract phase:
This phase is ECU-independent. It provides the contract
between a given ASW component and the RTE, that is, the
API that the ASW component can be coded against.
The input for this phase is the description of an ASW
component with all its ports and runnable entities.
The result is an ASW component-specific header file that can
be included by the corresponding source code file.
The set of allowed API functions depends on the ports of the
given ASW component. For example, if an ASW component
has a send-port p with a data element d, the contract phase
will generate the API function Rte_Send_p_d.
Generation phase:
Runnables
Since AUTOSAR software components have no direct access
to the underlying hardware or the operating system, the
implementation of the atomic software components cannot
reflect artifacts like Threads or Processes
Instead, each piece of functionality that has to be executed
during runtime of the software component is wrapped into a
so-called Runnable
The VFB-Specification defines a runnable as a Sequence of
instructions that can be started by the Run-Time
Environment
Each runnable that a component provides can be invoked by
the RTE and is executed within the context of the underlying
operating system
An atomic software component can consist of an arbitrary
number of runnables of which each might have its own
execution semantics
During the process of ECU configuration, a mapping between
operating system tasks and existing runnables is created
that is later used by the RTE to define and perform
scheduling and execution of the runnables according to their
specification
Categories of Runnables
Type 1 Runnables
Type 2 Runnables
Contains at least one wait point that causes the
runnable to terminate only upon the appearance of an
external event (e.g. the receive of a data value)
Such runnables are mapped by the RTE to extended
operating system tasks that support the state Waiting
OS View
An AUTOSAR-Compliant Operating System (e.g. OSEK OS)
does not know about the concepts of runnables at all
Instead, the operating system usually maintains a list of
schedulable entities that are under management of a
scheduling algorithm
Since runnable entities will be integrated by the RTE into
operating system tasks, they will be executed anytime the
corresponding OS task is scheduled
RTE View
The runtime environment maps runnables that can be
executed together into one OS task
This task is then structured and controlled using RTE glue
code that will control the correct execution of the runnables
within the OS task
The boxes colored in red denote single runnables
The corresponding control flow that triggers the execution of
such a runnable as well as the glue code (yellow box) is
under control of the RTE
VFB View
On the level
time of the
runnable as
executed are
Communication Drivers
(e.g.
SPI)
and
vehicle
I/O Drivers
Drivers for analog and digital I/O (e.g. ADC, PWM, DIO)
Memory Drivers
Drivers for on-chip memory devices (e.g. internal Flash,
internal EEPROM) and memory mapped external
memory devices (e.g. external Flash)
Microcontroller Drivers
Drivers for internal peripherals (e.g. Watchdog, General
Purpose Timer) Functions with direct C access (e.g.
Core test)
I/O Drivers
The ADC driver module initializes and controls the
internal Analog to Digital Converter unit of the
microcontroller
The Digital Input and Output driver module provides
services for reading from and writing to the DIO
Channels, DIO Ports and DIO Channel Groups
The PWM driver module provides functions for
initialization and control of the microcontroller internal
PWM unit
The ICU Driver controls the input capture unit of the
microcontroller
Port Driver initializes the whole port structure of the
microcontroller
Communication Drivers
Memory Drivers
Memory driver module provides the interface for
erasing, writing and reading the memory
Microcontroller Drivers
The GPT driver allows generating
continuous timer notifications
one-shot
or
Initialization Order
The sequence in which the MCAL modules initialization
and APIs to be invoked are very important for the
proper operation of individual modules.
The order to be followed is as follows:
MCU Initialization
WDG Initialization
PORT Initialization
Individual module initialization (ADC, PWM, GPT)
specific,
usually
Partial Networking
Allows for turning off network communication across multiple
ECUs in case their provided functions are not required
under certain conditions. Other ECUs can continue to
communicate on the same bus channel.
Uses NM messages to communicate the request/release
information of a partial network cluster between the
participating ECUs
Energy
Management
Partial
Networking
Example scenario of a partial network going to sleep
1
ECU A
1
ECU B
2
ECU C
2
ECU D
2
Initial situation:
ECUs A and B are members of Partial Network Cluster
(PNC)
1.
ECUs B, C and D are members of PNC 2.
All functions of the ECUs are organized either in PNC 1 or
PNC 2.
Both PNCs are active.
PNC 2 is only requested by ECU C.
The function requiring PNC 2 on ECU C is terminated,
therefore ECU C can release PNC 2.
Characteristics of J1939
Higher-layer protocol based on Controller Area Network
(CAN)
J1939 Applications
as
65215(0xFEBF)
Priority:
6 (default)
Length:
TX Rate: 100 ms
Bytes 1-2:
Byte 3:
905
Byte 4:
Byte 5:
907
Byte 6:
908
Byte 7:
909
Byte 8:
910
Benefits of Autosar:
SPN
904
906