Professional Documents
Culture Documents
AUTOSAR training
- Concepts
Concepts
Chapter overview
Basic AUTOSAR Concepts and Terminology
Memory Mapping
Application
Interfaces Virtual Functional Bus
Methodology
ECU I ECU II ECU m
Virtual Functional Bus (VFB) is a concept that allows for strict separation
between software components and infrastructure.
Run Time Environment (RTE) is a communication centre for inter- and intra-
ECU information exchange.
Software
Component SW-C SW-C SW-C
SW-C
Description A B C n
Ports and
Interfaces
Assembly
connectors
Virtual Functional Bus
• An SW-C uses Ports to communicate with other components or with the ECU
hardware
P-Port1
R-Port1 P-Port2
R-Port2
• The Interface defines the data or operations that can be handled by the Port
P-Port1:Interface1
S/R
R-Port1:Interface2
P-Port2:Interface3
R-Port2:Interface4 C/S
• Synchronous call
• Rte_Call will not return until result is available (blocking)
• Asynchronous call
• Rte_Call will initiate operation but will return immediately (non-blocking)
• Rte_Result will provide the result (non-blocking or blocking)
CAN/Ethernet/FlexRay/
LIN
Yesterday AUTOSAR
App 2
App 1
…
App 5
App 3 App 4
RTE
Diagnostics Custom
Comm stack
manager service
SERVICE LAYER
Hardware
CAN
COM DCM SM
NM
WDG MGR
COMM
ECU MANAGER
NVRAM
DEM
DET
FIM
LIN
MANAGER PDUR SM FR CAN I/O
IPDUM HARDWARE
FR CAN LIN FR NM NM
TP TP TP SM ABSTRACTION
MEMORY ABSTRACTION IF
BSW SHEDULER
CAN LIN FR
WDG EXT EXT CAN LIN FR
TRCV TRCV TRCV
DRV EEPROM DRV FLASH DRV DRV DRV DRV
FLASH CHECK
EEPROM DRV
FLASH DRV
RAM TEST
MCU DRV
PORT DRV
WDG DRV
GPT DRV
PWM DRV
CAN DRV
DIO DRV
LIN DRV
ADC DRV
SPI DRV
ICU DRV
FR DRV
Hardware
Application
Interfaces Virtual Functional Bus
Methodology
ECU I ECU II ECU m
ECU I
The implementations of the RTE and BSW
modules are specified by AUTOSAR SW-C SW-C
A B
Examples:
‒ Number of CAN channels
95% configuration and 5% implementation
‒ CAN frames
‒ ECU power states
‒ Flash memory blocks
‒ OS tick time
To edit the BSW configuration a Generic Configuration Editor (GCE) may be used
Example of GCEs:
‒ EB tresos Studio
‒ Mecel Picea Workbench
‒ Geensoft GCE
‒ Vector DaVinci Configurator Pro
‒ …
ECU I
SW-Cs are also “configured” to some extent
SW-C SW-C
A B
Examples:
RTE
‒ Data Types
BSW
‒ Communication signals
‒ Scheduling
‒ Inter task communication
Based on this configuration, the RTE will provide the necessary APIs
The source code in the SW-Cs can either be implemented manually (coding C or C++) or
modeled using e.g. Simulink or Targetlink
The authoring tool allows you to specify SW-Cs, connect them and integrate them with
the BSW layer
Example of AATs:
‒ dSpace SystemDesk
‒ Dassault Systemes AUTOSAR Builder
‒ Vector DaVinci Developer
‒ Mecel Picea Workbench
SW-C SW-C
The ECU configuration description can be stored and A B
exchanged in a standardized XML format called
AUTOSAR XML (ARXML) RTE
BSW
The ECU configuration description is translated into compliable C source code using
Source Code Generators (SCG)
OS SCG
OS Configuration .h/.c
CAN SCG
RTE .h/.c
Typically there is one SCG per module in the BSW layer. The RTE is also generated
using an SCG.
The generated configuration files will together with the static BSW module implementation files
form a complete compilable module
BSW Module.o
BSW Module
Configuration .h/.c
Configuration Classes
Configuration Attribute / Implementation of Parameter
Class of
Parameter
Pre-compile time Can be changed at precompile time
Optimization of performance and code size Usually
#defines
Link time Can be changed at link time or precompile time
Usually const qualified variables
Allows for library/object code delivery of module
Post-build time Can be changed at post-build time or link time or
precompile time
Configuration can be updated separately from the static
module code post-build loadable
Switch between different configurations based on coding is
possible post-build selectable
Configuration Variant
• Attribute that defines the variant(s) that an AUTOSAR module may support
(specification)
Configuration Variant Allowed Parameter Config classes
VARIANT-PRE-COMPILE Pre-compile time
VARIANT-LINK-TIME Pre-compile time
Link time
VARIANT-POST-BUILD Pre-compile time
Link time
Post-build time
• Example:
Configuration files
• Pre-compile time configuration
• Preprocessor instructions
Module.c Module_Cfg.h Module.h
• Link-time configuration
• Constant data outside the module
Module_Lcfg.c Module_Lcfg.h
Module_PBcfg.c Module_PBcfg.h
Note! The configuration parameters in one module could belong to different configuration
classes.
..
.
Memory Map
© Elektrobit (EB) 2018 | Confidential 38
Concepts - Configuration Variants & Classes
Memory Map
© Elektrobit (EB) 2018 | Confidential 39
Memory Mapping
Concepts – Memory Mapping
General issues
• Memory mapping can be achieved with compiler and linker
specific keywords like near, far, or #pragma
‒ See AUTOSAR_SWS_MemoryMapping.pdf chapter 7 or user
manual of compiler and linker
• AUTOSAR Solution:
‒ Usage of memory mapping files MemMap.h
‒ Supports configuration and compiler abstraction
Usage of MemMap.h
• Usage in BSW modules:
#define EEP_START_SEC_VAR_INIT_16
#include “MemMap.h”
static uint16 EepTimer = 100;
static uint16 EepRemainingBytes = 16;
#define EEP_STOP_SEC_VAR_INIT_16
#include “MemMap.h”
• Usage in SWCs:
#define Abc_START_SEC_CODE
#include “Abc_MemMap.h”
/* --- Write a Code here */
#define Abc_STOP_SEC_CODE
#include “Abc_MemMap.h”
Memory Mapping