文档库 最新最全的文档下载
当前位置:文档库 › AUTOSAR_SWS_BSWModeManager

AUTOSAR_SWS_BSWModeManager

Document Title Specification of Basic Software

Mode Manager

Document Owner AUTOSAR

Document Responsibility AUTOSAR

Document Identification No 313

Document Classification Standard

Document Version 1.0.0

Document Status Final

Part of Release 4.0

Revision 1

Document Change History

Date Version Changed by Change Description

30.11.2009 1.0.0 AUTOSAR

Initial release

Administration

Disclaimer

This specification 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 specification.

The material contained in this specification is protected by copyright and other types of Intellectual Property Rights. The commercial exploitation of the material contained in this specification requires a license to such Intellectual Property Rights.

This specification 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 specification may be utilized or reproduced, in any form or by any means, without permission in writing from the publisher.

The AUTOSAR specifications have been developed for automotive applications only. They have neither been developed, nor tested for non-automotive applications.

The word AUTOSAR and the AUTOSAR logo are registered trademarks.

Advice for users

AUTOSAR Specification Documents may contain exemplary items (exemplary reference models, "use cases", and/or references to exemplary technical solutions, devices, processes or software).

Any such exemplary items are contained in the Specification Documents for illustration purposes only, and they themselves are not part of the AUTOSAR Standard. Neither their presence in such Specification Documents, nor any later documentation of AUTOSAR conformance of products actually implementing such exemplary items, imply that intellectual property rights covering such exemplary items are licensed under the same rules as applicable to the AUTOSAR Standard.

Table of Contents

1Introduction and functional overview (6)

2Acronyms and abbreviations (7)

3Related documentation (8)

3.1Input documents (8)

3.2Related standards and norms (9)

4Constraints and assumptions (10)

4.1Limitations (10)

4.2Applicability to car domains (10)

5Dependencies to other modules (11)

5.1RTE (11)

5.2EcuM - Fixed (11)

5.3EcuM - Flex (11)

5.4WdgM (11)

5.5ComM (11)

5.6COM (11)

5.7PduR (11)

5.8CanSM (12)

5.9LinSM (12)

5.10LinTp (12)

5.11FrSM (12)

5.12EthSM (12)

5.13DCM (12)

5.14NM Interface (12)

5.15NvM (13)

5.16OS (13)

5.17File structure (13)

5.17.1Code file structure (14)

5.17.2Header file structure (14)

6Requirements traceability (15)

7Functional specification (19)

7.1Mode Arbitration (19)

7.1.1Arbitration Rules (19)

7.1.2Mode Conditions and Logical Expressions (19)

7.1.3Requirements on Mode Arbitration (20)

7.1.4Arbitration Behavior after Initialization (22)

7.2Mode Control (22)

7.2.1Mode Processing Cycle (23)

7.2.2Requirements on Mode Control (24)

7.2.3Triggered and Conditional action lists (25)

7.2.4Available Actions (26)

7.2.5Behavior of Mode Control after Initialization (27)

7.2.6Handling of I-PDU group switching (27)

7.3Debugging Support (28)

7.4Error classification (28)

7.5Error detection (29)

7.6Error notification (29)

7.7BswM Interfaces and Ports (29)

7.7.1Mode Request Ports (32)

7.7.2Mode Switch Ports (32)

7.7.3Notifications of Mode Switches (33)

7.7.4Component Type and Internal Behavior (33)

7.7.5BswM Service (34)

8API specification (35)

8.1Imported types (35)

8.2Type definitions (35)

8.2.1BswM_ConfigType (35)

8.3Function definitions (36)

8.3.1BswM_Init (36)

8.3.2BswM_Deinit (37)

8.3.3BswM_GetVersionInfo (37)

8.3.4BswM_RequestMode (38)

8.3.5BswM_ComM_CurrentMode (39)

8.3.6BswM_Dcm_RequestCommunicationMode (39)

8.3.7BswM_Dcm_RequestSessionMode (40)

8.3.8BswM_Dcm_RequestResetMode (41)

8.3.9BswM_CanSM_CurrentState (41)

8.3.10BswM_EthSM_CurrentState (42)

8.3.11BswM_FrSM_CurrentState (43)

8.3.12BswM_LinSM_CurrentState (44)

8.3.13BswM_EcuM_CurrentState (44)

8.3.14BswM_EcuM_CurrentWakeup (45)

8.3.15BswM_NvM_RequestMode (46)

8.3.16BswM_LinSM_CurrentSchedule (46)

8.3.17BswM_LinTp_RequestMode (47)

8.4Call-back notifications (48)

8.5Scheduled functions (48)

8.5.1BswM_MainFunction (49)

8.6Expected Interfaces (49)

8.6.1Mandatory Interfaces (49)

8.6.2Optional Interfaces (49)

9Sequence diagrams (52)

9.1Deferred operation of BswM (52)

9.2Immediate operation of BswM (53)

10Configuration specification (54)

10.1How to read this chapter (54)

10.1.1Configuration and configuration parameters (54)

10.1.2Variants (54)

10.1.3Containers (55)

10.1.4Specification template for configuration parameters (55)

10.2Containers and configuration parameters (57)

10.2.1BswM (57)

10.2.2BswMGeneral (57)

10.2.3BswMConfig (58)

10.2.4BswMArbitration (58)

10.2.5BswMRule (59)

10.2.6BswMModeRequestPort (60)

10.2.7BswMModeRequestSource (62)

10.2.8BswMCanSMIndication (63)

10.2.9BswMDcmComModeRequest (63)

10.2.10BswMDcmResetModeRequest (63)

10.2.11BswMDcmSessionModeRequest (64)

10.2.12BswMEcuMIndication (64)

10.2.13BswMEcuMWakeupSource (64)

10.2.14BswMEthSMIndication (65)

10.2.15BswMFrSMIndication (65)

10.2.16BswMComMIndication (65)

10.2.17BswMNvMRequest (66)

10.2.18BswMLinScheduleIndication (66)

10.2.19BswMLinTpModeRequest (67)

10.2.20BswMGenericRequest (67)

10.2.21BswMLinSMIndication (68)

10.2.22BswMSwcModeRequest (68)

10.2.23BswMSwcModeNotification (69)

10.2.24BswMWdgMRequestPartitionReset (69)

10.2.25BswMModeCondition (70)

10.2.26BswMConditionValue (70)

10.2.27BswMBswMode (71)

10.2.28BswMSwcMode (72)

10.2.29BswMLogicalExpression (72)

10.2.30BswMModeControl (73)

10.2.31BswMAction (74)

10.2.32BswMActionList (74)

10.2.33BswMActionListItem (74)

10.2.34BswMAvailableActions (75)

10.2.35BswMComMModeSwitch (76)

10.2.36BswMComMAllowCom (77)

10.2.37BswMComMModeLimitation (77)

10.2.38BswMDeadlineMonitoringControl (78)

10.2.39BswMTriggerIPduSend (79)

10.2.40BswMNMControl (79)

10.2.41BswMLinScheduleSwitch (80)

10.2.42BswMPduGroupSwitch (80)

10.2.43BswMResetSignalInitValues (81)

10.2.44BswMPduRouterControl (81)

10.2.45BswMUserCallout (82)

10.2.46BswMRteSwitch (83)

10.2.47BswMSchMSwitch (83)

10.3Published Information (84)

1 Introduction and functional overview

This specification specifies the functionality, API and the configuration of the AUTOSAR Basic Software module BSW Mode Manager (BswM).

The BSW Mode Manager is the module that implements the part of the Vehicle Mode Management and Application Mode Management concept that resides in the BSW. Its responsibility is to arbitrate mode requests from application layer SW-Cs or other BSW modules based on simple rules, and perform actions based on the arbitration result.

2 Acronyms and abbreviations

Abbreviation /

Description:

Acronym:

Management AMM Application

Mode

Software

BSW Basic

Manager

BswM BSW

Mode

Manager

Dem Diagnostic

Event

Det Development Error Tracer

ECU Electric Control Unit

RTE Real Time Environment

VMM Vehicle Mode Management

Table 1: Table of acronyms and abbreviations

3 Related documentation

3.1 Input documents

[1] List of Basic Software Modules

AUTOSAR_TR_BSWModuleList.pdf

[2] Layered Software Architecture

AUTOSAR_EXP_LayeredSoftwareArchitecture.pdf.pdf

[3] General Requirements on Basic Software Modules AUTOSAR_SRS_BSWGeneral.pdf

[4] Requirements on Mode Management

AUTOSAR_SRS_ModeManagement.pdf

[5] Specification of Communication

AUTOSAR_SWS_COM.pdf

[6] Specification of FlexRay State Manager

AUTOSAR_SWS_FlexRayStateManager.pdf

[7] Specification of PDU Router

AUTOSAR_SWS_PDURouter.pdf

[8] Specification of ECU Configuration

AUTOSAR_TPS_ECUConfiguration.pdf

[9] Specification of Development Error Tracer

AUTOSAR_SWS_DevelopmentErrorTracer.pdf

[10] Specification of RTE Software

AUTOSAR_SWS_RTE.pdf

[11] Specification of Diagnostic Communication Manager AUTOSAR_SWS_DiagnosticCommunicationManager.pdf [12] Specification of ECU State Manager

AUTOSAR_SWS_ECUStateManager.pdf

[13] Specification of LIN State Manager

AUTOSAR_SWS_LINStateManager.pdf

[14] Specification of CAN State Manager

AUTOSAR_SWS_CANStateManager.pdf

[15] Specification of Generic Network Management Interface AUTOSAR_SWS_NetworkManagementInterface.pdf

[16] Specification of Communication Manager AUTOSAR_SWS_COMManager.pdf

[17] Specification of Ethernet State Manager AUTOSAR_SWS_EthernetStateManager.pdf

3.2 Related standards and norms None.

4 Constraints and assumptions

4.1 Limitations

Maximum one instance of the BSW Mode Manager may be used within an AUTOSAR ECU.

4.2 Applicability to car domains

The BSW Mode Manager is applicable to all car domains.

5 Dependencies to other modules

The BSW Mode Manager has interfaces to many of the BSW Modules in the AUTOSAR architecture. The majority of these interfaces are however optional and are used based on the needs of each ECU.

5.1 RTE

The BswM receives mode requests from the SW-Cs via the RTE. Mode Switch Notifications are also propagated to the SW-Cs via the RTE.

5.2 EcuM - Fixed

When EcuM – Fixed is used it will indicate the current ECU state to the BswM.

5.3 EcuM - Flex

When EcuM – Flex is used BswM will change the EcuM state using standard RTE switch calls to the RTE. EcuM Flex can also indicate the state of its wakeup sources to BswM.

5.4 WdgM

Mode Switch Indications originating from the WdgM go through the BswM for further propagation to the SW-Cs. The WdgM also request reset of partitions via the BswM 5.5 ComM

Mode Switch Indications originating from the ComM go through the BswM for further propagation to the SW-Cs.

The BswM can act as a ComM user requesting communication modes.

5.6 COM

The handling of I-PDU Groups in COM is performed by the BswM. As a part of I-PDU group start/stop it is possible to have the included signal values reset to their corresponding initialization values.

BswM handles enable and disable of deadline monitoring of signals in COM.

BswM can also trigger transmission of an I-PDU.

5.7 PduR

The BswM can enable and disable routing groups of I-PDU:s in the PDU

router.

5.8 CanSM

Mode Switch Indications originating from the CanSM go through the BswM for further propagation to the SW-Cs.

5.9 LinSM

BswM coordinates switching of LIN Schedule Tables in the LinSM with starting and stopping of the corresponding I-PDU groups in COM.

Mode Switch Indications originating from the LinSM go through the BswM for further propagation to the SW-Cs.

5.10 LinTp

The LIN Transport Protocol that is a part of LinIf requests modes from BswM to make sure that the correct LIN Schedule Table is active during LinTp operation.

5.11 FrSM

Mode Switch Indications originating from the FrSM go through the BswM for further propagation to the SW-Cs.

The usage of “Single Slot Mode” on FlexRay is controlled by the FrSM by request of BswM.

5.12 EthSM

Mode Switch Indications originating from the EthSM go through the BswM for further propagation to the SW-Cs.

5.13 DCM

The DCM performs mode requests to the BswM based on the diagnostic requests it receives.

Example: DCM can request “Disable Normal Communication”. During this mode BswM will turn off the corresponding I-PDU groups and NM PDU:s.

5.14 NM Interface

BswM will use the Nm_EnableCommunication and Nm_DisableCommunication to control the NM communication based on the current mode.

Example: In “Disable Normal Communication” mode the BswM needs to disable NM communication on the corresponding NM channel.

5.15 NvM

The NvM module reports the state of its blocks to the BswM via “integration code“ registered as NvM callbacks. BswM have actions causing the NvM to read and write all blocks during startup and shutdown.

5.16 OS

The features of OS that BswM needs to use is implementation specific.

5.17 File structure

Figure 1: File structure of BSW Mode ManagerFigure 1 shows the file structure of the BSW Mode Manager and the header files of other modules it needs to include.

?source?

Figure 1: File structure of BSW Mode Manager

The BswM may use interfaces in AUTOSAR BSW modules that are not explicitly defined within this specification.

5.17.1 Code file structure

BswM0024:

The code file structure shall not be defined within this specification completely. At this point it shall be pointed out that the code-file structure shall include the following files named:

- BswM_Lcfg.c – for link time configurable parameters and

- BswM_PBcfg.c – for post build time configurable parameters.

These files shall contain all link time and post-build time configurable parameters.

5.17.2 Header file structure

BswM0025:

The BswM shall include the header files of all other BSW modules which API functions it uses.

Specifically it shall include StdTypes.h and ComStack_Types.h to avoid redefinition of types. BswM0026:

The BswM module shall provide the following set of header files for other BSW modules to include:

1. BswM header file: BswM.h, BswM_CanSM.h, BswM_LinSM.h,

BswM_FrSM.h, BswM_EthSM.h, BswM_RTE.h, BswM_EcuM.h, BswM_COM.h, BswM_ComM.h, BswM_WdgM.h, BswM_DCM.h

2. BswM configuration file: BswM_Cfg.h

BswM0027:

The module shall include the Dem.h file. By this inclusion the APIs to report errors as well as the required Event Id symbols are included. This specification defines the name of the Event Id symbols which are provided by XML to the DEM configuration tool. The DEM configuration tool assigns ECU dependent values to the Event Id symbols and publishes the symbols in Dem_IntErrId.h.

6 Requirements traceability

Document: AUTOSAR requirements on Basic Software, general [3].

Requirement

Satisfied by

BswM0021

[BSW00344] Reference to link--time configuration

[BSW00404] Reference to post build time configuration

Chapter 5 [BSW00405] Reference to multiple configuration sets

Not applicable [BSW00345] Configuration at Compile time

BswM0020 [BSW159] Automatic configuration Chapter 10 [BSW167] Static configuration checking Chapter 10 [BSW171] Configurability of optional functionality

Chapter 10 [BSW170] Data for reconfiguration of AUTOSAR SW--Components

Not applicable [BSW00380] Separate C--Files for configuration parameters

BswM0024 [BSW00419] Separate C--Files for pre--compile time configuration parameters BswM0024

[BSW00381] Separate configuration header file for pre--compile time parameters

BswM0026 [BSW00412] Separate H--File for configuration parameters

BswM0026 [BSW00383] List dependencies of configuration files

Chapter 5 [BSW00384] List dependencies to other modules

Chapter 5 [BSW00387] Specify the configuration class of callback function

Not applicable [BSW00388] Introduce containers Chapter 10 [BSW00389] Containers shall have names

Chapter 10 [BSW00390] Parameter content shall be unique within the module

Chapter 10 [BSW00391] Parameter shall have unique names

Chapter 10 [BSW00392] Parameters shall have a type

Chapter 10 [BSW00393] Parameters shall have a range

Chapter 10 [BSW00394] Specify the scope of the parameters

Chapter 10 [BSW00395] List the required parameters (per parameter)

Chapter 10

[BSW00396] Configuration classes Chapter 10

Chapter 10

[BSW00397] Pre--compile--time

parameters

10

[BSW00398] Link--time parameters Chapter

Not applicable

[BSW00399] Loadable Post--build time

parameters

[BSW00400] Selectable Post--build time

Not applicable

parameters

Chapter 10

[BSW00438] Post Build Configuration

Data Structure

[BSW00402] Published information Chapter 10

[BSW101] Initialization interface BswM0002

[BSW00406] Check module initialization BswM0077, BswM0078, BswM0079,

BswM0080, BswM0081, BswM0082,

BswM0083, BswM0084, BswM0086

BswM0003

[BSW00407] Function to read out

published parameters

[BSW00423] Usage of SW--C template to

Chapter 7.7

describe BSW modules with AUTOSAR

Interfaces

[BSW00336] Shutdown interface Not Applicable

[BSW00337] Classification of errors Chapter 7.3

Chapter 7.4

[BSW00338] Detection and Reporting of

development errors

Chapter 8

[BSW00369] Do not return development

error codes via API

[BSW00339] Reporting of production

Not Applicable

relevant errors and exceptions

[BSW00323] API parameter checking Chapter 8

[BSW00409] Header files for production

Not Applicable

code error IDs

Chapter 7.3

[BSW00385] List possible error

notifications

Chapter 7.4

[BSW00386] Configuration for detecting

an error

[BSW00415] User dependent include files BswM0026

Chapter 10

[BSW00343] Specification and

configuration of time

[BSW00346] Basic set of module files Chapter 5

Chapter 5

[BSW158] Separation of configuration

from implementation

Chapter 8

[BSW00370] Separation of callback

interface from API

[BSW00357] Standard API return type Chapter 8

[BSW00377] Module specific API return

Chapter 8

types

Chapter 8

[BSW00371] Do not pass function

pointers via API

[BSW00358] Return type of init() Chapter 8

functions

[BSW00414] Parameter of init function Chapter 8

[BSW00376] Return type and parameters

of main processing functions

Chapter 8

[BSW00359] Return type of callback

functions

Chapter 8

[BSW00360] Parameters of callback

functions

Chapter 8

[BSW00440] Function prototype for

callback functions of AUTOSAR Services

Chapter 7.7

[BSW00374] Module vendor identification Chapter 10

[BSW00379] Module identification Chapter

10

[BSW003] Version identification Chapter 10

[BSW00318] Format of module version

numbers

Chapter 10

[BSW00321] Enumeration of module

version numbers

Chapter 10

Document: AUTOSAR Requirements on Mode Management [4].

Requirement Satisfied by

[BSW09177] Support of a configurable

mode arbitration

BswM0010, BswM0012

[BSW09178] Support of Lists of Mode

Dependant Actions

BswM0016, BswM0015

[BSW09175] Support of a configurable

set of mode dependent enabled and

concomitant disabled IPDU groups

BswM0038

[BSW09176] Support of a configurable

set of mode dependent to be enabled

IPDU groups

BswM0038

[BSW09183] Support of Mode dependent

to be reset Signal Initial Values

BswM0038

[BSW09174] Support of “Disable normal

Communication”

BswM0038

[BSW09179] Provision of an Interface to

allow Mode Requests of SW C’s

Chapter 7.6 and BswM0046

[BSW09180] Arbitration of Mode

Requests

BswM0009, BswM0013, BswM0014

[BSW09182] Local propagation of mode

change information

BswM0038

[BSW09184] Mode dependent activation

and deactivation of IPDU groups

BswM0038

[BSW09228] Provision of an Interface to allow Mode Requests of BSW Modules BswM0046, BswM0047, BswM0048, BswM0049, BswM0050, BswM0051, BswM0052

[BSW09229] Mode dependent callout BswM0039,

BswM0040

[BSW09230] All actions shall only be

BswM0011, BswM0023 performed on mode change

7 Functional specification

This chapter specifies the functional behavior of the BSW Mode Manager. The operation of the BSW Mode Manager basic functionality can be described as two different tasks, Mode Arbitration and Mode Control.

The Mode Arbitration part initiates mode switches resulting from rule based arbitration of mode requests and mode indications received from SW-Cs or other BSW modules.

The Mode Control part performs the mode switches by execution of action lists containing mode switch operations of other BSW modules.

The BswM should be seen as a mode management framework module which behavior is completely defined by its configuration.

There may be different ways of implementing this, such as generation of the complete BswM based on the configuration, or as a rule interpreter that parses an encoded configuration in run time.

However this specification does not intend to specify any implementation details of the BSW Mode Manager. Hence, any examples stated in this document describing design details should be treated as explanatory text and not as requirements.

7.1 Mode Arbitration

The Mode Arbitration performed by the BswM is simple and rule based. The rules used for mode arbitration are specified in the configuration of the BSW Mode Manager module.

The rules are composed of trivial Boolean expressions and the mode arbitration is thus expected to have a low runtime impact.

To know what action lists to execute the BswM is required to detect changes in mode arbitration result from previous rule evaluation. How this is done and the memory needed to store results is implementation specific and not described in this document.

7.1.1 Arbitration Rules

A rule is a logical expression that is composed of a set of mode request conditions. The rules are evaluated when the input mode requests and mode indications are changed or during the execution of the BswM main function. The result of the evaluation (True or False) is used to decide about execution of the corresponding mode control Action List.

7.1.2 Mode Conditions and Logical Expressions.

The logical expression that comprises a mode arbitration rule can use different operators such as AND, OR, XOR, NAND. Each term in the expression corresponds to a mode request condition. These conditions verify if a requested or indicated mode is EQUAL or NOT_EQUAL to a certain mode. An example rule with two conditions is shown in Figure 2. The rules, and the set of available logical operations are defined as a part of the ECU configuration described in chapter 10.2.

Figure 2: Rule execution in the Mode Arbitration part of the BswM.

7.1.3 Requirements on Mode Arbitration

As mentioned above, the BswM accepts mode requests and mode indications as input for the mode arbitration. Mode requests normally originate from the application SW-Cs but may also be produced by other BSW modules such as the DCM. Mode indications are always issued by other BSW modules such as the different bus specific State Managers, EcuM and WdgM. In this document the generic term mode arbitration request corresponds either to a mode indication or a mode request.

BswM0009:

The BswM shall perform mode arbitration based on incoming mode requests.

BswM0035:

The BswM shall perform mode arbitration based on incoming mode indications.

Note: All mode arbitration requests (requests and indications) are handled in the same way by the BswM. They are configured by selection of the corresponding mode condition type in the BswMModeRequestSource configuration container.

BswM0010:

The BswM shall perform mode arbitration using predefined rules.

相关文档