Академический Документы
Профессиональный Документы
Культура Документы
TM
External Use
Agenda
• AUTOSAR Motivation and Principles
− Vision and Objectives
− Development Cooperation
− Architecture of the Standard
− Migration of the Standard
• AUTOSAR Configuration Methodology & Tools
• AUTOSAR MCAL
• AUTOSAR OS
• Examples: Hands-on Training
− LAB1: Blinking LED
− LAB2: Dimming LED
TM
TM
Android
Mars Curiosity Rover 11.8 MLoC F-35 Joint Strike Fighter
5MLoC 23.5 MLoC
TM
Media Orientated
System Transport
TM
Customer needs
Yesterday AUTOSAR • Adaptive Cruise Control
• Lane Departure
Warning
• Advanced Front
Application Software Lighting System
Software
standardized
Using standards
• Communication Stack
• OSEK
HW-specific
Hardware • Diagnostics
• CAN, FlexRay
Hardware
PO1: PO6:
Transferability of Sustainable utilization of
software natural resources
PO2: PO7:
Scalability to different Architecture Collaboration between
vehicle and platform various partners
variants
PO8:
PO3:
Standardization of basic
Different functional
software functionality of
domains Application automotive ECUs
Methodology
Interfaces
PO4:
Definition of an open PO9:
architecture Applicable automotive
international standards
and state-of-the-art
PO5: technologies
Dependable systems
Source: AutoSAR_RS_ProjectObjectives.pdf
Autosar_GuidedTour.pdf
TM
Architecture
• Architecture:
Software architecture including a complete basic software
Application
Interfaces
Methodology stack for ECUs — the so called AUTOSAR Basic Software —
as an integration platform for hardware independent software
applications.
• Methodology:
Architecture
Defines exchange formats and description templates to
Application
enable a seamless configuration process of the basic
Interfaces
Methodology
software stack and the integration of application software in
ECUs. It includes even the methodology how to use this
framework.
• Application Interfaces:
Architecture
Specification of interfaces of typical automotive applications
from all domains in terms of syntax and semantics, which
Application
Interfaces
Methodology should serve as a standard for application software.
Source:
Autosar_GuidedTour.pdf
TM
Functional Domains
The AUTOSAR project objectives
will be met by specifying and
Vehicle
standardizing the central ‘centric’
architectural elements across Powertrain
functional domains, allowing Safety
industry competition to focus on Chassis (active/
passive)
implementation.
AUTOSAR
Human
Telematics Machine
Interface
Body and
Comfort
Cooperate on standards, Passenger
‘centric’
compete on implementation.
Source:
Autosar_GuidedTour.pdf
TM
TM
SW-C
AUTOSAR
SW-C
AUTOSAR
SW-C
AUTOSAR
SW-C
AUTOSAR
2
1
n
Virtual Integration 1 1
(SW-C) description
Independent of hardware ...
Virtual Functional Bus. Integration of SW-C via
2
Virtual Functional Bus
(VFB)
Virtual Functional Bus
3 ECU Description
2
Introduction of Hardware 3 4
Attributes Tools supporting development
4
of software components System Constraints
Holistic view of the entire System Constraint
ECU
system, both software and Descriptions
5 5 Description
Source:
TM
Source:
TM
Application Layer
Runtime Environment
Basic Software
Basic Software
Resources
ECU
Microcontroller
Source:
TM
The AUTOSAR Basic Software is further divided in the layers: Services, ECU
Abstraction, Microcontroller Abstraction and Complex Drivers.
Application Layer
Runtime Environment
Services Layer
Complex
ECU Abstraction Layer Drivers
Microcontroller
Source:
TM
The Basic Software Layers are further divided into functional groups. Examples of
Services are System, Memory and Communication Services.
Application Layer
Runtime Environment
System Services Memory Services Communication Services I/O Hardware Abstraction Complex
Drivers
Source:
Microcontroller
Source:
TM
Integration
Partners
AUTOSAR stack
Freescale
OS + MCAL
+ CDD
TM
http://wwww.autosar.org
Published Releases
For information only, see disclaimer
TM
1 2
Single-sided RTE with software Partial introduction of AUTOSAR BSW
components (SW-C) and legacy BSW with legacy SW-Cs to BSW adapters
3 4
Complete AUTOSAR BSW with
Fully AUTOSAR compliant ECU
adapters for legacy SW-Cs
5 6
Legacy software AUTOSAR compliant Software Source:
Hardware components SW components
RTE
Adapter
AUTOSAR BSW Autosar_GuidedTour.pdf
TM
TM
TM
.arxml
System Configure
Configuration System
BSW Specific (MCAL/OS)
.arxml
Input: System
TM
TM
OS
Generator
.h
ECU .c
Configuration
Description
(XML)
AUTOSAR BSW Communication
Configuration Tool Services .h
Generator
.c
ECU
ECU
Parameter MCAL
ECU
Parameter
Definitions
.h
Generators
Parameter
Definitions
(XML)
Definitions
(XML) .c
(XML)
TM
• Import/export of ECD
• Easy configuration of
AUTOSAR BSW using
pre-compile
methodology
TM
Project Editor
Browser
Node
Outline
Parameter
Information
Error & Problem
Messages
Source: Elektrobit
TM
User corrects
the problem
Source: Elektrobit
TM
Jump to link
Parameter
"OsCounterType"
Source: Elektrobit
TM
Legend
EPD AUTOSAR Files
BSW
Module Elektrobit Files
Description BSW Module
read Generated Files
Configuration
EB tresos Studio
EPC
Configurator write
read read c, h
write
read
c, h
templates Code
Source: Elektrobit Templates
TM
Legend
XDM AUTOSAR Files
convert BSW
EPD Module EPC Elektrobit Files
Description import/ BSW Module
read Generated Files
export
Configuration
EB tresos Studio
XDM
Configurator write
read read
c, h
write
• XDM is a proprietary format (EB) providing
enhanced usability features during configuration EB tresos Studio
Generated
with EB tresos Studio Generator Code
TM
TM
1. Pre-compile time
− Preprocessor instructions
− Code generation (selection or synthetization)
2. Link time
− Constant data outside the module; the data can be configured after the module has
been compiled
3. Post-build time
− Loadable constant data outside the module. Very similar to [2], but the data is located
in a specific memory segment that allows reloading (e.g. reflashing in ECU production
line)
Independent of the configuration class, single or multiple configuration sets can be provided by means of
variation points. In case that multiple configuration sets are provided, the actual used configuration set is to
be chosen at runtime in case the variation points are bound at runtime.
TM
TM
The Microcontroller Abstraction Layer is the lowest software layer of the Basic RTE
Software. Memory
Communi
-cation
Complex Drivers
System Services Services I/O HW
It contains internal drivers, which are software modules with direct access to the µC Onboard
Services Abstractio
n
Memory COM HW
and internal peripherals. Dev.
Abstr.
HW Abstr. Abstr.
Micro- Communi
Memory I/O
controller -cation
Drivers Drivers
Task Drivers Drivers
Microcontroller (µC)
Make higher software layers independent of µC
Properties
Implementation: µC dependent
Upper Interface: standardized and µC independent Group of
Software
modules of
Microcontroller Drivers Memory Drivers internal EEPROM Driver Communication Drivers I/O Drivers similar type
internal Flash Driver
Ethernet Driver
FlexRay Driver
PORT Driver
PWM Driver
MCU Driver
OCU Driver
CAN Driver
ADC Driver
GPT Driver
DIO Driver
Flash Test
ICU Driver
LIN Driver
RAM Test
Core Test
Software
module
Internal
Clock Unit
EEPROM
peripheral
Power &
FLASH
LIN or
PWM
WDT
MCU
CAN
OCU
GPT
CCU
ADC
DIO
SCI
SPI
Microcontroller device
Source:
TM
Complex Drivers
System Services Services I/O HW
Services Abstractio
Onboard n
− Driversfor internal peripherals (e.g. Watchdog, Memory COM HW
Dev.
HW Abstr. Abstr.
Abstr.
Micro- Communi
Memory I/O
controller -cation
General Purpose Timer) Drivers
Drivers
Drivers
Microcontroller (µC)
Drivers
Microcontroller Drivers
Watchdog Driver
MCU Driver
GPT Driver
Core Test
Clock Unit
EEPROM
Power &
FLASH
LIN or
PWM
WDT
MCU
CAN
OCU
GPT
CCU
ADC
DIO
SCI
SPI
Microcontroller
Source:
TM
Complex Drivers
System Services Services I/O HW
Services
location of peripheral memory devices (on-chip or on-board) and the ECU hardware Onboard
Abstractio
n
Memory COM HW
layout Dev.
HW Abstr. Abstr.
Abstr.
Micro- Communi
− Example: on-chip EEPROM and external EEPROM devices are accessible via the same controller
Memory
-cation
I/O
mechanism Drivers
Drivers
Drivers
Drivers
− The Memory Drivers are accessed via memory specific abstraction/emulation modules Microcontroller (µC)
(e.g. EEPROM Abstraction)
Memory Hardware
Abstraction
FLASH EEPROM
Emulation
RAM Test
Clock Unit
EEPROM
Power &
FLASH
LIN or
PWM
WDT
MCU
CAN
OCU
GPT
CCU
ADC
DIO
SCI
SPI
Microcontroller
TM
Complex Drivers
System Services Services I/O HW
Services Abstractio
Onboard n
− Driversfor ECU onboard (e.g. SPI) and vehicle Memory COM HW
Dev.
HW Abstr. Abstr.
Abstr.
Micro- Communi
Memory I/O
Microcontroller (µC)
Drivers
Communication Drivers
Ethernet Driver
FlexRay Driver
CAN Driver
LIN Driver
Clock Unit
EEPROM
Power &
FLASH
LIN or
PWM
WDT
MCU
CAN
OCU
GPT
CCU
ADC
DIO
SCI
SPI
Microcontroller
Source:
TM
Complex Drivers
System Services Services I/O HW
Services Abstractio
Onboard n
− Drivers for analog and digital I/O (e.g. ADC, Memory COM HW
Dev.
HW Abstr. Abstr.
Abstr.
Micro- Communi
Memory I/O
controller -cation
PWM, DIO) Drivers
Drivers
Microcontroller (µC)
Drivers
Drivers
I/O Drivers
PORT Driver
PWM Driver
OCU Driver
ADC Driver
DIO Driver
ICU Driver
Clock Unit
EEPROM
Power &
FLASH
LIN or
PWM
WDT
MCU
CAN
OCU
GPT
CCU
ADC
DIO
SCI
SPI
Microcontroller
Source:
TM
Complex Drivers
System Services Services I/O HW
Services Abstractio
Onboard n
Memory COM HW
Dev.
HW Abstr. Abstr.
Abstr.
Micro- Communi
An example is to implement complex sensor evaluation controller
Drivers
Memory
Drivers
-cation
Drivers
I/O
Drivers
and actuator control with direct access to the µC using Microcontroller (µC)
specific interrupts and/or complex µC peripherals e.g.
Example:
• Fault Monitoring Drivers Complex Drivers
• Core and Peripheral Self Tests
• MicroController Library (MCL)
• CRC Driver
Injection Control
Properties:
• Implementation: highly µC, ECU and application dependent
• Upper Interface to SW-Cs: specified and implemented according to
AUTOSAR (AUTOSAR interface)
• Lower interface: restricted access to Standardized Interfaces
e.g. CCU
e.g. PCP
e.g. TPU
µC
Source:
TM
Module_TS_TxDyMzIaRb
X = Target (2 — Freescale PPC)
Y = Derivate ( 34 — MPC5748G )
Z = Module Major & Minor Version
A = Module Revision Version
B = Reserved
TM
TM
• 1994
− French cars manufacturers Renault and PSA Peugeot Citroën, which had a similar
project called VDX (Vehicle Distributed eXecutive), joined the consortium
• Oct 1997
− 2nd release of specification package
• Feb 2005
− Specification 2.2.3 of OSEK OS
TM
Complex Drivers
i-cation I/O HW
AUTOSAR OS is OSEK/VDX™
System Services Services
• Onboard
Dev.
Memory
HW
Services
COM
HW
Abstracti
on
OS plus: Abstr.
Micro-
controller
Abstr.
Memory
Abstr.
Commun
i-cation
I/O
Drivers Drivers
Drivers Drivers
Microcontroller (µC)
Watchdog Manager
Diagnostic Log and
Function Inhibition
Schedule tables with time
Manager (ComM)
Diagnostic Event
Manager (StbM)
Manager (Dem)
Communication
Manager (Csm)
Mode Manager
Basic Software
Crypto Service
Manager (FiM)
Synchronized
Time Service
Default Error
Tracer (Det)
Time-base
Trace (Dlt)
(WdgM)
(BswM)
synchronisation
(Tm)
Stack monitoring
AUTOSAR OS
− Protection features
Manager (EcuM)
ECU State
Timing protection, memory protection
and service protection
OS applications, trusted and non-
trusted code
Protection hook
TM
• OS application
−A block of software including tasks, ISRs, hooks
and trusted functions
− Trusted: An OS application that has unrestricted
access
− Non-trusted: An OS application that has
restricted access
• Trusted function
−A service function with unrestricted access
− Provided by a trusted OS application
TM
TM
• Service Protection
TM
TM
Scalability Class 2
Scalability Class 1
Scalability Class 3
Scalability Class 4
OSEK OS (all conformance classes)
Counter Interface
Schedule Tables
Stack Monitoring
Protection Hook
Timing Protection
Global Time/Synchronization Support
Memory Protection
OS Applications
Service Protection
CallTrustedFunction
TM
EB Tresos
“C” code
Application User’s
configuration file (EPC) source
code
System
Generator
“C” code OS
“C” code
Sysgen files source
code
Compiler
Make tool Library
TM
TM
MPC5748G
SoC
TM
• Objective
− Get started with AutoSAR and Blinking LED
• Environment
− AutoSAR MCAL and AutoSAR OS v4.0
− Tool: Elektrobit tresos Studio 2014.2.1
− Compiler: GreenHills for PPC
− Debugger: GreenHills Probes
− Hardware: MPC5748G Evaluation Board
• Functional description
− The AutoSAR BSW modules Mcu, Dio, Port, Os, EcuM, Rte are applied
to build an application which toggles an LED every second.
TM
• Port • Dio
− Initialization of all pins and ports of − Provides APIs to read and write GPIO
the MCU ports/pins
− Reinitialization with alternate − Requires an initialized Port module
configurations at runtime possible Pins/ports need to be initialized via Port
− Reconfiguration of pins at runtime module
− Port Pin Function Assignment (GPIO, − API synchronous and unbuffered
Adc, SPI, PWM, ...) − Structural Elements:
− PadSelection implicitly via hardware Channel (single pin)
assignment ChannelGroup (adjacent pins in the same
− PortPin is the only structural element port)
Port (aggregates Channels and
ChannelGroups)
TM
TM
TM
1. File -> Import -> General -> Existing Projects into Workspace -> Select root
Directory -> Browse to c:\eb\tresos\workspace -> Select Lab1 -> Finish
TM
TM
2. From List of Available Modules select Dio and import it into Module
Configurations List -> Press Ok
TM
• Procedure
− The next slides will show which Containers/Parameters to add/change
− To open a module configuration, double click the module in the Project
Explorer window
− To navigate within a previously opened module configuration, use the
Outline window on the bottom left side
− To change parameter, click on that parameter in Outline window
− To add a container, click on the collection item of this container type (e.g.
DioPort). You see a listview in the main window which lets you add new
entries by clicking the + button
− To edit a previously added container in the main window, click on it in the
Outline window
TM
• Port • Dio
− Open and Explorer the container − Open and Explorer the container “Dio”
“Port” − Go to the container “Dio_Port_0” and add
− Open PortConfigSet_0 container − a port with the following proprieties:
− Add a PortPin to the container • Name: Dio_PG
PortConfigSet_0 • DioPortId: 6
• Name: Led2 Add a DioChannel to the Container “Dio_PG”
• PortPinPcr = 99 − Name: Dio_Led2
• PortPinDirection = PortPinDirectionOut − DioChannelId: 6
TM
• Config Variant
TM
TM
• PortPin configuration
TM
• Config Variant
TM
TM
TM
TM
TM
1 2
TM
ECU
ECU Startup ECU Runtime
Shutdown
AUTOSAR Executing AUTOSAR
Before AUTOSAR OS AUTOSAR Initialization
Applications Shutdown
Not AUTOSAR
AUTOSAR
TM
• Environment
− AutoSAR MCAL and AutoSAR OS v4.0
− Tool: Elektrobit tresos Studio 2014.2.1
− Compiler: GreenHills for PPC
− Debugger: GreenHills Probes
− Hardware: MPC5748G Evaluation Board
• Functional description
− TheAutoSAR BSW modules Mcu,Dio, Port, Adc, Pwm Os, EcuM, RTE
are applied to build an application which toggles one LED every second
and dimms another LED
TM
• Conversion Modes
− One Shot: the conversion of an ADC channel group is performed once
after a trigger (software or hardware) and the result is written to the
assigned buffer
− Continous: the conversions is repeated for each ADC channel in an
ADC channel group
TM
TM
• Polarity
− A parameter PwmPolarity specifies the pin output
level for each channel for dutycycle and off-
dutycycle.
TM
TM
1. File -> Import -> General -> Existing Projects into Workspace -> Select root
Directory -> Browse to c:\eb\tresos\workspace -> Select Lab2 -> Finish
TM
TM
• Adc Group
− Adc Group Actions:
NORMAL CONV.
− Adc Conversion Mode:
ONESHOT
− Adc Conversion Type:
NORMAL
− Adc Trigger Source: SW
TM
• Pwm
− Pwm Channel: Pwm_Led1
− Pwm HW IP: eMIOS
− Pwm Channel Class:
FIXED_PERIOD
− Pwm Default Period:
0.01 ticks
− Pwm Default DutyCycle:
50%
TM
1. Go to the OsEvent Tab -> Right Click on OsEvent_Task1 and select Duplicate
Element
2. Rename the new event to OsEvent_Task2
TM
1. Go to the OsTask Tab -> Right Click on TASK1 and select Duplicate Element
2. Rename the new task to TASK2 and from OsTaskEvent select OsEvent_Task2
TM
1. Go to the OsAlarm Tab -> Right Click on OsAlarm_Task1 and select Duplicate
Element
2. Rename the new event to OsAlarm_Task2 and set the params as below
TM
TM
3. Build
the project by clicking on 1
4. Debug your project clicking on 2
TM
1 2
TM
www.Freescale.com