AUTOSAR CP EXP CDDDesignAndIntegrationGuideline
AUTOSAR CP EXP CDDDesignAndIntegrationGuideline
AUTOSAR CP R23-11
4
AUTOSAR • Update for Default Error Tracer
2015-07-31 4.2.2 Release
Management • Re-entrancy of interfaces
AUTOSAR
2014-10-31 4.2.1 Release • Update for TcpIp
Management
• Update of CDD code files chapter
AUTOSAR
2014-03-31 4.1.3 • Removed chapters on change
Administration
documentation
AUTOSAR
2013-03-15 4.1.1 • Initial release
Administration
Disclaimer
This work (specification and/or software implementation) and the material contained in
it, as released by AUTOSAR, is for the purpose of information only. AUTOSAR and the
companies that have contributed to it shall not be liable for any use of the work.
The material contained in this work is protected by copyright and other types of intel-
lectual property rights. The commercial exploitation of the material contained in this
work requires a license to such intellectual property rights.
This work may be utilized or reproduced without any modification, in any form or by
any means, for informational purposes only. For any other purpose, no part of the work
may be utilized or reproduced, in any form or by any means, without permission in
writing from the publisher.
The work has been developed for automotive applications only. It has neither been
developed, nor tested for non-automotive applications.
The word AUTOSAR and the AUTOSAR logo are registered trademarks.
Contents
1 Introduction 6
1.1 Scope of Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Definition of terms and acronyms 7
2.1 Glossary of terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Conventions to be used 8
4 Related Documentation 9
4.1 Input documents & related standards and norms . . . . . . . . . . . . . 9
5 Introduction to CDD 11
1 Introduction
3 Conventions to be used
In requirements, the following specific semantics shall be used (based on the Internet
Engineering Task Force IETF).
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as follows.
Note that the requirement level of the document in which they are used modifies the
force of these words.
• MUST: This word, or the adjective "LEGALLY REQUIRED", means that the defi-
nition is an absolute requirement of the specification due to legal issues.
• MUST NOT: This phrase, or the phrase "MUST NOT", means that the definition
is an absolute prohibition of the specification due to legal issues.
• SHALL: This phrase, or the adjective "REQUIRED", means that the definition is
an absolute requirement of the specification.
• SHALL NOT: This phrase means that the definition is an absolute prohibition of
the specification.
• SHOULD: This word, or the adjective "RECOMMENDED", means that there may
exist valid reasons in particular circumstances to ignore a particular item, but the
full implications must be understood and carefully weighed before choosing a
different course.
• SHOULD NOT: This phrase, or the phrase "NOT RECOMMENDED", means that
there may exist valid reasons in particular circumstances when the particular be-
havior is acceptable or even useful, but the full implications should be understood
and the case carefully weighed before implementing any behavior described with
this label.
• MAY: This word, or the adjective "OPTIONAL", means that an item is truly op-
tional. One vendor may choose to include the item because a particular market-
place requires it or because the vendor feels that it enhances the product while
another vendor may omit the same item.
An implementation, which does not include a particular option, SHALL be prepared
to interoperate with another implementation, which does include the option, though
perhaps with reduced functionality. In the same vein an implementation, which does
include a particular option, SHALL be prepared to interoperate with another implemen-
tation, which does not include the option (except, of course, for the feature the option
provides.)
4 Related Documentation
[1] Glossary
AUTOSAR_FO_TR_Glossary
[2] General Requirements on Basic Software Modules
AUTOSAR_CP_SRS_BSWGeneral
[3] Layered Software Architecture
AUTOSAR_CP_EXP_LayeredSoftwareArchitecture
[4] List of Basic Software Modules
AUTOSAR_CP_TR_BSWModuleList
[5] General Specification of Basic Software Modules
AUTOSAR_CP_SWS_BSWGeneral
[6] Specification of Standard Types
AUTOSAR_CP_SWS_StandardTypes
[7] Specification of Platform Types for Classic Platform
AUTOSAR_CP_SWS_PlatformTypes
[8] Specification of Communication Stack Types
AUTOSAR_CP_SWS_CommunicationStackTypes
[9] Basic Software Module Description Template
AUTOSAR_CP_TPS_BSWModuleDescriptionTemplate
[10] Specification of ECU Configuration
AUTOSAR_CP_TPS_ECUConfiguration
[11] Specification of ECU State Manager
AUTOSAR_CP_SWS_ECUStateManager
[12] Specification of Watchdog Manager
AUTOSAR_CP_SWS_WatchdogManager
[13] Specification of PDU Router
AUTOSAR_CP_SWS_PDURouter
[14] Specification of Communication
AUTOSAR_CP_SWS_COM
[15] Specification of Communication Manager
AUTOSAR_CP_SWS_COMManager
[16] Specification of Network Management Interface
AUTOSAR_CP_SWS_NetworkManagementInterface
[17] Specification of TCP/IP Stack
AUTOSAR_CP_SWS_TcpIp
[18] Description of the AUTOSAR standard errors
AUTOSAR_CP_EXP_ErrorDescription
[19] Specification of Operating System
AUTOSAR_CP_SWS_OS
[20] Specification of Synchronized Time-Base Manager
AUTOSAR_CP_SWS_SynchronizedTimeBaseManager
5 Introduction to CDD
A Complex Driver is a software entity not standardized by AUTOSAR that can access
or be accessed via AUTOSAR Interfaces and/or Basic Software Modules APIs.
According to the document [3] Layered Software Architecture, a CDD is a specific
module located in the Complex Drivers Layer of the Basic SoftWare which interacts
with standard BSW modules or Rte.
• A CDD may need to interface to modules of the layered software architecture
• A module of the layered software architecture may need to interface to a CDD
• A CDD may need to interface SW-Cs via Rte
The main goal of the CDD is to implement complex sensor evaluation and actuator
control with direct access to the microcontroller using specific interrupts and/or complex
microcontroller peripherals, external devices (communication transceivers, ASIC...) to
fulfill the special functional and timing requirements.
In addition it might be used to implement enhanced services / protocols or encapsu-
lates legacy functionality of a non-AUTOSAR system.
CDD Implementation might be application, Microcontroler and ECU dependent.
Finally, the CDD can serve as mechanism of migration to introduce existing or new
concepts into the AUTOSAR Software Architecture.
6.1 Documentations
CDD designer shall provide a User’s Manual to ease the integration and provide infor-
mation to customers:
• CDD introduction and overview
• Description of the functional operations (initialisation, normal, shutdown, fault op-
eration...)
• Description of the relationship with and need from other BSW Modules, SchM
and Rte; e.g. memory blocks from NvM, critical sections to configure.
• Files structure and dependencies
• Description of the interfaces (including services): name, description, re-entrancy,
parameters (names, types, ranges, values), return value (name, type, range, val-
ues), configuration class.
• Description of the non-functional requirements: timing and behaviour require-
ments, resource usage, behaviour with other BSW modules or SW-C...
• Description of the Dem errors, optionally Det errors, debug variables
• Description of the configuration parameters (names, types, ranges, values).
• Description of the memory mapping needs (Flash, RAM)
• Usage limitations and open issues
• Integration constraints and requirements to other modules
• Examples
6.1.1.1 Module ID
The range of possible module IDs for CDDs is described in the document [4] List of
Basic Software Modules.
6.2 Implementation
There are few constraints coming from AUTOSAR regarding CDD implementation. At
least:
• CDD shall respect the input specifications [2], [3], [5], [6], [7], [8], [9], [10].
• CDD shall protect its critical resources defining critical sections which can be
handled by SchM or OS mechanisms.
• CDD mode may be manageable by EcuM and BswM modules.
• CDD may handle its memory sections using the memory mapping mechanisms.
• CDD may report its errors using Det or Dem modules.
The code file structure of the CDD module is not fixed, beside the requirements in the
document [2] General Requirements on Basic Software Modules and the document [5]
General Specification on Basic Software Modules.
At least, a CDD_<MODULENAME>.c shall be provided.
Interrupt functions may be placed in a CDD_<MODULENAME>_Irq.c.
Callout functions may be placed in a CDD_<MODULENAME>_Callout.c.
Depending of the need, C objects generated at Link time from configuration may be
placed in CDD_<MODULENAME>_Lcfg.c file.
Depending of the need, C objects generated at Post Build time from configuration may
be placed in CDD_<MODULENAME>_PBcfg.c file.
If an implementation of the CDD module requires additional code files, it is free to
include them.
The following figure contains the defined AUTOSAR header file hierarchy of the CDD
module.
CDD module shall provide a header file structure, so that users of the CDD module
needs only to include the CDD_<MODULENAME>.h file.
CDD module may provide a CDD_<MODULENAME>_Cbk.h header file if some call-
back functions has to be handled by other BSW modules.
Depending of the need, C objects declarations generated from configuration may
be placed in CDD_<MODULENAME>_Cfg.h, CDD_<MODULENAME>_PBcfg.h,
CDD_<MODULENAME>_Lcfg.h files.
If an implementation of the CDD module requires additional header files, it is free to
include them. The header files are self contained, that means they will include all other
header files which are required by them.
CDD module may include Det.h and/or Dem.h header files to report errors.
CDD module may include <Mip>_MemMap.h header file if some memory mapping
area have to be defined where <Mip> is the Module Implementation Prefix.
CDD module may include Rte_CDD_<MODULENAME>.h header file if interfaces to
the Rte are configured.
The following figure describes the basic defined AUTOSAR header files hierarchy of a
CDD module.
The CDD module shall avoid the integration of incompatible (.c or .h) files as defined in
the document [5] General Specification on Basic Software Modules.
CDD may directly access to microcontroller resources (e.g. a hardware timer). CDD
should use the MCAL if the needed resource is managed by a MCAL module and if
there are no specific constraints (e.g. real time need). This is highly recommended
to avoid conflicts (e.g. Parallel access to the same group/channel/etc. is mostly not
allowed because DIO services are not re-entrant).
In this case, CDD shall use the standard API of the MCAL modules to access MCAL
modules.
7.3.2 Interfacing with BSW Mode Manager & ECU State Manager
The EcuM and the BSW Mode Manager shall be the exclusive access points to the
mode management in case the ECU State Manager is used.
ECU State Manager should be used for:
• Init and De-Init functions shall be exclusively called by the EcuM and/or the BswM
modules.
• If a CDD handles a wakeup source, it must follow the protocol for handling
wakeup events specified in the document [11] Specification of ECU State Man-
ager.
BSW Mode Manager should be used for:
• CDD modes changed management
• The BswM (which is on the master core) ascertains that the ECU should be shut-
down and distributes an appropriate mode switch to each core. The CDD on
the slave cores must catch this mode switch, de-initialize appropriately and send
appropriate signals to the BswM to indicate their readiness.
The Watchdog manager may supervise the execution of one or more runnables of a
CDD as supervised entities. The watchdog manager shall be configured and CDD
runnable shall call Watchdog API as described in the document [12] Specification of
Watchdog Manager.
The Watchdog Manager is the exclusive access point to the watchdog stack.
CDD should not interact directly with the watchdog manager but through the Rte de-
fined ports.
Usually, the Rte is responsible for propagating Checkpoint information from Supervised
Entities in CDD to the Watchdog Manager module. The Watchdog Manager module
uses the services of the Runtime Environment to inform CDD about changes in the
supervision status.
To control the state-dependent behavior of CDD, the Rte provides the mechanism of
mode ports. A mode manager can switch between different modes that are defined in
the mode port. The CDD that connects to the mode port can use the mode information
in two ways:
• The CDD can query the current mode via the mode port.
• The CDD can declare Runnables that are started or stopped by the Rte because
of mode changes.
In case of failure, the Watchdog Manager may inform the CDD Supervised Entity about
supervision failures via the Rte Mode mechanism. The CDD Supervised Entity may
then take its actions to recover from that failure.
The PduR is the exclusive bus and protocol independent access point to the commu-
nication stack for IPDU.
CDD shall use standard APIs of the PduR module to access IPDU.
When CDD Interacts with the PduR, one container per CDD shall be configured within
the PduR.
Refer to the document [13] Specification of PDU Router to get more details.
The <Bus> Interfaces modules are the exclusive bus specific access point to the com-
munication stack.
CDD shall use standard APIs of the <Bus> Interfaces modules to access IPDU.
When CDD interacts with <Bus> Interface, CDD uses the access functions defined
for <Bus> Interface and <Bus> Interface callbacks shall be configured according to
CDD needs. <Bus> Interface shall be configured to include CDD_<MODULENAME>_
Cbk.h header file.
Refer to <BUS> Interface specifications and user’s manual for details.
If CDD handles Com signals, CDD shall use standard APIs of the Com module or Rte
define to access signals.
Refer to the document [14] Specification of Communication to get more details.
If CDD uses Com signals, CDD shall use standard APIs of the Com Manager to request
a "Communication Mode".
If CDD handles a <Bus> which is not AUTOSAR Standard, <Bus> States should be
handled by ComM to coordinate bus communication stack.
Refer to the document [15] Specification of Communication Manager to get more de-
tails.
If CDD handle a <Bus> which is not AUTOSAR Standard, <Bus> States should be
handled by a <Bus>Nm_CDD module.
The <Bus>Nm_CDD should provide services to the Network Manager to manage <Bus>
States.
Refer to the document [16] Specification of Network Management Interface to get more
details.
The TcpIp module is the exclusive socket-based access point to the communication
stack.
CDD shall use standard APIs of the TCP/IP module to access sockets.
Refer to the document [17] Specification of TCP/IP Stack to get more details.
If CDD handle a <Bus> which is not AUTOSAR Standard, XCP can interface <Bus>_
CDD to forward the data.
The XCP module offers configurable interfaces to be used by CDD:
• <Cdd_Transmit> : API to request the sending of a PDU via CDD
• <Xcp_CddTxConfirmation> : API to confirm the successful transmission of
the PDU
• <Xcp_CddRxIndication> : API API called by the CDD to indicate a successful
reception of a LPDU.
The XCP module shall be configured to allow CDD functionalities: XcpOnCddEnabled
parameter shall be activated.
If CDD handle a <Bus> which is not AUTOSAR Standard, Dlt can interface <Bus>_
CDD to forward the data.
The Dlt forwards the data to the Dcm or a CDD which uses a serial interface for exam-
ple.
Dlt does not define a specific communication interface. The Dlt specification defines
an API to an internal Dlt communication module. It is up to the implementer, how this
communication module is implemented and how it communicates with a possible CDD
(e.g. Serial or USB).
7.3.8 Interfacing with Default Error Tracer and Diagnostic Event Manager
CDD shall report errors using Det, Dem as described in the document [18] Description
of the AUTOSAR standard errors.
CDD shall use standard APIs of the Det & Dem modules.
CDD shall react as any BSW modules. Error ID shall be defined locally in the CDD
module. CDD is responsible for initiating an internal recovery.
Note: For calls to the Det the module id and/or the instance id parameter can be used
to distinguish between different CDDs.
Usually, only the BSW Scheduler and the Rte shall use OS objects or OS services.
Therefore, the CDD should only access to GetCounterValue and GetElapsed
CounterValue services of the OS.
The OS can be accessed by CDD as long as the used OS objects are not used by
another BSW module, e.g. CDD could create an OS alarm and use it.
OS can notify CDD by OsRestartTask that an OS-Application has been terminated
and restarted. The CDD will then have to take appropriate clean-up actions.
Refer to the document [19] Specification of Operating System to get more details.
If a CDD module implements a user defined Timebase Provider, i.e., if it handles Global
Time Synchronization messages, the CDD module shall use the StbM module API:
• StbM_GetCurrentTime to read latest time base value from StbM
• StbM_GetCurrentTimeRaw, StbM_GetCurrentTimeDiff to calculate time
base value updates
• StbM_BusSetGlobalTime to forward time base values received on the bus to
StbM
This interface is currently limited to Timebase Providers without HW time stamping.
Refer to the document [20] Specification of Synchronized Time Base Manager for de-
tails about the API.
Relevant details of the configuration of the CDD module for Global Time Synchro-
nization are specified by the container CddGlobalTimeContribution in the CDD’s
module definition. Refer to the document [10] Specification of the ECU Configuration.
• Additionally, in the latter case the initialization part of the CDD also needs to
reside in the stub part on the different core.