Documente Academic
Documente Profesional
Documente Cultură
1: In-Car Networking
ECU Power
Transceiver
Supply
ECU
Sensors
Actors
Sensor Core Actor
Drivers Drivers
( next slide)
ECU
Core
Personal
Computer
addiKonal
external
guard
hardware
(e.g.,
watchdog)
for
safety
criKcal
applicaKons
Image: Mitsubishi Electric
I/O drivers
Program Data
CPU
External Bus Memory Memory
DMA
Ports Interface to
other controllers
Interfaces
Interrupt
(CAN, serial, Serial Bus
Handler
JTAG, ...)
A/D
Timers System Ctrl.
Converter(s)
Microcontroller
(MCU)
8,
16,
32
Bit
Inneon,
Freescale,
Fujitsu,
...
Memory
VolaKle
memory
SRAM
(some
kByte)
Typically
integrated
into
microcontroller
Non-volaKle
memory
Flash
(256
kByte
..
some
MByte)
Serial
EEPROM
(some
kByte,
e.g.,
for
error
log)
Power
supply
DC/DC
converter,
e.g.,
to
5
V
or
3.3
V
Clock
Quartz
Xtal,
some
10
MHz
(
ECU
requires
only
passive
cooling)
External
guard
hardware
Watchdog
Expects
periodic
signal
from
MCU
Resets
MCU
on
Kmeout
ASIC
guard
For
more
complex
/
criKcal
ECUs
ASIC
sends
quesKon,
MCU
must
send
correct
answer
before
Kmeout
Resets
(or
disables)
ECU
on
Kmeout
or
error
Internal
Buses
Low-cost
ECUs
can
use
shared
bus
for
address
and
data
Parallel
Sensor
drivers
ResisKve
sensors
(e.g.,
simple
potenKometer
for
length,
angle)
CapaciKve,
inducKve
sensors
(e.g.,
pressure,
distance)
AcKve
sensors
(simple
voltage
/
complex
data
output)
Actor
drivers
D/A
conversion
High-power
ampliers
Bridges
Further
requirements
Electro-magneKc
interference
(EMI)
characterisKcs
Mechanical
robustness
Water
resistance
Thermal
resistance
Chemical
resistance
Hardware
abstracKon
Ofen
missing,
hardware
accessed
directly
Recent
trends
towards
operaKng
systems
Sofware
safeguards
E.g.,
stack
overow
ParKcularly
helpful
during
development
Process States
running
wait terminate
preempt
waiting suspended
start
release activate
ready
Activation
time or event based
Scheduler
Priority
Priority queue of ready tasks
Order
Dispatcher
Scheduling
The
act
of
assigning
an
order
of
acKvaKon,
given
a
process
model,
acKvaKon
sequence,
and
deadlines
dynamic:
Schedule
is
calculated
at
run
Kme
sta*c:
Schedule
is
xed,
e.g.,
at
compile
Kme
(
fully
determinisKc)
Feasible
schedule:
all
Kme
constraints
fullled,
no
deadline
violated
Dispatcher
coordinates
context
switches
Context
switches
For
one
process
to
change
state
to
running,
another
process
may
need
to
be
preempted
CPU
registers
etc.
will
now
be
occupied
by
new
process,
operaKng
system
takes
care
of
persisKng
informaKon
Latency
Time
dierence
from
event
to
reacKon
Jijer
Dierence
of
max
and
min
latency
High
importance
in
feedback
control
systems
ExecuKon
Kme
Time
dierence
of
task
start
and
end
Worst
Case
ExecuKon
Time
(WCET)
Dened
for
program
aspects,
dependent
on
plakorm
Considers
every
possible
cause
of
delay
(interrupts,
caching,
)
Important
for
guaranteeing
determinism
Start End
Execution Time
Task
Time
Latency (Response Time) Leeway
Activation Deadline
Sof
deadline
Soft Firm Hard
Delivering
result
afer
sof
deadline
less
helpful
1
(reduced
benet)
e.g.,
car
speeds
up
radio
gets
louder
0
Deadline
Firm
deadline
Delivering
result
afer
rm
deadline
useless
-1
(no
benet)
e.g.,
incoming
trac
bulleKn
SatNav
powered
up
Hard
deadline
Delivering
result
afer
hard
deadline
causes
damage
or
harm
(negaKve
benet)
e.g.,
brake
pedal
is
pushed
car
decelerates
1993
Founded
as
OSEK
Oene
Systeme
und
deren
Schni7stellen
fr
die
Elektronik
im
Kra>fahrzeug
BMW,
Bosch,
Daimler
Chrysler,
Opel,
Siemens,
VW,
Univ.
Karlsruhe
1994
Merged
with
VDX
Vehicle
Distributed
Execu*ve
PSA
und
Renault
Today
More
than
50
partners
(Parts)
standardized
as
ISO
17356
series
Standardizes
common
communicaKons
stack,
network
management,
opera;ng
system
(
next
slides),
Many
free
implementaKons
(freeOSEK,
openOSEK,
nxtOSEK,
)
Application
OSEK COM
Bus
ProperKes
OperaKng
system
for
single
processor
StaKc
conguraKon
Tasks
Resources
FuncKons
Can
meet
requirements
of
hard
deadlines
Programs
execute
directly
from
ROM
Very
low
memory
requirements
Standardized
system
(
OSEK
conformant
ECUs)
congured
at
OSEK_Example_OS
compile
Kme
{
MICROCONTROLLER = Intel80x86;
OSEK
ImplementaKon
};
Language
(OIL)
Scheduling
strategy
TASK Sample_TASK
Task
prioriKes
{
PRIORITY = 12;
SCHEDULE = FULL;
AUTOSTART = TRUE;
ACTIVATION = 1;
};
};
Generator
os.c os.h
Compiler
*.obj
Linker
os.elf
Tasks
StaKc
priority
RelaKonships
of
tasks
SynchronizaKon
Message
exchange
Signaling
Support
for
Kme
triggered
services
Error
management
C
macros
for
deniKon
provided
DeclareTask(SampleTask);
TASK(SampleTask) {
/* read sensors, trigger actors */
TerminateTask();
}
Scheduling
Scheduler
always
chooses
highest
priority
task
Congurable
modes:
Non
preempKve:
Tasks
are
never
preempted
PreempKve:
Higher
priority
tasks
always
preempt
lower
priority
tasks
Mixed:
Individual
conguraKon
of
each
task
TradiKonal
paradigm:
one
funcKon
one
ECU
(incl.
sofware
and
OS,
supplied
by
OEM)
AUTOSAR RTE
ECU 1 ECU 2
Application Layer
Diagnostic
Communi-
Comm. Gateway
cation
Manager
XCP
Services Generic NM
CAN NM Protocol Data Unit Router
Complex Drivers
CAN XCP FlexRay NM
FlexRay XCP
FlexRay CAN
Transport Transport
Protocol Protocol
Microcontroller
ECUs
Principles
Architecture
Real-Kme
properKes
(hard,
rm,
sof
deadlines)
OSEK/VDX
MoKvaKon
StaKc
conguraKon
Scheduling
AUTOSAR
MoKvaKon
Run
Time
Environment
Component
Principle